1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
#ifndef HPC_MATVEC_R_H
#define HPC_MATVEC_R_H 1

#include <cassert>
#include <type_traits>
#include <hpc/ulmblas/ger.h>
#include <hpc/matvec/isdensevector.h>
#include <hpc/matvec/isgematrix.h>

namespace hpc { namespace matvec {

template <typename Alpha, typename VX, typename VY, typename MA>
    /*
typename std::enable_if<IsDenseVector<VX>::value
                     && IsDenseVector<VY>::value
                     && IsGeMatrix<MA>::value,
         void>::type
         */
void
r(const Alpha &alpha, const VX &x, const VY &y, MA &&A)
{
    assert(x.length==A.numRows);
    assert(y.length==A.numCols);

    return ulmblas::ger(A.numRows, A.numCols,
                        alpha,
                        x.data, x.inc,
                        y.data, y.inc,
                        A.data, A.incRow, A.incCol);
}

} } // namespace matvec, hpc

#endif // HPC_MATVEC_R_H