 |
fml
0.1-0
Fused Matrix Library
|
5 #ifndef FML_CPU_LINALG_CROSSPROD_H
6 #define FML_CPU_LINALG_CROSSPROD_H
10 #include "../cpumat.hh"
12 #include "internals/blas.hh"
36 template <
typename REAL>
39 const len_t m = x.
nrows();
40 const len_t n = x.
ncols();
46 fml::blas::syrk(
'L',
'T', n, m, alpha, x.
data_ptr(), m, (REAL)0.0, ret.
data_ptr(), n);
50 template <
typename REAL>
53 const len_t n = x.
ncols();
80 template <
typename REAL>
83 const len_t m = x.
nrows();
84 const len_t n = x.
ncols();
90 fml::blas::syrk(
'L',
'N', m, n, alpha, x.
data_ptr(), m, (REAL)0.0, ret.
data_ptr(), m);
93 template <
typename REAL>
96 const len_t m = x.
nrows();
Matrix class for data held on a single CPU.
Definition: cpumat.hh:36
void crossprod(const REAL alpha, const cpumat< REAL > &x, cpumat< REAL > &ret)
Computes lower triangle of alpha*x^T*x.
Definition: crossprod.hh:37
void fill_zero()
Set all values to zero.
Definition: cpumat.hh:362
len_t nrows() const
Number of rows.
Definition: unimat.hh:36
void resize(len_t nrows, len_t ncols)
Resize the internal object storage.
Definition: cpumat.hh:233
len_t ncols() const
Number of columns.
Definition: unimat.hh:38
REAL * data_ptr()
Pointer to the internal array.
Definition: unimat.hh:40
Core namespace.
Definition: dimops.hh:10
void tcrossprod(const REAL alpha, const cpumat< REAL > &x, cpumat< REAL > &ret)
Computes lower triangle of alpha*x*x^T.
Definition: crossprod.hh:81