DMRITool  v0.1.1-139-g860d86b4
Diffusion MRI Tool
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
spams::Matrix< T > Class Template Reference

#include <linalg.h>

+ Inheritance diagram for spams::Matrix< T >:
+ Collaboration diagram for spams::Matrix< T >:

Detailed Description

template<typename T>
class spams::Matrix< T >

Dense Matrix class.

Class Matrix.

Definition at line 61 of file linalg.h.

Public Member Functions

void add (const Matrix< T > &mat, const T alpha=1.0)
 
void add (const T alpha)
 
virtual void add_rawCol (const int i, T *DtXi, const T a) const
 
void addDiag (const Vector< T > &diag)
 
void addDiag (const T diag)
 
void addRow (const int i, const Vector< T > &row, const T a=1.0)
 
void addToCols (const Vector< T > &diag)
 
void addVecToCols (const Vector< T > &diag, const T a=1.0)
 
asum () const
 
void blockThrshold (const T nu, const int sizeGroup)
 
void center ()
 
void center (Vector< T > &centers)
 
void center_rows ()
 
void clean ()
 
void clear ()
 
void conjugateGradient (const Vector< T > &b, Vector< T > &x, const T tol=1e-4, const int=4) const
 
void copy (const Matrix< T > &mat)
 
void copyCol (const int i, Vector< T > &x) const
 
void copyMask (Matrix< T > &out, Vector< bool > &mask) const
 
void copyRef (const Matrix< T > &mat)
 
void copyRow (const int i, Vector< T > &x) const
 
void copyTo (Matrix< T > &mat) const
 
void diag (Vector< T > &d) const
 
void div_elementWise (const Matrix< T > &B, Matrix< T > &C) const
 
dot (const Matrix< T > &mat) const
 
void drop (char *fileName) const
 
eigLargestMagnSym (const Vector< T > &u0, Vector< T > &u) const
 
eigLargestMagnSym () const
 
void eigLargestSymApprox (const Vector< T > &u0, Vector< T > &u) const
 
void exp ()
 
void extract_rawCol (const int i, T *x) const
 
void extractRow (const int i, Vector< T > &row) const
 
void eye ()
 
void fakeSize (const int m, const int n)
 
void fillRow (const Vector< T > &row)
 
void fillSymmetric ()
 
void fillSymmetric2 ()
 
int fmax () const
 
fmaxval () const
 
int fmin () const
 
void getData (Vector< T > &data, const int i) const
 
virtual void getGroup (Matrix< T > &data, const vector_groups &groups, const int i) const
 
void hardThrshold (const T nu)
 
void incrDiag ()
 
void inv ()
 
void inv_elem ()
 
void Invsqrt ()
 
void invSym ()
 
bool isNormalized () const
 
int m () const
 
 Matrix (T *X, int m, int n)
 
 Matrix (int m, int n)
 
 Matrix ()
 
mean () const
 
void meanCol (Vector< T > &mean) const
 
void meanRow (Vector< T > &mean) const
 
void merge (const Matrix< T > &B, Matrix< T > &C) const
 
void mult (const Vector< T > &x, Vector< T > &b, const T alpha=1.0, const T beta=0.0) const
 
void mult (const SpVector< T > &x, Vector< T > &b, const T alpha=1.0, const T beta=0.0) const
 
void mult (const Matrix< T > &B, Matrix< T > &C, const bool transA=false, const bool transB=false, const T a=1.0, const T b=0.0) const
 
void mult (const SpMatrix< T > &B, Matrix< T > &C, const bool transA=false, const bool transB=false, const T a=1.0, const T b=0.0) const
 
void mult_elementWise (const Matrix< T > &B, Matrix< T > &C) const
 
void multDiagLeft (const Vector< T > &diag)
 
void multDiagRight (const Vector< T > &diag)
 
void multSwitch (const Matrix< T > &B, Matrix< T > &C, const bool transA=false, const bool transB=false, const T a=1.0, const T b=0.0) const
 
void multTrans (const Vector< T > &x, Vector< T > &b, const T alpha=1.0, const T beta=0.0) const
 
void multTrans (const Vector< T > &x, Vector< T > &b, const Vector< bool > &active) const
 
void multTrans (const SpVector< T > &x, Vector< T > &b, const T alpha=1.0, const T beta=0.0) const
 
int n () const
 
void NadarayaWatson (const Vector< int > &ind, const T sigma)
 
void neg ()
 
norm_1_2_col () const
 
void norm_2_cols (Vector< T > &norms) const
 
void norm_2_rows (Vector< T > &norms) const
 
void norm_2sq_cols (Vector< T > &norms) const
 
void norm_2sq_rows (Vector< T > &norms) const
 
norm_inf_2_col () const
 
void norm_inf_cols (Vector< T > &norms) const
 
void norm_inf_rows (Vector< T > &norms) const
 
void norm_l1_rows (Vector< T > &norms) const
 
void normalize ()
 
void normalize2 ()
 
normF () const
 
normFsq () const
 
nrm2sq () const
 
T & operator() (const int i, const int j)
 
operator() (const int i, const int j) const
 
T & operator[] (const int index)
 
operator[] (const int index) const
 
void print (const string &name) const
 
quad (const Vector< T > &vec1, const SpVector< T > &vec2) const
 
quad (const SpVector< T > &vec) const
 
void quad_mult (const Vector< T > &vec1, const SpVector< T > &vec2, Vector< T > &y, const T a=1.0, const T b=0.0) const
 
void rank1Update (const Vector< T > &vec1, const Vector< T > &vec2, const T alpha=1.0)
 
void rank1Update (const SpVector< T > &vec1, const Vector< T > &vec2, const T alpha=1.0)
 
void rank1Update (const Vector< T > &vec1, const SpVector< T > &vec2, const T alpha=1.0)
 
void rank1Update (const SpVector< T > &vec, const T alpha=1.0)
 
void rank1Update (const SpVector< T > &vec, const SpVector< T > &vec2, const T alpha=1.0)
 
void rank1Update_mult (const Vector< T > &vec1, const Vector< T > &vec1b, const SpVector< T > &vec2, const T alpha=1.0)
 
T * rawX () const
 
void refCol (int i, Vector< T > &x) const
 
void refSubMat (int i, int n, Matrix< T > &mat) const
 
void resize (int m, int n)
 
void scal (const T a)
 
void set (const T a)
 
void setAleat ()
 
void setData (T *X, int m, int n)
 
void setDiag (const Vector< T > &d)
 
void setDiag (const T val)
 
void setm (const int m)
 
void setn (const int n)
 
void setRow (const int i, const Vector< T > &row)
 
void setZeros ()
 
void singularValues (Vector< T > &u) const
 
void softThrshold (const T nu)
 
void sparseProject (Matrix< T > &out, const T thrs, const int mode=1, const T lambda1=0, const T lambda2=0, const T lambda3=0, const bool pos=false, const int numThreads=-1)
 
void Sqrt ()
 
void sub (const Matrix< T > &mat)
 
void subMatrixSym (const Vector< int > &indices, Matrix< T > &subMatrix) const
 
void sum_cols (Vector< T > &sum) const
 
void svd (Matrix< T > &U, Vector< T > &S, Matrix< T > &V) const
 
void svdRankOne (const Vector< T > &u0, Vector< T > &u, Vector< T > &v) const
 
void thrsabsmin (const T nu)
 
void thrsmax (const T nu)
 
void thrsmin (const T nu)
 
void thrsPos ()
 
void toSparse (SpMatrix< T > &matrix) const
 
void toSparseTrans (SpMatrix< T > &matrixTrans)
 
void toVect (Vector< T > &vec) const
 
trace () const
 
void transformFilter ()
 
void transpose (Matrix< T > &trans)
 
void unwhiten (Vector< T > &mean, const bool pattern=false)
 
void upperTriXXt (Matrix< T > &XXt, const int L) const
 
int V () const
 
void whiten (const int V)
 
void whiten (Vector< T > &mean, const bool pattern=false)
 
void whiten (Vector< T > &mean, const Vector< T > &mask)
 
const T * X () const
 
void XtX (Matrix< T > &XtX) const
 
void XXt (Matrix< T > &XXt) const
 
virtual ~Matrix ()
 
- Public Member Functions inherited from spams::Data< T >
virtual ~Data ()
 
- Public Member Functions inherited from spams::AbstractMatrix< T >
virtual ~AbstractMatrix ()
 
- Public Member Functions inherited from spams::AbstractMatrixB< T >
virtual ~AbstractMatrixB ()
 

Protected Member Functions

 Matrix (const Matrix< T > &matrix)
 
Matrix< T > & operator= (const Matrix< T > &matrix)
 

Protected Attributes

bool _externAlloc
 
int _m
 
int _n
 
T * _X
 

Friends

class SpMatrix< T >
 

Constructor & Destructor Documentation

template<typename T >
spams::Matrix< T >::Matrix ( T *  X,
int  m,
int  n 
)

Constructor with existing data X of an m x n matrix.

Definition at line 1052 of file linalg.h.

template<typename T >
spams::Matrix< T >::Matrix ( int  m,
int  n 
)

Constructor for a new m x n matrix.

Definition at line 1057 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

template<typename T >
spams::Matrix< T >::Matrix ( )

Empty constructor.

Definition at line 1066 of file linalg.h.

template<typename T >
spams::Matrix< T >::~Matrix ( )
virtual

Destructor.

Definition at line 1070 of file linalg.h.

References spams::Matrix< T >::clear().

+ Here is the call graph for this function:

template<typename T>
spams::Matrix< T >::Matrix ( const Matrix< T > &  matrix)
explicitprotected

Forbid lazy copies.

Member Function Documentation

template<typename T >
void spams::Matrix< T >::add ( const Matrix< T > &  mat,
const T  alpha = 1.0 
)
inline

add alpha*mat to the current matrix

Definition at line 2062 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

Referenced by spams::FISTA::ADMM(), spams::Trainer< T >::train(), and spams::Trainer< T >::trainOffline().

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::add ( const T  alpha)
inline

add alpha to the current matrix

Definition at line 2075 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

template<typename T >
void spams::Matrix< T >::add_rawCol ( const int  i,
T *  DtXi,
const T  a 
) const
inlinevirtual

Copy the column i into x.

Implements spams::AbstractMatrix< T >.

Definition at line 1121 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

template<typename T >
void spams::Matrix< T >::addDiag ( const Vector< T > &  diag)
inline

Definition at line 1506 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, MIN, and spams::Vector< T >::rawX().

Referenced by spams::ist(), spams::lasso(), spams::lasso2(), and spams::Trainer< T >::train().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::addDiag ( const T  diag)
inline

Definition at line 1512 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, and MIN.

template<typename T >
void spams::Matrix< T >::addRow ( const int  i,
const Vector< T > &  row,
const T  a = 1.0 
)
inline

fill the matrix with the row given

Definition at line 2268 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

Referenced by spams::Matrix< T >::mult(), and spams::SpMatrix< T >::mult().

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::addToCols ( const Vector< T > &  diag)
inline

Definition at line 1517 of file linalg.h.

References spams::Matrix< T >::_n, spams::Vector< T >::add(), and spams::Matrix< T >::refCol().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::addVecToCols ( const Vector< T > &  diag,
const T  a = 1.0 
)
inline

Definition at line 1526 of file linalg.h.

References spams::Matrix< T >::_n, spams::Vector< T >::add(), and spams::Matrix< T >::refCol().

Referenced by spams::FISTA::ADMM(), and spams::FISTA::LagrangianADMM().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
T spams::Matrix< T >::asum ( ) const
inline

compute the sum of the magnitude of the matrix values

Definition at line 2085 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

Referenced by spams::ist_groupLasso().

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::blockThrshold ( const T  nu,
const int  sizeGroup 
)
inline

performs soft-thresholding of the vector

perform soft-thresholding of the matrix, with the threshold nu

Definition at line 2320 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, and spams::Matrix< T >::scal().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::center ( )
inline

center the columns of the matrix

center the matrix

Definition at line 1299 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Vector< T >::add(), spams::Matrix< T >::refCol(), and spams::Vector< T >::sum().

Referenced by spams::FISTA::SqLossMat< T >::var_fenchel().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::center ( Vector< T > &  centers)
inline

center the columns of the matrix and keep the center values

center the matrix and keep the center values

Definition at line 1322 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Vector< T >::add(), spams::Matrix< T >::refCol(), spams::Vector< T >::resize(), and spams::Vector< T >::sum().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::center_rows ( )
inline

center the columns of the matrix

center the matrix

Definition at line 1309 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, spams::Vector< T >::scal(), and spams::Vector< T >::setZeros().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::clean ( )
inline

clean a dictionary matrix

Modifiers clean a dictionary matrix

remove the diagonal

Definition at line 1168 of file linalg.h.

References spams::Matrix< T >::_n, spams::Matrix< T >::_X, spams::Matrix< T >::normalize(), spams::Vector< T >::normalize(), spams::Matrix< T >::refCol(), spams::Vector< T >::setAleat(), and spams::Matrix< T >::XtX().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::clear ( )
inline

Clear the matrix.

Definition at line 1250 of file linalg.h.

References spams::Matrix< T >::_externAlloc, spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

Referenced by spams::coreSOMP(), spams::Matrix< T >::resize(), spams::Matrix< T >::setData(), and spams::Matrix< T >::~Matrix().

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::conjugateGradient ( const Vector< T > &  b,
Vector< T > &  x,
const T  tol = 1e-4,
const int  itermax = 4 
) const
inline

compute x, such that b = Ax,

compute x, such that b = Ax, WARNING this function needs to be u updated

Definition at line 2482 of file linalg.h.

References spams::Vector< T >::add(), spams::Vector< T >::copy(), spams::Vector< T >::dot(), spams::Matrix< T >::mult(), spams::Vector< T >::nrm2sq(), and spams::Vector< T >::scal().

Referenced by spams::Trainer< T >::train().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::copy ( const Matrix< T > &  mat)
inline
template<typename T >
void spams::Matrix< T >::copyCol ( const int  i,
Vector< T > &  x 
) const
inlinevirtual

Copy the column i into x.

Implements spams::AbstractMatrix< T >.

Definition at line 1100 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, spams::Vector< T >::_X, and spams::Vector< T >::resize().

Referenced by spams::coreSOMP(), spams::Matrix< T >::getData(), and spams::lassoWeightPreComputed().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::copyMask ( Matrix< T > &  out,
Vector< bool > &  mask 
) const
inline

extract the rows of a matrix corresponding to a binary mask

Definition at line 4052 of file linalg.h.

References spams::Vector< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::n(), spams::Matrix< T >::resize(), and spams::Matrix< T >::setm().

Referenced by spams::lasso_mask(), and spams::omp_mask().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::copyRef ( const Matrix< T > &  mat)
inline

make a copy of the matrix mat in the current matrix

Definition at line 1345 of file linalg.h.

References spams::Matrix< T >::m(), spams::Matrix< T >::n(), spams::Matrix< T >::rawX(), and spams::Matrix< T >::setData().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::copyRow ( const int  i,
Vector< T > &  x 
) const
inlinevirtual
template<typename T>
void spams::Matrix< T >::copyTo ( Matrix< T > &  mat) const
inlinevirtual

make a copy of the matrix mat in the current matrix

Implements spams::AbstractMatrixB< T >.

Definition at line 260 of file linalg.h.

References spams::Matrix< T >::copy(), and spams::Data< T >::m().

Referenced by spams::FISTA::LossCur< T >::eval(), and spams::FISTA::LossCur< T >::grad().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::diag ( Vector< T > &  d) const
inlinevirtual

extract the diagonal

Implements spams::AbstractMatrix< T >.

Definition at line 1985 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, MIN, spams::Vector< T >::rawX(), and spams::Vector< T >::resize().

Referenced by spams::coreSOMP().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::div_elementWise ( const Matrix< T > &  B,
Matrix< T > &  C 
) const
inline

C = A .* B, elementwise multiplication.

Definition at line 1950 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, and spams::Matrix< T >::resize().

+ Here is the call graph for this function:

template<typename T >
T spams::Matrix< T >::dot ( const Matrix< T > &  mat) const
inlinevirtual

add alpha*mat to the current matrix

Implements spams::AbstractMatrixB< T >.

Definition at line 2068 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

Referenced by spams::FISTA::SqLossMat< T >::fenchel(), and spams::FISTA::LagrangianADMM().

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::drop ( char *  fileName) const
inline

compute x, such that b = Ax, WARNING this function needs to be u updated, the temporary vectors are given.

Definition at line 2504 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

template<typename T >
T spams::Matrix< T >::eigLargestMagnSym ( const Vector< T > &  u0,
Vector< T > &  u 
) const
inline

find the eigenvector corresponding to the eivenvalue with the largest magnitude when the current matrix is symmetric, using the power method. It returns the eigenvalue. u0 is an initial guess for the eigenvector.

Definition at line 1672 of file linalg.h.

References spams::Vector< T >::copy(), spams::Matrix< T >::mult(), spams::Vector< T >::nrm2(), and spams::Vector< T >::scal().

Referenced by spams::FISTA::Rank< T >::eval().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
T spams::Matrix< T >::eigLargestMagnSym ( ) const
inline

returns the value of the eigenvalue with the largest magnitude using the power iteration.

Definition at line 1695 of file linalg.h.

References spams::Matrix< T >::_m, spams::Vector< T >::copy(), spams::Matrix< T >::mult(), spams::Vector< T >::nrm2(), spams::Vector< T >::scal(), and spams::Vector< T >::setAleat().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::eigLargestSymApprox ( const Vector< T > &  u0,
Vector< T > &  u 
) const
inline

find the eigenvector corresponding to the largest eigenvalue when the current matrix is symmetric. u0 is the initial guess. using two iterations of the power method

Definition at line 1629 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_X, spams::Vector< T >::copy(), spams::Vector< T >::dot(), spams::Matrix< T >::mult(), spams::Vector< T >::nrm2(), and spams::Vector< T >::scal().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::exp ( )
inline

each element of the matrix is replaced by its exponential

Definition at line 2010 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

Referenced by spams::Matrix< T >::NadarayaWatson().

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::extract_rawCol ( const int  i,
T *  x 
) const
inlinevirtual

Copy the column i into x.

Implements spams::AbstractMatrix< T >.

Definition at line 1115 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

template<typename T >
void spams::Matrix< T >::extractRow ( const int  i,
Vector< T > &  row 
) const
inline

fill the matrix with the row given

Definition at line 2251 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, and spams::Vector< T >::resize().

Referenced by spams::FISTA::MultiLogLoss< T >::var_fenchel().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::eye ( )
inline

set the matrix to the identity;

set the matrix to the identity

Definition at line 1264 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, MIN, and spams::Matrix< T >::setZeros().

+ Here is the call graph for this function:

template<typename T>
void spams::Matrix< T >::fakeSize ( const int  m,
const int  n 
)
inline

change artificially the size of the matrix, DANGEROUS

Definition at line 307 of file linalg.h.

References spams::Data< T >::m(), spams::Data< T >::n(), utl::Sqrt(), and spams::Data< T >::V().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::fillRow ( const Vector< T > &  row)
inline

fill the matrix with the row given

Definition at line 2241 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

Referenced by spams::ist_groupLasso().

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::fillSymmetric ( )
inline

make the matrix symmetric by copying the upper-right part into the lower-left part

Definition at line 1351 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

Referenced by spams::SpMatrix< T >::AAt(), spams::Matrix< T >::invSym(), spams::Matrix< T >::subMatrixSym(), spams::Matrix< T >::upperTriXXt(), spams::SpMatrix< T >::wAAt(), spams::Matrix< T >::XtX(), and spams::Matrix< T >::XXt().

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::fillSymmetric2 ( )
inline

Definition at line 1358 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

template<typename T >
int spams::Matrix< T >::fmax ( ) const
inline

return the 1D-index of the value of greatest magnitude

Definition at line 1188 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

Referenced by spams::Matrix< T >::merge().

+ Here is the caller graph for this function:

template<typename T >
T spams::Matrix< T >::fmaxval ( ) const
inline

return the 1D-index of the value of greatest magnitude

return the value of greatest magnitude

Definition at line 1193 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

template<typename T >
int spams::Matrix< T >::fmin ( ) const
inline

return the 1D-index of the value of lowest magnitude

Definition at line 1199 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

template<typename T >
void spams::Matrix< T >::getData ( Vector< T > &  data,
const int  i 
) const
inlinevirtual

Copy the column i into x.

Implements spams::Data< T >.

Definition at line 1127 of file linalg.h.

References spams::Matrix< T >::copyCol().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::getGroup ( Matrix< T > &  data,
const vector_groups groups,
const int  i 
) const
inlinevirtual

extract the group i

Implements spams::Data< T >.

Definition at line 1131 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_X, and spams::Matrix< T >::resize().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::hardThrshold ( const T  nu)
inline

perform soft-thresholding of the matrix, with the threshold nu

Definition at line 2290 of file linalg.h.

References spams::Vector< T >::hardThrshold(), and spams::Matrix< T >::toVect().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::incrDiag ( )
inline

add one to the diagonal

Definition at line 1502 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, and MIN.

template<typename T>
void spams::Matrix< T >::inv ( )
inline

inverse the elements of the matrix

Definition at line 434 of file linalg.h.

template<typename T >
void spams::Matrix< T >::inv_elem ( )
inline

inverse the elements of the matrix

perform soft-thresholding of the matrix, with the threshold nu

Definition at line 2313 of file linalg.h.

References spams::Vector< T >::inv(), and spams::Matrix< T >::toVect().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::Invsqrt ( )
inline

Definition at line 2017 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

template<typename T >
void spams::Matrix< T >::invSym ( )
inline

inverse the matrix when it is symmetric

ipiv= new INTT[lwork];

Definition at line 1716 of file linalg.h.

References spams::Matrix< T >::_n, spams::Matrix< T >::_X, spams::Matrix< T >::fillSymmetric(), and upper.

+ Here is the call graph for this function:

template<typename T >
bool spams::Matrix< T >::isNormalized ( ) const
inline

Check wether the columns of the matrix are normalized or not.

Analysis functions Check wether the columns of the matrix are normalized or not

Definition at line 1158 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

Referenced by spams::ist(), spams::ist_groupLasso(), and spams::somp().

+ Here is the caller graph for this function:

template<typename T>
int spams::Matrix< T >::m ( ) const
inlinevirtual
template<typename T >
T spams::Matrix< T >::mean ( ) const
inline

whiten

Definition at line 2103 of file linalg.h.

References spams::Vector< T >::mean(), and spams::Matrix< T >::toVect().

Referenced by spams::Matrix< T >::whiten().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::meanCol ( Vector< T > &  mean) const
inline

Compute the mean of the columns.

Definition at line 2226 of file linalg.h.

References spams::Matrix< T >::_n, spams::Matrix< T >::mult(), and spams::Vector< T >::set().

Referenced by spams::ist_groupLasso().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::meanRow ( Vector< T > &  mean) const
inline

Compute the mean of the rows.

Definition at line 2233 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::multTrans(), and spams::Vector< T >::set().

Referenced by spams::ist_groupLasso().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::merge ( const Matrix< T > &  B,
Matrix< T > &  C 
) const
inline
template<typename T >
void spams::Matrix< T >::mult ( const Vector< T > &  x,
Vector< T > &  b,
const T  alpha = 1.0,
const T  beta = 0.0 
) const
inlinevirtual
template<typename T >
void spams::Matrix< T >::mult ( const SpVector< T > &  x,
Vector< T > &  b,
const T  alpha = 1.0,
const T  beta = 0.0 
) const
inlinevirtual

perform b = alpha*A*x + beta*b, when x is sparse

Implements spams::AbstractMatrixB< T >.

Definition at line 1791 of file linalg.h.

References spams::SpVector< T >::_L, spams::Matrix< T >::_m, spams::SpVector< T >::_r, spams::SpVector< T >::_v, spams::Matrix< T >::_X, spams::Vector< T >::_X, spams::Vector< T >::scal(), and spams::Vector< T >::setZeros().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::mult ( const Matrix< T > &  B,
Matrix< T > &  C,
const bool  transA = false,
const bool  transB = false,
const T  a = 1.0,
const T  b = 0.0 
) const
inlinevirtual

perform C = a*A*B + b*C, possibly transposing A or B.

Implements spams::AbstractMatrixB< T >.

Definition at line 1810 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, CblasColMajor, CblasNoTrans, CblasTrans, spams::Matrix< T >::m(), spams::Matrix< T >::n(), and spams::Matrix< T >::resize().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::mult ( const SpMatrix< T > &  B,
Matrix< T > &  C,
const bool  transA = false,
const bool  transB = false,
const T  a = 1.0,
const T  b = 0.0 
) const
inlinevirtual
template<typename T >
void spams::Matrix< T >::mult_elementWise ( const Matrix< T > &  B,
Matrix< T > &  C 
) const
inline

C = A .* B, elementwise multiplication.

Definition at line 1942 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, and spams::Matrix< T >::resize().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::multDiagLeft ( const Vector< T > &  diag)
inline

mult by a diagonal matrix on the left

Definition at line 1917 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, spams::Vector< T >::n(), and spams::Vector< T >::rawX().

Referenced by spams::FISTA::MixedL1L2< T >::sub_grad(), and spams::Matrix< T >::svd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::multDiagRight ( const Vector< T > &  diag)
inline

mult by a diagonal matrix on the right

Definition at line 1929 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, spams::Vector< T >::n(), and spams::Vector< T >::rawX().

Referenced by spams::Matrix< T >::NadarayaWatson(), spams::FISTA::TraceNorm< T >::prox(), and spams::Matrix< T >::svd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::multSwitch ( const Matrix< T > &  B,
Matrix< T > &  C,
const bool  transA = false,
const bool  transB = false,
const T  a = 1.0,
const T  b = 0.0 
) const
inlinevirtual

perform C = a*B*A + b*C, possibly transposing A or B.

Implements spams::AbstractMatrixB< T >.

Definition at line 1840 of file linalg.h.

References spams::Matrix< T >::mult().

Referenced by spams::FISTA::MultiLogLoss< T >::eval(), and spams::FISTA::MultiLogLoss< T >::grad().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::multTrans ( const Vector< T > &  x,
Vector< T > &  b,
const T  alpha = 1.0,
const T  beta = 0.0 
) const
inlinevirtual
template<typename T >
void spams::Matrix< T >::multTrans ( const Vector< T > &  x,
Vector< T > &  b,
const Vector< bool > &  active 
) const
inline

perform b = alpha*A'x + beta*b

Definition at line 1769 of file linalg.h.

References spams::Matrix< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::dot(), spams::Vector< T >::rawX(), spams::Matrix< T >::refCol(), and spams::Vector< T >::setZeros().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::multTrans ( const SpVector< T > &  x,
Vector< T > &  b,
const T  alpha = 1.0,
const T  beta = 0.0 
) const
inline

perform b = A'x, when x is sparse

Definition at line 1751 of file linalg.h.

References spams::Matrix< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::dot(), spams::Matrix< T >::refCol(), and spams::Vector< T >::resize().

+ Here is the call graph for this function:

template<typename T>
int spams::Matrix< T >::n ( ) const
inlinevirtual

Number of columns.

Implements spams::Data< T >.

Definition at line 224 of file linalg.h.

Referenced by spams::computeError(), spams::SpMatrix< T >::convert(), spams::SpMatrix< T >::convert2(), spams::Matrix< T >::copyRef(), spams::coreGroupIST(), spams::coreGroupISTConstrained(), spams::coreLARS(), spams::coreLARS2(), spams::coreLARS2W(), spams::coreORMP(), spams::coreSOMP(), spams::downDateLasso(), spams::FISTA::MultiLogLoss< T >::eval(), spams::FISTA::LossCur< T >::eval(), spams::FISTA::Rank< T >::eval(), spams::FISTA::EvalGraphPath(), spams::FISTA::MultiLogLoss< T >::fenchel(), spams::FISTA::MultiLogLoss< T >::grad(), spams::FISTA::LossCur< T >::grad(), spams::FISTA::LossMatSup< T, SqLossMissing< T > >::grad(), spams::ist(), spams::ist_groupLasso(), spams::lasso(), spams::lasso2(), spams::lasso_mask(), spams::lassoReweighted(), spams::lassoWeight(), spams::lassoWeightPreComputed(), spams::MatrixToUtlMatrix(), spams::MatrixToVnlMatrix(), spams::Matrix< T >::merge(), spams::Matrix< T >::mult(), spams::SpMatrix< T >::mult(), spams::Matrix< T >::NadarayaWatson(), spams::omp(), spams::omp_mask(), spams::FISTA::MixedL1L2< T >::prox(), spams::FISTA::MixedL1LINF< T >::prox(), spams::FISTA::Rank< T >::prox(), spams::FISTA::SpecGraphMat< T >::prox(), spams::FISTA::PROX(), spams::Matrix< T >::resize(), spams::Matrix< T >::setData(), spams::ProdMatrix< T >::setMatrices(), spams::FISTA::solver(), spams::FISTA::solver_admm(), spams::FISTA::solver_aux1(), spams::FISTA::solver_aux2(), spams::somp(), spams::FISTA::MixedL1LINF< T >::sub_grad(), spams::FISTA::RegMat< T, Reg >::sub_grad(), spams::Trainer< T >::Trainer(), spams::Matrix< T >::unwhiten(), spams::FISTA::update_multipliers_ADMM(), spams::FISTA::update_multipliers_weighted_ADMM(), spams::FISTA::MultiLogLoss< T >::var_fenchel(), spams::FISTA::LossCur< T >::var_fenchel(), spams::FISTA::LossMatSup< T, SqLossMissing< T > >::var_fenchel(), spams::Matrix< T >::whiten(), and spams::writeLog().

template<typename T >
void spams::Matrix< T >::NadarayaWatson ( const Vector< int > &  ind,
const T  sigma 
)
inline
template<typename T >
void spams::Matrix< T >::neg ( )
inline

A <- -A.

Definition at line 1498 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

template<typename T >
T spams::Matrix< T >::norm_1_2_col ( ) const
inline

return ||At||_{1,2} (max of l2 norm of the columns)

return ||At||_{1,2}

Definition at line 2128 of file linalg.h.

References spams::Matrix< T >::_n, spams::Vector< T >::nrm2(), and spams::Matrix< T >::refCol().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::norm_2_cols ( Vector< T > &  norms) const
inline

returns the l2 norms of the columns

Definition at line 2162 of file linalg.h.

References spams::Matrix< T >::_n, spams::Vector< T >::nrm2(), spams::Matrix< T >::refCol(), and spams::Vector< T >::resize().

Referenced by spams::coreGroupIST(), and spams::coreGroupISTConstrained().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::norm_2_rows ( Vector< T > &  norms) const
inline

returns the l2 norms of the columns

Definition at line 2139 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, spams::Vector< T >::resize(), and spams::Vector< T >::setZeros().

Referenced by spams::FISTA::MixedL1L2< T >::eval(), spams::FISTA::MixedL1L2< T >::fenchel(), spams::FISTA::MixedL1L2< T >::prox(), and spams::FISTA::MixedL1L2< T >::sub_grad().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::norm_2sq_cols ( Vector< T > &  norms) const
inlinevirtual

returns the l2 norms ^2 of the columns

returns the l2 norms of the columns

Reimplemented from spams::Data< T >.

Definition at line 2204 of file linalg.h.

References spams::Matrix< T >::_n, spams::Vector< T >::nrm2sq(), spams::Matrix< T >::refCol(), and spams::Vector< T >::resize().

Referenced by spams::coreGroupIST(), spams::coreGroupISTConstrained(), spams::coreSOMP(), and spams::Matrix< T >::NadarayaWatson().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::norm_2sq_rows ( Vector< T > &  norms) const
inline

returns the l2 norms of the columns

Definition at line 2151 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, spams::Vector< T >::resize(), and spams::Vector< T >::setZeros().

+ Here is the call graph for this function:

template<typename T >
T spams::Matrix< T >::norm_inf_2_col ( ) const
inline

return ||At||_{inf,2} (max of l2 norm of the columns)

return ||At||_{inf,2}

Definition at line 2115 of file linalg.h.

References spams::Matrix< T >::_n, utl::max(), spams::Vector< T >::nrm2(), and spams::Matrix< T >::refCol().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::norm_inf_cols ( Vector< T > &  norms) const
inline

returns the linf norms of the columns

Definition at line 2174 of file linalg.h.

References spams::Matrix< T >::_n, spams::Vector< T >::fmaxval(), spams::Matrix< T >::refCol(), and spams::Vector< T >::resize().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::norm_inf_rows ( Vector< T > &  norms) const
inline

returns the linf norms of the columns

Definition at line 2184 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, MAX, spams::Vector< T >::resize(), and spams::Vector< T >::setZeros().

Referenced by spams::FISTA::MixedL1LINF< T >::eval().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::norm_l1_rows ( Vector< T > &  norms) const
inline

returns the linf norms of the columns

Definition at line 2193 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, spams::Vector< T >::resize(), and spams::Vector< T >::setZeros().

Referenced by spams::FISTA::MixedL1LINF< T >::fenchel(), and spams::Trainer< T >::trainOffline().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::normalize ( )
inline

Normalize all columns to unit l2 norm.

Definition at line 1270 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, spams::Vector< T >::normalize(), spams::Matrix< T >::refCol(), and spams::Vector< T >::setAleat().

Referenced by spams::Matrix< T >::clean().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::normalize2 ( )
inline

Normalize all columns which l2 norm is greater than one.

Definition at line 1288 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

template<typename T >
T spams::Matrix< T >::normF ( ) const
inline

return ||A||_F

Definition at line 2099 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

template<typename T >
T spams::Matrix< T >::normFsq ( ) const
inline
template<typename T>
T spams::Matrix< T >::nrm2sq ( ) const
inline

return ||A||_F^2

Definition at line 446 of file linalg.h.

References spams::Data< T >::norm_2sq_cols().

+ Here is the call graph for this function:

template<typename T >
T & spams::Matrix< T >::operator() ( const int  i,
const int  j 
)
inline

Return a modifiable reference to X(i,j)

Definition at line 1075 of file linalg.h.

References spams::Matrix< T >::_m, and spams::Matrix< T >::_X.

template<typename T >
T spams::Matrix< T >::operator() ( const int  i,
const int  j 
) const
inlinevirtual

Return the value X(i,j)

Implements spams::AbstractMatrix< T >.

Definition at line 1080 of file linalg.h.

References spams::Matrix< T >::_m, and spams::Matrix< T >::_X.

template<typename T>
Matrix<T>& spams::Matrix< T >::operator= ( const Matrix< T > &  matrix)
protected

Forbid lazy copies.

template<typename T>
T& spams::Matrix< T >::operator[] ( const int  index)
inline

Return a modifiable reference to X(i) (1D indexing)

Definition at line 230 of file linalg.h.

template<typename T>
T spams::Matrix< T >::operator[] ( const int  index) const
inlinevirtual

Return the value X(i) (1D indexing)

Implements spams::Data< T >.

Definition at line 232 of file linalg.h.

References spams::Data< T >::getData(), spams::Data< T >::getGroup(), and spams::Data< T >::n().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::print ( const string &  name) const
inlinevirtual

Print the matrix to std::cout.

Debugging function Print the matrix to std::cout

Implements spams::AbstractMatrixB< T >.

Definition at line 1085 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

Referenced by mexFunction().

+ Here is the caller graph for this function:

template<typename T >
T spams::Matrix< T >::quad ( const Vector< T > &  vec1,
const SpVector< T > &  vec2 
) const
inline

return vec1'*A*vec2, where vec2 is sparse

return vec'*A*vec when vec is sparse

Definition at line 2047 of file linalg.h.

References spams::SpVector< T >::_L, spams::SpVector< T >::_r, spams::SpVector< T >::_v, spams::Vector< T >::dot(), and spams::Matrix< T >::refCol().

Referenced by spams::computeError(), and spams::Matrix< T >::quad_mult().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
T spams::Matrix< T >::quad ( const SpVector< T > &  vec) const
inline

return vec'*A*vec when vec is sparse

return vec1'*A*vec2, where vec2 is sparse

Definition at line 2021 of file linalg.h.

References spams::SpVector< T >::_L, spams::Matrix< T >::_m, spams::SpVector< T >::_r, spams::SpVector< T >::_v, and spams::Matrix< T >::_X.

template<typename T >
void spams::Matrix< T >::quad_mult ( const Vector< T > &  vec1,
const SpVector< T > &  vec2,
Vector< T > &  y,
const T  a = 1.0,
const T  b = 0.0 
) const
inline

return vec1'*A*vec2, where vec2 is sparse

Definition at line 2033 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, spams::Vector< T >::n(), spams::Matrix< T >::quad(), and spams::Matrix< T >::setData().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::rank1Update ( const Vector< T > &  vec1,
const Vector< T > &  vec2,
const T  alpha = 1.0 
)
inline
template<typename T >
void spams::Matrix< T >::rank1Update ( const SpVector< T > &  vec1,
const Vector< T > &  vec2,
const T  alpha = 1.0 
)
inline
template<typename T >
void spams::Matrix< T >::rank1Update ( const Vector< T > &  vec1,
const SpVector< T > &  vec2,
const T  alpha = 1.0 
)
inline

perform A <- A + alpha*vec1*vec2', when vec2 is sparse

Definition at line 2449 of file linalg.h.

References spams::SpVector< T >::_L, spams::SpVector< T >::_r, spams::SpVector< T >::_v, spams::Vector< T >::add(), and spams::Matrix< T >::refCol().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::rank1Update ( const SpVector< T > &  vec,
const T  alpha = 1.0 
)
inline

perform A <- A + alpha*vec*vec', when vec2 is sparse

perform A <- A + alpha*vec1*vec1', when vec1 is sparse

Definition at line 2461 of file linalg.h.

References spams::SpVector< T >::_L, spams::Matrix< T >::_m, spams::SpVector< T >::_r, spams::SpVector< T >::_v, and spams::Matrix< T >::_X.

template<typename T >
void spams::Matrix< T >::rank1Update ( const SpVector< T > &  vec,
const SpVector< T > &  vec2,
const T  alpha = 1.0 
)
inline

perform A <- A + alpha*vec*vec', when vec2 is sparse

perform A <- A + alpha*vec1*vec2', when vec1 is sparse

Definition at line 2426 of file linalg.h.

References spams::SpVector< T >::_L, spams::Matrix< T >::_m, spams::SpVector< T >::_r, spams::SpVector< T >::_v, and spams::Matrix< T >::_X.

template<typename T >
void spams::Matrix< T >::rank1Update_mult ( const Vector< T > &  vec1,
const Vector< T > &  vec1b,
const SpVector< T > &  vec2,
const T  alpha = 1.0 
)
inline
template<typename T>
T* spams::Matrix< T >::rawX ( ) const
inline
template<typename T >
void spams::Matrix< T >::refCol ( int  i,
Vector< T > &  x 
) const
inline

Reference the column i into the vector x.

Definition at line 1144 of file linalg.h.

References spams::Vector< T >::_externAlloc, spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Vector< T >::_n, spams::Matrix< T >::_X, spams::Vector< T >::_X, and spams::Vector< T >::clear().

Referenced by spams::Matrix< T >::addToCols(), spams::Matrix< T >::addVecToCols(), spams::Matrix< T >::center(), spams::Matrix< T >::clean(), spams::Trainer< T >::cleanDict(), spams::computeError(), spams::coreORMP(), spams::coreSOMP(), spams::FISTA::dualityGraph(), spams::FISTA::MultiLogLoss< T >::eval(), spams::FISTA::LossMatSup< T, SqLossMissing< T > >::eval(), spams::FISTA::RegMat< T, Reg >::eval(), spams::FISTA::SqLoss< T >::eval_split(), spams::FISTA::HingeLoss< T >::eval_split(), spams::FISTA::EvalGraphPath(), spams::FISTA::MultiLogLoss< T >::fenchel(), spams::FISTA::LossMatSup< T, SqLossMissing< T > >::fenchel(), spams::FISTA::RegMat< T, Reg >::fenchel(), spams::SpMatrix< T >::getGroup(), spams::FISTA::MultiLogLoss< T >::grad(), spams::FISTA::LossMatSup< T, SqLossMissing< T > >::grad(), spams::FISTA::LossMatSup< T, SqLossMissing< T > >::init(), spams::ist(), spams::ist_groupLasso(), spams::lasso(), spams::lasso2(), spams::lasso_mask(), spams::lassoReweighted(), spams::lassoWeight(), spams::lassoWeightPreComputed(), spams::Matrix< T >::merge(), spams::Matrix< T >::mult(), spams::SpMatrix< T >::mult(), spams::Matrix< T >::multTrans(), spams::Matrix< T >::NadarayaWatson(), spams::Matrix< T >::norm_1_2_col(), spams::Matrix< T >::norm_2_cols(), spams::Matrix< T >::norm_2sq_cols(), spams::Matrix< T >::norm_inf_2_col(), spams::Matrix< T >::norm_inf_cols(), spams::Matrix< T >::normalize(), spams::omp(), spams::omp_mask(), spams::FISTA::RegMat< T, Reg >::prox(), spams::FISTA::PROX(), spams::FISTA::SqLoss< T >::prox_split(), spams::FISTA::HingeLoss< T >::prox_split(), spams::Matrix< T >::quad(), spams::Matrix< T >::rank1Update(), spams::FISTA::solver(), spams::FISTA::solver_admm(), spams::FISTA::solver_aux1(), spams::FISTA::solver_aux2(), spams::Matrix< T >::sparseProject(), spams::FISTA::RegMat< T, Reg >::sub_grad(), spams::Matrix< T >::sum_cols(), spams::Trainer< T >::trainOffline(), spams::FISTA::MultiLogLoss< T >::var_fenchel(), spams::FISTA::LossMatSup< T, SqLossMissing< T > >::var_fenchel(), and spams::SpMatrix< T >::XtX().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::refSubMat ( int  i,
int  n,
Matrix< T > &  mat 
) const
inline

Reference the column i to i+n into the Matrix mat.

Definition at line 1153 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_X, and spams::Matrix< T >::setData().

Referenced by spams::FISTA::solver_aux2().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::resize ( int  m,
int  n 
)
inline

Resize the matrix.

Definition at line 1217 of file linalg.h.

References spams::Matrix< T >::_externAlloc, spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, spams::Matrix< T >::clear(), spams::Matrix< T >::m(), spams::Matrix< T >::n(), and spams::Matrix< T >::setZeros().

Referenced by spams::SpMatrix< T >::AAt(), spams::Matrix< T >::copy(), spams::Matrix< T >::copyMask(), spams::coreSOMP(), spams::Matrix< T >::div_elementWise(), spams::Matrix< T >::getGroup(), spams::SpMatrix< T >::getGroup(), spams::FISTA::MultiLogLoss< T >::grad(), spams::FISTA::LossCur< T >::grad(), spams::FISTA::LossMatSup< T, SqLossMissing< T > >::grad(), spams::FISTA::SqLoss< T >::init_split_variables(), spams::FISTA::HingeLoss< T >::init_split_variables(), spams::ist(), spams::lasso(), spams::lasso2(), spams::lasso_mask(), spams::lassoReweighted(), spams::lassoWeight(), spams::lassoWeightPreComputed(), spams::Matrix< T >::merge(), spams::Matrix< T >::mult(), spams::SpMatrix< T >::mult(), spams::Matrix< T >::mult_elementWise(), spams::omp(), spams::omp_mask(), spams::FISTA::Rank< T >::prox(), spams::FISTA::SpecGraphMat< T >::prox(), spams::FISTA::solver(), spams::FISTA::solver_admm(), spams::FISTA::solver_aux1(), spams::FISTA::solver_aux2(), spams::FISTA::MixedL1LINF< T >::sub_grad(), spams::FISTA::RegMat< T, Reg >::sub_grad(), spams::Matrix< T >::subMatrixSym(), spams::Matrix< T >::svd(), spams::SpMatrix< T >::toFull(), spams::SpMatrix< T >::toFullTrans(), spams::Trainer< T >::train(), spams::Trainer< T >::trainOffline(), spams::Matrix< T >::transpose(), spams::Matrix< T >::upperTriXXt(), spams::UtlMatrixToMatrix(), spams::FISTA::MultiLogLoss< T >::var_fenchel(), spams::FISTA::LossCur< T >::var_fenchel(), spams::FISTA::LossMatSup< T, SqLossMissing< T > >::var_fenchel(), spams::VnlMatrixToMatrix(), spams::SpMatrix< T >::wAAt(), spams::SpMatrix< T >::wXAt(), spams::SpMatrix< T >::XAt(), spams::Matrix< T >::XtX(), spams::SpMatrix< T >::XtX(), and spams::Matrix< T >::XXt().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::scal ( const T  a)
inline
template<typename T >
void spams::Matrix< T >::set ( const T  a)
inline

Set all the values to a scalar.

Definition at line 1245 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

template<typename T >
void spams::Matrix< T >::setAleat ( )
inline

Put white Gaussian noise in the matrix.

Definition at line 1259 of file linalg.h.

template<typename T >
void spams::Matrix< T >::setData ( T *  X,
int  m,
int  n 
)
inline
template<typename T >
void spams::Matrix< T >::setDiag ( const Vector< T > &  d)
inline

set the diagonal

Definition at line 1994 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, MIN, and spams::Vector< T >::rawX().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::setDiag ( const T  val)
inline

set the diagonal

Definition at line 2002 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, and MIN.

template<typename T>
void spams::Matrix< T >::setm ( const int  m)
inline

modify _m

Definition at line 277 of file linalg.h.

References spams::Data< T >::m().

Referenced by spams::Matrix< T >::copyMask(), spams::lasso_mask(), and spams::omp_mask().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T>
void spams::Matrix< T >::setn ( const int  n)
inline

modify _n

Definition at line 279 of file linalg.h.

References spams::Data< T >::n().

Referenced by spams::lasso_mask(), and spams::omp_mask().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::setRow ( const int  i,
const Vector< T > &  row 
)
inline
template<typename T >
void spams::Matrix< T >::setZeros ( )
inline
template<typename T >
void spams::Matrix< T >::singularValues ( Vector< T > &  u) const
inline
template<typename T >
void spams::Matrix< T >::softThrshold ( const T  nu)
inline

perform soft-thresholding of the matrix, with the threshold nu

Definition at line 2283 of file linalg.h.

References spams::Vector< T >::softThrshold(), and spams::Matrix< T >::toVect().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::sparseProject ( Matrix< T > &  out,
const T  thrs,
const int  mode = 1,
const T  lambda1 = 0,
const T  lambda2 = 0,
const T  lambda3 = 0,
const bool  pos = false,
const int  numThreads = -1 
)
inline

performs sparse projections of the columns

Definition at line 2344 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Vector< T >::copy(), spams::init_omp(), spams::Matrix< T >::refCol(), spams::Vector< T >::resize(), and spams::Vector< T >::sparseProject().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::Sqrt ( void  )
inline

each element of the matrix is replaced by its square root

Definition at line 2013 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

template<typename T >
void spams::Matrix< T >::sub ( const Matrix< T > &  mat)
inline

substract the matrix mat to the current matrix

Definition at line 2080 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, and spams::Matrix< T >::_X.

Referenced by spams::FISTA::SqLossMat< T >::test_backtracking().

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::subMatrixSym ( const Vector< int > &  indices,
Matrix< T > &  subMatrix 
) const
inline

extract a sub-matrix of a symmetric matrix

Definition at line 1204 of file linalg.h.

References spams::Matrix< T >::_n, spams::Matrix< T >::_X, spams::Matrix< T >::fillSymmetric(), spams::Vector< T >::n(), spams::Vector< T >::rawX(), and spams::Matrix< T >::resize().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::sum_cols ( Vector< T > &  sum) const
inline

whiten

Definition at line 2215 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Vector< T >::add(), spams::Matrix< T >::refCol(), spams::Vector< T >::resize(), and spams::Vector< T >::setZeros().

Referenced by spams::FISTA::update_multipliers_ADMM(), and spams::FISTA::update_multipliers_weighted_ADMM().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::svd ( Matrix< T > &  U,
Vector< T > &  S,
Matrix< T > &  V 
) const
inline
template<typename T >
void spams::Matrix< T >::svdRankOne ( const Vector< T > &  u0,
Vector< T > &  u,
Vector< T > &  v 
) const
inline

perform a rank one approximation uv' using the power method u0 is an initial guess for u (can be empty).

Definition at line 1537 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Vector< T >::copy(), spams::Vector< T >::dot(), EPSILON, MAX, spams::Matrix< T >::mult(), spams::Matrix< T >::multTrans(), spams::Vector< T >::normalize(), spams::Vector< T >::nrm2(), spams::Vector< T >::resize(), spams::Vector< T >::scal(), and spams::Vector< T >::setAleat().

Referenced by spams::FISTA::Rank< T >::prox().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T>
void spams::Matrix< T >::thrsabsmin ( const T  nu)
inline
template<typename T >
void spams::Matrix< T >::thrsmax ( const T  nu)
inline

perform thresholding of the matrix, with the threshold nu

Definition at line 2298 of file linalg.h.

References spams::Vector< T >::thrsmax(), and spams::Matrix< T >::toVect().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::thrsmin ( const T  nu)
inline

perform thresholding of the matrix, with the threshold nu

Definition at line 2305 of file linalg.h.

References spams::Vector< T >::thrsmin(), and spams::Matrix< T >::toVect().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::thrsPos ( )
inline

perform soft-thresholding of the matrix, with the threshold nu

Definition at line 2376 of file linalg.h.

References spams::Vector< T >::thrsPos(), and spams::Matrix< T >::toVect().

Referenced by spams::FISTA::MixedL1L2< T >::fenchel(), spams::FISTA::MixedL1LINF< T >::fenchel(), spams::FISTA::MixedL1L2< T >::prox(), and spams::FISTA::MixedL1LINF< T >::prox().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::toSparse ( SpMatrix< T > &  matrix) const
inline
template<typename T >
void spams::Matrix< T >::toSparseTrans ( SpMatrix< T > &  matrixTrans)
inline
template<typename T >
void spams::Matrix< T >::toVect ( Vector< T > &  vec) const
inline
template<typename T >
T spams::Matrix< T >::trace ( ) const
inline

return the trace of the matrix

returns the trace of the matrix

Definition at line 2090 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, spams::Matrix< T >::m(), and MIN.

Referenced by spams::coreSOMP().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T>
void spams::Matrix< T >::transformFilter ( )
inline
template<typename T >
void spams::Matrix< T >::transpose ( Matrix< T > &  trans)
inline

Transpose the current matrix and put the result in the matrix trans

Definition at line 1489 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, and spams::Matrix< T >::resize().

Referenced by spams::ist_groupLasso(), and spams::Matrix< T >::svd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::unwhiten ( Vector< T > &  mean,
const bool  pattern = false 
)
inline

whiten

Definition at line 1460 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, spams::Matrix< T >::n(), spams::Vector< T >::n(), and spams::Matrix< T >::V().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::upperTriXXt ( Matrix< T > &  XXt,
const int  L 
) const
inline

XXt = A*A' where A is an upper triangular matrix.

Definition at line 1975 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_X, CblasColMajor, CblasUpper, spams::Matrix< T >::fillSymmetric(), and spams::Matrix< T >::resize().

Referenced by spams::coreSOMP().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T>
int spams::Matrix< T >::V ( ) const
inlinevirtual

Accessor.

Implements spams::Data< T >.

Definition at line 525 of file linalg.h.

Referenced by spams::Matrix< T >::unwhiten(), and spams::Matrix< T >::whiten().

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::whiten ( const int  V)
inline

whiten

Definition at line 1367 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, spams::Matrix< T >::mean(), and spams::Matrix< T >::V().

+ Here is the call graph for this function:

template<typename T >
void spams::Matrix< T >::whiten ( Vector< T > &  mean,
const bool  pattern = false 
)
inline
template<typename T >
void spams::Matrix< T >::whiten ( Vector< T > &  mean,
const Vector< T > &  mask 
)
inline
template<typename T>
const T* spams::Matrix< T >::X ( ) const
inline

return a non-modifiable reference to the data

Definition at line 256 of file linalg.h.

Referenced by spams::SpMatrix< T >::convert(), spams::SpMatrix< T >::convert2(), spams::MatrixToUtlMatrix(), spams::MatrixToVnlMatrix(), and spams::Matrix< T >::setData().

+ Here is the caller graph for this function:

template<typename T >
void spams::Matrix< T >::XtX ( Matrix< T > &  XtX) const
inlinevirtual
template<typename T >
void spams::Matrix< T >::XXt ( Matrix< T > &  XXt) const
inline

XXt = A*A'.

XXt = A*At.

Definition at line 1967 of file linalg.h.

References spams::Matrix< T >::_m, spams::Matrix< T >::_n, spams::Matrix< T >::_X, CblasColMajor, CblasNoTrans, CblasUpper, spams::Matrix< T >::fillSymmetric(), and spams::Matrix< T >::resize().

Referenced by spams::coreSOMP(), spams::FISTA::Rank< T >::eval(), spams::Matrix< T >::singularValues(), and spams::Matrix< T >::svd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Friends And Related Function Documentation

template<typename T>
friend class SpMatrix< T >
friend

Definition at line 207 of file linalg.h.

Member Data Documentation

template<typename T>
bool spams::Matrix< T >::_externAlloc
protected

is the data allocation external or not

Definition at line 538 of file linalg.h.

Referenced by spams::Matrix< T >::clear(), spams::Matrix< T >::resize(), and spams::Matrix< T >::setData().

template<typename T>
int spams::Matrix< T >::_m
protected

number of rows

Definition at line 542 of file linalg.h.

Referenced by spams::Matrix< T >::add(), spams::Matrix< T >::add_rawCol(), spams::Matrix< T >::addDiag(), spams::Matrix< T >::addRow(), spams::Matrix< T >::asum(), spams::Matrix< T >::blockThrshold(), spams::Matrix< T >::center(), spams::Matrix< T >::center_rows(), spams::Matrix< T >::clear(), spams::Matrix< T >::copy(), spams::Matrix< T >::copyCol(), spams::Matrix< T >::copyRow(), spams::Matrix< T >::diag(), spams::Matrix< T >::div_elementWise(), spams::Matrix< T >::dot(), spams::Matrix< T >::drop(), spams::Matrix< T >::eigLargestMagnSym(), spams::Matrix< T >::eigLargestSymApprox(), spams::Matrix< T >::exp(), spams::Matrix< T >::extract_rawCol(), spams::Matrix< T >::extractRow(), spams::Matrix< T >::eye(), spams::Matrix< T >::fillRow(), spams::Matrix< T >::fillSymmetric(), spams::Matrix< T >::fillSymmetric2(), spams::Matrix< T >::fmax(), spams::Matrix< T >::fmaxval(), spams::Matrix< T >::fmin(), spams::Matrix< T >::getGroup(), spams::Matrix< T >::incrDiag(), spams::Matrix< T >::Invsqrt(), spams::Matrix< T >::isNormalized(), spams::Matrix< T >::Matrix(), spams::Matrix< T >::meanRow(), spams::Matrix< T >::merge(), spams::Matrix< T >::mult(), spams::Matrix< T >::mult_elementWise(), spams::Matrix< T >::multDiagLeft(), spams::Matrix< T >::multDiagRight(), spams::Matrix< T >::multTrans(), spams::Matrix< T >::NadarayaWatson(), spams::Matrix< T >::neg(), spams::Matrix< T >::norm_2_rows(), spams::Matrix< T >::norm_2sq_rows(), spams::Matrix< T >::norm_inf_rows(), spams::Matrix< T >::norm_l1_rows(), spams::Matrix< T >::normalize(), spams::Matrix< T >::normalize2(), spams::Matrix< T >::normF(), spams::Matrix< T >::normFsq(), spams::Matrix< T >::operator()(), spams::Matrix< T >::print(), spams::Matrix< T >::quad(), spams::Matrix< T >::quad_mult(), spams::Matrix< T >::rank1Update(), spams::Matrix< T >::rank1Update_mult(), spams::Matrix< T >::refCol(), spams::Matrix< T >::refSubMat(), spams::Matrix< T >::resize(), spams::Matrix< T >::scal(), spams::Matrix< T >::set(), spams::Matrix< T >::setData(), spams::Matrix< T >::setDiag(), spams::Matrix< T >::setRow(), spams::Matrix< T >::setZeros(), spams::Matrix< T >::singularValues(), spams::Matrix< T >::sparseProject(), spams::Matrix< T >::Sqrt(), spams::Matrix< T >::sub(), spams::Matrix< T >::sum_cols(), spams::Matrix< T >::svd(), spams::Matrix< T >::svdRankOne(), spams::Matrix< T >::toSparse(), spams::Matrix< T >::toSparseTrans(), spams::Matrix< T >::toVect(), spams::Matrix< T >::trace(), spams::Matrix< T >::transpose(), spams::Matrix< T >::unwhiten(), spams::Matrix< T >::upperTriXXt(), spams::Matrix< T >::whiten(), spams::SpMatrix< T >::wXAt(), spams::SpMatrix< T >::XAt(), spams::Matrix< T >::XtX(), and spams::Matrix< T >::XXt().

template<typename T>
int spams::Matrix< T >::_n
protected

number of columns

Definition at line 544 of file linalg.h.

Referenced by spams::Matrix< T >::add(), spams::Matrix< T >::add_rawCol(), spams::Matrix< T >::addDiag(), spams::Matrix< T >::addRow(), spams::Matrix< T >::addToCols(), spams::Matrix< T >::addVecToCols(), spams::Matrix< T >::asum(), spams::Matrix< T >::blockThrshold(), spams::Matrix< T >::center(), spams::Matrix< T >::center_rows(), spams::Matrix< T >::clean(), spams::Matrix< T >::clear(), spams::Matrix< T >::copy(), spams::Matrix< T >::copyCol(), spams::Matrix< T >::copyRow(), spams::Matrix< T >::diag(), spams::Matrix< T >::div_elementWise(), spams::Matrix< T >::dot(), spams::Matrix< T >::drop(), spams::Matrix< T >::exp(), spams::Matrix< T >::extract_rawCol(), spams::Matrix< T >::extractRow(), spams::Matrix< T >::eye(), spams::Matrix< T >::fillRow(), spams::Matrix< T >::fillSymmetric(), spams::Matrix< T >::fillSymmetric2(), spams::Matrix< T >::fmax(), spams::Matrix< T >::fmaxval(), spams::Matrix< T >::fmin(), spams::Matrix< T >::incrDiag(), spams::Matrix< T >::Invsqrt(), spams::Matrix< T >::invSym(), spams::Matrix< T >::isNormalized(), spams::Matrix< T >::Matrix(), spams::Matrix< T >::meanCol(), spams::Matrix< T >::merge(), spams::Matrix< T >::mult(), spams::Matrix< T >::mult_elementWise(), spams::Matrix< T >::multDiagLeft(), spams::Matrix< T >::multDiagRight(), spams::Matrix< T >::multTrans(), spams::Matrix< T >::NadarayaWatson(), spams::Matrix< T >::neg(), spams::Matrix< T >::norm_1_2_col(), spams::Matrix< T >::norm_2_cols(), spams::Matrix< T >::norm_2_rows(), spams::Matrix< T >::norm_2sq_cols(), spams::Matrix< T >::norm_2sq_rows(), spams::Matrix< T >::norm_inf_2_col(), spams::Matrix< T >::norm_inf_cols(), spams::Matrix< T >::norm_inf_rows(), spams::Matrix< T >::norm_l1_rows(), spams::Matrix< T >::normalize(), spams::Matrix< T >::normalize2(), spams::Matrix< T >::normF(), spams::Matrix< T >::normFsq(), spams::Matrix< T >::print(), spams::Matrix< T >::quad_mult(), spams::Matrix< T >::rank1Update(), spams::Matrix< T >::rank1Update_mult(), spams::Matrix< T >::refCol(), spams::Matrix< T >::resize(), spams::Matrix< T >::scal(), spams::Matrix< T >::set(), spams::Matrix< T >::setData(), spams::Matrix< T >::setDiag(), spams::Matrix< T >::setRow(), spams::Matrix< T >::setZeros(), spams::Matrix< T >::singularValues(), spams::Matrix< T >::sparseProject(), spams::Matrix< T >::Sqrt(), spams::Matrix< T >::sub(), spams::Matrix< T >::subMatrixSym(), spams::Matrix< T >::sum_cols(), spams::Matrix< T >::svd(), spams::Matrix< T >::svdRankOne(), spams::Matrix< T >::toSparse(), spams::Matrix< T >::toSparseTrans(), spams::Matrix< T >::toVect(), spams::Matrix< T >::trace(), spams::Matrix< T >::transpose(), spams::Matrix< T >::unwhiten(), spams::Matrix< T >::whiten(), spams::SpMatrix< T >::wXAt(), spams::Matrix< T >::XtX(), and spams::Matrix< T >::XXt().

template<typename T>
T* spams::Matrix< T >::_X
protected

pointer to the data

Definition at line 540 of file linalg.h.

Referenced by spams::SpMatrix< T >::AAt(), spams::Matrix< T >::add(), spams::Matrix< T >::add_rawCol(), spams::Matrix< T >::addDiag(), spams::Matrix< T >::addRow(), spams::Matrix< T >::asum(), spams::Matrix< T >::blockThrshold(), spams::Matrix< T >::center_rows(), spams::Matrix< T >::clean(), spams::Matrix< T >::clear(), spams::Matrix< T >::copy(), spams::Matrix< T >::copyCol(), spams::Matrix< T >::copyRow(), spams::Matrix< T >::diag(), spams::Matrix< T >::div_elementWise(), spams::Matrix< T >::dot(), spams::Matrix< T >::drop(), spams::Matrix< T >::eigLargestSymApprox(), spams::Matrix< T >::exp(), spams::Matrix< T >::extract_rawCol(), spams::Matrix< T >::extractRow(), spams::Matrix< T >::eye(), spams::Matrix< T >::fillRow(), spams::Matrix< T >::fillSymmetric(), spams::Matrix< T >::fillSymmetric2(), spams::Matrix< T >::fmax(), spams::Matrix< T >::fmaxval(), spams::Matrix< T >::fmin(), spams::Matrix< T >::getGroup(), spams::Matrix< T >::incrDiag(), spams::Matrix< T >::Invsqrt(), spams::Matrix< T >::invSym(), spams::Matrix< T >::isNormalized(), spams::Matrix< T >::Matrix(), spams::Matrix< T >::mult(), spams::Matrix< T >::mult_elementWise(), spams::Matrix< T >::multDiagLeft(), spams::Matrix< T >::multDiagRight(), spams::Matrix< T >::multTrans(), spams::Matrix< T >::neg(), spams::Matrix< T >::norm_2_rows(), spams::Matrix< T >::norm_2sq_rows(), spams::Matrix< T >::norm_inf_rows(), spams::Matrix< T >::norm_l1_rows(), spams::Matrix< T >::normalize(), spams::Matrix< T >::normalize2(), spams::Matrix< T >::normF(), spams::Matrix< T >::normFsq(), spams::Matrix< T >::operator()(), spams::Matrix< T >::print(), spams::Matrix< T >::quad(), spams::Matrix< T >::quad_mult(), spams::Matrix< T >::rank1Update(), spams::Matrix< T >::rank1Update_mult(), spams::Matrix< T >::refCol(), spams::Matrix< T >::refSubMat(), spams::Matrix< T >::resize(), spams::Matrix< T >::scal(), spams::Matrix< T >::set(), spams::Matrix< T >::setData(), spams::Matrix< T >::setDiag(), spams::Matrix< T >::setRow(), spams::Matrix< T >::setZeros(), spams::Matrix< T >::singularValues(), spams::Matrix< T >::Sqrt(), spams::Matrix< T >::sub(), spams::Matrix< T >::subMatrixSym(), spams::Matrix< T >::svd(), spams::SpMatrix< T >::toFull(), spams::SpMatrix< T >::toFullTrans(), spams::Matrix< T >::toSparse(), spams::Matrix< T >::toSparseTrans(), spams::Matrix< T >::toVect(), spams::Matrix< T >::trace(), spams::Matrix< T >::transpose(), spams::Matrix< T >::unwhiten(), spams::Matrix< T >::upperTriXXt(), spams::SpMatrix< T >::wAAt(), spams::Matrix< T >::whiten(), spams::SpMatrix< T >::wXAt(), spams::SpMatrix< T >::XAt(), spams::Matrix< T >::XtX(), and spams::Matrix< T >::XXt().


The documentation for this class was generated from the following file: