 |
fml
0.1-0
Fused Matrix Library
|
5 #ifndef FML_MPI_STATS_PCA_H
6 #define FML_MPI_STATS_PCA_H
10 #include "../dimops.hh"
12 #include "../linalg/svd.hh"
13 #include "../linalg/xpose.hh"
39 template <
typename REAL>
43 linalg::err::check_grid(x, rot);
47 auto g = x.get_grid();
52 const REAL d = 1.0 / sqrt((REAL)std::max(x.
nrows()-1, 1));
59 template <
typename REAL>
67 const REAL d = 1.0 / sqrt((REAL)std::max(x.
nrows()-1, 1));
Matrix class for data distributed over MPI in the 2-d block cyclic format.
Definition: mpimat.hh:40
void xpose(const cpumat< REAL > &x, cpumat< REAL > &tx)
Computes the transpose out-of-place (i.e. in a copy).
Definition: xpose.hh:37
len_t nrows() const
Number of rows.
Definition: unimat.hh:36
void pca(const bool rm_mean, const bool rm_sd, cpumat< REAL > &x, cpuvec< REAL > &sdev, cpumat< REAL > &rot)
Principal components analysis.
Definition: pca.hh:40
Vector class for data held on a single CPU.
Definition: cpuvec.hh:31
void scale(const bool rm_mean, const bool rm_sd, cpumat< REAL > &x)
Remove the mean and/or the sd from a matrix.
Definition: dimops.hh:376
void scale(const T s)
Multiply all values by the input value.
Definition: cpuvec.hh:421
void svd(cpumat< REAL > &x, cpuvec< REAL > &s)
Computes the singular value decomposition.
Definition: svd.hh:101
Core namespace.
Definition: dimops.hh:10