5 #ifndef FML_CPU_STATS_H 6 #define FML_CPU_STATS_H 35 template <
typename REAL>
44 const REAL d = 1.0 / sqrt((REAL)std::max(x.
nrows()-1, 1));
48 for (len_t i=0; i<sdev.
size(); i++)
Vector class for data held on a single CPU.
Definition: cpuvec.hh:27
T * data_ptr()
Pointer to the internal array.
Definition: univec.hh:26
len_t nrows() const
Number of rows.
Definition: unimat.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:232
len_t size() const
Number of elements in the vector.
Definition: univec.hh:24
void svd(cpumat< REAL > &x, cpuvec< REAL > &s)
Computes the singular value decomposition.
Definition: linalg.hh:457
Matrix class for data held on a single CPU.
Definition: cpumat.hh:32
Statistics kernels.
Definition: stats.hh:15
void pca(const bool rm_mean, const bool rm_sd, cpumat< REAL > &x, cpuvec< REAL > &sdev, cpumat< REAL > &rot)
Principal components analysis.
Definition: stats.hh:36
void xpose(const cpumat< REAL > &x, cpumat< REAL > &tx)
Computes the transpose out-of-place (i.e. in a copy).
Definition: linalg.hh:281