 |
fml
0.1-0
Fused Matrix Library
|
5 #ifndef FML_MPI_LINALG_CROSSPROD_H
6 #define FML_MPI_LINALG_CROSSPROD_H
12 #include "../../_internals/linalgutils.hh"
14 #include "../mpimat.hh"
16 #include "internals/err.hh"
17 #include "internals/pblas.hh"
43 template <
typename REAL>
46 err::check_grid(x, ret);
48 const len_t n = x.
ncols();
54 fml::pblas::syrk(
'L',
'T', n, x.
nrows(), alpha, x.
data_ptr(), x.desc_ptr(), (REAL) 0, ret.
data_ptr(), ret.desc_ptr());
58 template <
typename REAL>
61 const len_t n = x.
ncols();
62 const grid g = x.get_grid();
91 template <
typename REAL>
94 err::check_grid(x, ret);
96 const len_t m = x.
nrows();
102 fml::pblas::syrk(
'L',
'N', m, x.
ncols(), alpha, x.
data_ptr(), x.desc_ptr(), (REAL) 0, ret.
data_ptr(), ret.desc_ptr());
106 template <
typename REAL>
109 const len_t n = x.
nrows();
110 const grid g = x.get_grid();
void resize(len_t nrows, len_t ncols)
Resize the internal object storage.
Definition: mpimat.hh:326
2-dimensional MPI process grid.
Definition: grid.hh:70
void crossprod(const REAL alpha, const cpumat< REAL > &x, cpumat< REAL > &ret)
Computes lower triangle of alpha*x^T*x.
Definition: crossprod.hh:37
Matrix class for data distributed over MPI in the 2-d block cyclic format.
Definition: mpimat.hh:40
len_t nrows() const
Number of rows.
Definition: unimat.hh:36
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 fill_zero()
Set all values to zero.
Definition: mpimat.hh:565
void tcrossprod(const REAL alpha, const cpumat< REAL > &x, cpumat< REAL > &ret)
Computes lower triangle of alpha*x*x^T.
Definition: crossprod.hh:81