DMRITool
v0.1.1-139-g860d86b4
Diffusion MRI Tool
|
#include <linalg.h>
Sparse Matrix class.
Sparse Matrix class, CSC format.
Public Member Functions | |
void | AAt (Matrix< T > &aat) const |
void | AAt (Matrix< T > &aat, const Vector< int > &indices) const |
void | add_direct (const SpMatrix< T > &mat, const T a) |
void | addVecToCols (const Vector< T > &diag, const T a=1.0) |
void | addVecToColsWeighted (const Vector< T > &diag, const T *weights, const T a=1.0) |
T | asum () const |
void | clear () |
void | convert (const Matrix< T > &v, const Matrix< int > &r, const int K) |
void | convert2 (const Matrix< T > &v, const Vector< int > &r, const int K) |
void | copy (const SpMatrix< T > &mat) |
void | copy_direct (const SpMatrix< T > &mat) |
void | copyRow (const int i, Vector< T > &x) const |
void | copyTo (Matrix< T > &mat) const |
T | dot (const Matrix< T > &x) const |
T | dot_direct (const SpMatrix< T > &mat) const |
void | getData (Vector< T > &data, const int index) const |
void | getGroup (Matrix< T > &data, const vector_groups &groups, const int i) const |
int | m () const |
void | mult (const SpVector< T > &x, Vector< T > &b, const T alpha=1.0, const T beta=0.0) const |
void | mult (const Vector< 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 | 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 > &y, const T alpha=1.0, const T beta=0.0) const |
void | multTrans (const SpVector< T > &x, Vector< T > &y, const T alpha=1.0, const T beta=0.0) const |
int | n () const |
int | nnz () const |
void | norm_0_cols (Vector< T > &norms) const |
void | norm_1_cols (Vector< T > &norms) const |
void | norm_2sq_cols (Vector< T > &norms) const |
T | normFsq () const |
int | nzmax () const |
T | operator[] (const int index) const |
int | pB (const int i) const |
int * | pB () const |
int * | pE () const |
void | print (const string &name) const |
int | r (const int i) const |
int * | r () const |
void | refCol (int i, SpVector< T > &vec) const |
void | resize (const int m, const int n, const int nzmax) |
void | scal (const T a) const |
SpMatrix (T *v, int *r, int *pB, int *pE, int m, int n, int nzmax) | |
SpMatrix (int m, int n, int nzmax) | |
SpMatrix () | |
void | sum_cols (Vector< T > &sum) const |
void | toFull (Matrix< T > &matrix) const |
void | toFullTrans (Matrix< T > &matrix) const |
T | v (const int i) const |
int | V () const |
T * | v () const |
void | wAAt (const Vector< T > &w, Matrix< T > &aat) const |
void | wXAt (const Vector< T > &w, const Matrix< T > &X, Matrix< T > &XAt, const int numthreads=-1) const |
void | XAt (const Matrix< T > &X, Matrix< T > &XAt) const |
void | XAt (const Matrix< T > &X, Matrix< T > &XAt, const Vector< int > &indices) const |
void | XtX (Matrix< T > &XtX) const |
~SpMatrix () | |
Public Member Functions inherited from spams::Data< T > | |
virtual | ~Data () |
Public Member Functions inherited from spams::AbstractMatrixB< T > | |
virtual | ~AbstractMatrixB () |
Private Member Functions | |
SpMatrix< T > & | operator= (const SpMatrix< T > &matrix) |
SpMatrix (const SpMatrix< T > &matrix) | |
Private Attributes | |
bool | _externAlloc |
int | _m |
int | _n |
int | _nzmax |
int * | _pB |
int * | _pE |
int * | _r |
T * | _v |
Friends | |
class | Matrix< T > |
class | SpVector< T > |
spams::SpMatrix< T >::SpMatrix | ( | T * | v, |
int * | r, | ||
int * | pB, | ||
int * | pE, | ||
int | m, | ||
int | n, | ||
int | nzmax | ||
) |
spams::SpMatrix< T >::SpMatrix | ( | int | m, |
int | n, | ||
int | nzmax | ||
) |
Constructor, new m x n matrix, with at most nzmax non-zeros values.
Definition at line 4084 of file linalg.h.
References spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, and spams::SpMatrix< T >::nzmax().
spams::SpMatrix< T >::SpMatrix | ( | ) |
spams::SpMatrix< T >::~SpMatrix | ( | ) |
Destructor.
Definition at line 4111 of file linalg.h.
References spams::SpMatrix< T >::clear().
|
explicitprivate |
forbid copy constructor
|
inline |
aat <- A*A'
Algebraic operations aat <- A*A'
Definition at line 4535 of file linalg.h.
References spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::Matrix< T >::_X, spams::Matrix< T >::fillSymmetric(), spams::init_omp(), MAX_THREADS, and spams::Matrix< T >::resize().
|
inline |
aat <- A(:,indices)*A(:,indices)'
Definition at line 4583 of file linalg.h.
References spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::Matrix< T >::_X, spams::Matrix< T >::fillSymmetric(), spams::init_omp(), MAX_THREADS, spams::Vector< T >::n(), and spams::Matrix< T >::resize().
|
inline |
Definition at line 4183 of file linalg.h.
References spams::SpMatrix< T >::_nzmax, spams::SpMatrix< T >::_v, and spams::Vector< T >::add().
Referenced by spams::FISTA::ADMM(), and spams::FISTA::LinADMM().
|
inline |
Definition at line 4494 of file linalg.h.
References spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::isEqual(), and spams::Vector< T >::rawX().
Referenced by spams::FISTA::ADMM(), spams::FISTA::LagrangianADMM(), and spams::FISTA::LinADMM().
|
inline |
Definition at line 4509 of file linalg.h.
References spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::isEqual(), and spams::Vector< T >::rawX().
Referenced by spams::FISTA::ADMM().
|
inline |
compute the sum of the matrix elements
Definition at line 4173 of file linalg.h.
References spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, and spams::SpMatrix< T >::_v.
|
inline |
clear the matrix
Modifiers clear the matrix
Definition at line 4204 of file linalg.h.
References spams::SpMatrix< T >::_externAlloc, spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_nzmax, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, and spams::SpMatrix< T >::_v.
Referenced by spams::ist(), spams::lasso(), spams::lasso2(), spams::lasso_mask(), spams::lassoReweighted(), spams::lassoWeight(), spams::lassoWeightPreComputed(), spams::omp(), spams::omp_mask(), spams::SpMatrix< T >::resize(), spams::somp(), spams::Matrix< T >::toSparse(), spams::Matrix< T >::toSparseTrans(), and spams::SpMatrix< T >::~SpMatrix().
|
inline |
use the data from v, r for _v, _r
Definition at line 4786 of file linalg.h.
References spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::Matrix< T >::m(), spams::Matrix< T >::n(), spams::SpMatrix< T >::r(), spams::SpMatrix< T >::resize(), spams::sort(), spams::SpMatrix< T >::v(), and spams::Matrix< T >::X().
Referenced by spams::lasso(), spams::lasso2(), spams::lasso_mask(), spams::lassoReweighted(), spams::lassoWeight(), spams::lassoWeightPreComputed(), spams::omp(), and spams::omp_mask().
|
inline |
use the data from v, r for _v, _r
Definition at line 4809 of file linalg.h.
References spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::Matrix< T >::m(), spams::Matrix< T >::n(), spams::SpMatrix< T >::r(), spams::Vector< T >::rawX(), spams::SpMatrix< T >::resize(), spams::sort(), spams::SpMatrix< T >::v(), and spams::Matrix< T >::X().
Referenced by spams::somp().
|
inline |
Definition at line 4102 of file linalg.h.
References spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_nzmax, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, and spams::SpMatrix< T >::resize().
Referenced by spams::FISTA::ADMM(), spams::FISTA::LagrangianADMM(), spams::FISTA::LinADMM(), and spams::remove_cycles().
|
inline |
Definition at line 4190 of file linalg.h.
References spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_v, and spams::Vector< T >::copy().
|
inlinevirtual |
Implements spams::AbstractMatrixB< T >.
Definition at line 4479 of file linalg.h.
References spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::Vector< T >::resize(), and spams::Vector< T >::setZeros().
|
inlinevirtual |
make a copy of the matrix mat in the current matrix
Implements spams::AbstractMatrixB< T >.
Definition at line 866 of file linalg.h.
References spams::Data< T >::norm_2sq_cols().
|
inlinevirtual |
dot product;
Implements spams::AbstractMatrixB< T >.
Definition at line 4468 of file linalg.h.
References spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, and spams::SpMatrix< T >::_v.
|
inline |
Definition at line 4197 of file linalg.h.
References spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_v, and spams::Vector< T >::dot().
Referenced by spams::FISTA::LagrangianADMM().
|
virtual |
Implements spams::Data< T >.
Definition at line 4151 of file linalg.h.
References spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::Vector< T >::resize(), and spams::Vector< T >::setZeros().
Referenced by spams::SpMatrix< T >::getGroup().
|
virtual |
Implements spams::Data< T >.
Definition at line 4159 of file linalg.h.
References spams::SpMatrix< T >::_m, spams::SpMatrix< T >::getData(), spams::Matrix< T >::refCol(), and spams::Matrix< T >::resize().
|
inlinevirtual |
returns the number of columns
Implements spams::Data< T >.
Definition at line 789 of file linalg.h.
Referenced by spams::FISTA::GraphLasso< T >::eval_weighted(), spams::Matrix< T >::mult(), spams::SpMatrix< T >::mult(), spams::SpMatrix< T >::resize(), spams::SpMatrixToUtlMatrix(), and spams::SpMatrixToVnlMatrix().
|
inlinevirtual |
perform b = alpha*A*x + beta*b, when x is sparse
Implements spams::AbstractMatrixB< T >.
Definition at line 4305 of file linalg.h.
References spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::SpVector< T >::L(), spams::SpVector< T >::r(), spams::Vector< T >::rawX(), spams::Vector< T >::resize(), spams::Vector< T >::scal(), spams::Vector< T >::setZeros(), and spams::SpVector< T >::v().
Referenced by spams::Matrix< T >::mult(), and spams::SpMatrix< T >::mult().
|
inlinevirtual |
perform b = alpha*A*x + beta*b, when x is sparse
y <- A*x
Implements spams::AbstractMatrixB< T >.
Definition at line 4285 of file linalg.h.
References spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::Vector< T >::rawX(), spams::Vector< T >::resize(), spams::Vector< T >::scal(), and spams::Vector< T >::setZeros().
|
inlinevirtual |
perform C = a*A*B + b*C, possibly transposing A or B.
Implements spams::AbstractMatrixB< T >.
Definition at line 4325 of file linalg.h.
References spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_n, spams::Matrix< T >::addRow(), spams::Matrix< T >::copyRow(), spams::Matrix< T >::m(), spams::Matrix< T >::mult(), spams::SpMatrix< T >::mult(), spams::Matrix< T >::multTrans(), spams::Matrix< T >::n(), spams::Matrix< T >::refCol(), spams::SpMatrix< T >::refCol(), spams::Matrix< T >::resize(), spams::Matrix< T >::scal(), and spams::Matrix< T >::setZeros().
|
inlinevirtual |
perform C = a*B*A + b*C, possibly transposing A or B.
perform C = a*A*B + b*C, possibly transposing A or B.
Implements spams::AbstractMatrixB< T >.
Definition at line 4393 of file linalg.h.
References spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_n, spams::Matrix< T >::addRow(), spams::SpMatrix< T >::m(), spams::SpMatrix< T >::mult(), spams::SpMatrix< T >::multTrans(), spams::SpMatrix< T >::n(), spams::Matrix< T >::rank1Update(), spams::Matrix< T >::refCol(), spams::SpMatrix< T >::refCol(), spams::Matrix< T >::resize(), spams::Matrix< T >::scal(), and spams::Matrix< T >::setZeros().
|
inlinevirtual |
perform C = a*B*A + b*C, possibly transposing A or B.
Implements spams::AbstractMatrixB< T >.
Definition at line 4461 of file linalg.h.
References spams::Matrix< T >::mult().
|
inlinevirtual |
y <- A'*x
Implements spams::AbstractMatrixB< T >.
Definition at line 4246 of file linalg.h.
References spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::Vector< T >::rawX(), spams::Vector< T >::resize(), spams::Vector< T >::scal(), and spams::Vector< T >::setZeros().
Referenced by spams::SpMatrix< T >::mult(), and spams::SpMatrix< T >::XtX().
|
inline |
perform b = alpha*A*x + beta*b, when x is sparse
Definition at line 4266 of file linalg.h.
References spams::SpMatrix< T >::_n, spams::SpVector< T >::dot(), spams::Vector< T >::rawX(), spams::SpMatrix< T >::refCol(), spams::Vector< T >::resize(), spams::Vector< T >::scal(), and spams::Vector< T >::setZeros().
|
inlinevirtual |
returns the number of rows
Implements spams::Data< T >.
Definition at line 787 of file linalg.h.
Referenced by spams::FISTA::convert_paths_to_mat(), spams::count_paths_dags(), spams::FISTA::GraphPathConv< T >::eval_dual_norm_paths(), spams::FISTA::GraphPathL0< T >::eval_paths(), spams::FISTA::GraphPathConv< T >::eval_paths(), spams::FISTA::GraphLasso< T >::eval_split(), spams::FISTA::GraphLasso< T >::eval_weighted(), spams::Matrix< T >::mult(), spams::SpMatrix< T >::mult(), spams::FISTA::GraphLasso< T >::prox_split(), spams::remove_cycles(), spams::SpMatrix< T >::resize(), spams::SpMatrixToUtlMatrix(), spams::SpMatrixToVnlMatrix(), spams::FISTA::SqLossMat< T >::test_backtracking(), spams::FISTA::update_multipliers_ADMM(), spams::FISTA::update_multipliers_LinADMM(), spams::FISTA::update_multipliers_weighted_ADMM(), spams::SpMatrix< T >::wXAt(), and spams::SpMatrix< T >::XAt().
|
inline |
number of nonzeros elements
Definition at line 812 of file linalg.h.
References spams::Data< T >::m(), and spams::Data< T >::n().
|
inline |
returns the l0 norms of the columns
Definition at line 4842 of file linalg.h.
References spams::SpMatrix< T >::_n, spams::SpVector< T >::length(), spams::SpMatrix< T >::refCol(), and spams::Vector< T >::resize().
|
inline |
returns the l1 norms of the columns
Definition at line 4852 of file linalg.h.
References spams::SpMatrix< T >::_n, spams::SpVector< T >::asum(), spams::SpMatrix< T >::refCol(), and spams::Vector< T >::resize().
|
inlinevirtual |
returns the l2 norms ^2 of the columns
Reimplemented from spams::Data< T >.
Definition at line 4832 of file linalg.h.
References spams::SpMatrix< T >::_n, spams::SpVector< T >::nrm2sq(), spams::SpMatrix< T >::refCol(), and spams::Vector< T >::resize().
|
inline |
compute the sum of the matrix elements
Definition at line 4178 of file linalg.h.
References spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, and spams::SpMatrix< T >::_v.
Referenced by spams::FISTA::LagrangianADMM(), and spams::FISTA::SqLossMat< T >::test_backtracking().
|
inline |
returns the maximum number of non-zero elements
Definition at line 785 of file linalg.h.
Referenced by spams::SpMatrix< T >::resize(), and spams::SpMatrix< T >::SpMatrix().
|
private |
|
inlinevirtual |
returns X[index]
Implements spams::Data< T >.
Definition at line 4138 of file linalg.h.
References spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_r, and spams::SpMatrix< T >::_v.
|
inline |
returns pB[i]
Definition at line 779 of file linalg.h.
Referenced by spams::FISTA::convert_paths_to_mat(), spams::count_cc_graph(), spams::count_paths_dags(), spams::MaxFlow< T >::init_split_variables(), spams::remove_cycles(), spams::SpMatrixToUtlMatrix(), and spams::SpMatrixToVnlMatrix().
|
inline |
|
inline |
Direct access to _pE.
Definition at line 806 of file linalg.h.
Referenced by spams::FISTA::convert_paths_to_mat(), spams::SpMatrixToUtlMatrix(), and spams::SpMatrixToVnlMatrix().
|
inlinevirtual |
print the sparse matrix
Implements spams::AbstractMatrixB< T >.
Definition at line 4127 of file linalg.h.
References spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_nzmax, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, and spams::SpMatrix< T >::_v.
Referenced by mexFunction().
|
inline |
returns r[i]
Definition at line 781 of file linalg.h.
Referenced by spams::FISTA::convert_paths_to_mat(), spams::count_cc_graph(), spams::count_paths_dags(), spams::MaxFlow< T >::init_split_variables(), spams::remove_cycles(), spams::SpMatrixToUtlMatrix(), and spams::SpMatrixToVnlMatrix().
|
inline |
Direct access to _r.
Definition at line 808 of file linalg.h.
Referenced by spams::SpMatrix< T >::convert(), and spams::SpMatrix< T >::convert2().
|
inline |
reference the column i into vec
Accessors reference the column i into vec
Definition at line 4116 of file linalg.h.
References spams::SpVector< T >::_externAlloc, spams::SpVector< T >::_L, spams::SpVector< T >::_nzmax, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpVector< T >::_r, spams::SpMatrix< T >::_v, spams::SpVector< T >::_v, and spams::SpVector< T >::clear().
Referenced by spams::FISTA::GraphLasso< T >::eval_split(), spams::FISTA::GraphLasso< T >::eval_weighted(), spams::Matrix< T >::mult(), spams::SpMatrix< T >::mult(), spams::SpMatrix< T >::multTrans(), spams::SpMatrix< T >::norm_0_cols(), spams::SpMatrix< T >::norm_1_cols(), spams::SpMatrix< T >::norm_2sq_cols(), spams::FISTA::GraphLasso< T >::prox_split(), spams::SpMatrix< T >::sum_cols(), spams::FISTA::SqLossMat< T >::test_backtracking(), spams::FISTA::update_multipliers_ADMM(), spams::FISTA::update_multipliers_LinADMM(), spams::FISTA::update_multipliers_weighted_ADMM(), and spams::SpMatrix< T >::XtX().
|
inline |
resize the matrix
Definition at line 4221 of file linalg.h.
References spams::SpMatrix< T >::_externAlloc, spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_nzmax, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::SpMatrix< T >::clear(), spams::SpMatrix< T >::m(), spams::SpMatrix< T >::n(), and spams::SpMatrix< T >::nzmax().
Referenced by spams::SpMatrix< T >::convert(), spams::SpMatrix< T >::convert2(), spams::FISTA::convert_paths_to_mat(), spams::SpMatrix< T >::copy(), spams::MaxFlow< T >::init_split_variables(), and spams::SpVector< T >::toSpMatrix().
|
inline |
scale the matrix by a
resize the matrix
Definition at line 4240 of file linalg.h.
References spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, and spams::SpMatrix< T >::_v.
Referenced by spams::FISTA::ADMM(), and spams::FISTA::LinADMM().
|
inline |
Definition at line 4524 of file linalg.h.
References spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_n, spams::Vector< T >::add(), spams::SpMatrix< T >::refCol(), spams::Vector< T >::resize(), and spams::Vector< T >::setZeros().
|
inline |
copy the sparse matrix into a dense matrix
Conversions copy the sparse matrix into a dense matrix
Definition at line 4760 of file linalg.h.
References spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::Matrix< T >::_X, spams::Matrix< T >::resize(), and spams::Matrix< T >::setZeros().
Referenced by spams::ist().
|
inline |
copy the sparse matrix into a dense transposed matrix
copy the sparse matrix into a full dense matrix
Definition at line 4772 of file linalg.h.
References spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::Matrix< T >::_X, spams::Matrix< T >::resize(), and spams::Matrix< T >::setZeros().
|
inline |
returns v[i]
Definition at line 783 of file linalg.h.
Referenced by spams::FISTA::convert_paths_to_mat(), spams::count_cc_graph(), spams::MaxFlow< T >::init_split_variables(), spams::remove_cycles(), spams::SpMatrixToUtlMatrix(), and spams::SpMatrixToVnlMatrix().
|
inlinevirtual |
returns the number of columns
Implements spams::Data< T >.
Definition at line 791 of file linalg.h.
References spams::Data< T >::getData(), spams::Data< T >::getGroup(), and spams::Data< T >::operator[]().
|
inline |
Direct access to _v.
Definition at line 810 of file linalg.h.
Referenced by spams::SpMatrix< T >::convert(), and spams::SpMatrix< T >::convert2().
|
inline |
aat <- sum_i w_i A(:,i)*A(:,i)'
Definition at line 4619 of file linalg.h.
References spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::Matrix< T >::_X, spams::Vector< T >::_X, spams::Matrix< T >::fillSymmetric(), spams::init_omp(), MAX_THREADS, and spams::Matrix< T >::resize().
|
inline |
XAt <- sum_i w_i X(:,i)*A(:,i)'.
Definition at line 4721 of file linalg.h.
References spams::Matrix< T >::_m, spams::SpMatrix< T >::_m, spams::Matrix< T >::_n, spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::Matrix< T >::_X, spams::Vector< T >::_X, spams::init_omp(), spams::SpMatrix< T >::n(), and spams::Matrix< T >::resize().
|
inline |
XAt <- X*A'.
Definition at line 4654 of file linalg.h.
References spams::Matrix< T >::_m, spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_n, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::Matrix< T >::_X, spams::init_omp(), MAX_THREADS, spams::SpMatrix< T >::n(), and spams::Matrix< T >::resize().
|
inline |
XAt <- X(:,indices)*A(:,indices)'.
Definition at line 4687 of file linalg.h.
References spams::Matrix< T >::_m, spams::SpMatrix< T >::_m, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_pE, spams::SpMatrix< T >::_r, spams::SpMatrix< T >::_v, spams::Matrix< T >::_X, spams::init_omp(), MAX_THREADS, spams::Vector< T >::n(), spams::SpMatrix< T >::n(), and spams::Matrix< T >::resize().
|
inlinevirtual |
XtX = A'*A.
Implements spams::AbstractMatrixB< T >.
Definition at line 4569 of file linalg.h.
References spams::SpMatrix< T >::_n, spams::SpMatrix< T >::multTrans(), spams::Matrix< T >::refCol(), spams::SpMatrix< T >::refCol(), spams::Matrix< T >::resize(), and spams::Matrix< T >::setZeros().
|
private |
if the data has been externally allocated
Definition at line 900 of file linalg.h.
Referenced by spams::SpMatrix< T >::clear(), spams::SpMatrix< T >::resize(), spams::Matrix< T >::toSparse(), and spams::Matrix< T >::toSparseTrans().
|
private |
number of rows
Definition at line 910 of file linalg.h.
Referenced by spams::SpMatrix< T >::AAt(), spams::SpMatrix< T >::clear(), spams::SpMatrix< T >::copy(), spams::SpMatrix< T >::getData(), spams::SpMatrix< T >::getGroup(), spams::SpMatrix< T >::mult(), spams::SpMatrix< T >::operator[](), spams::SpMatrix< T >::print(), spams::SpMatrix< T >::resize(), spams::SpMatrix< T >::sum_cols(), spams::SpMatrix< T >::toFull(), spams::SpMatrix< T >::toFullTrans(), spams::Matrix< T >::toSparse(), spams::Matrix< T >::toSparseTrans(), spams::SpMatrix< T >::wAAt(), spams::SpMatrix< T >::wXAt(), and spams::SpMatrix< T >::XAt().
|
private |
number of columns
Definition at line 912 of file linalg.h.
Referenced by spams::SpMatrix< T >::AAt(), spams::SpMatrix< T >::addVecToCols(), spams::SpMatrix< T >::addVecToColsWeighted(), spams::SpMatrix< T >::asum(), spams::SpMatrix< T >::clear(), spams::SpMatrix< T >::copy(), spams::SpMatrix< T >::copy_direct(), spams::SpMatrix< T >::copyRow(), spams::SpMatrix< T >::dot(), spams::SpMatrix< T >::dot_direct(), spams::SpMatrix< T >::mult(), spams::SpMatrix< T >::multTrans(), spams::SpMatrix< T >::norm_0_cols(), spams::SpMatrix< T >::norm_1_cols(), spams::SpMatrix< T >::norm_2sq_cols(), spams::SpMatrix< T >::normFsq(), spams::SpMatrix< T >::print(), spams::SpMatrix< T >::resize(), spams::SpMatrix< T >::scal(), spams::SpMatrix< T >::SpMatrix(), spams::SpMatrix< T >::sum_cols(), spams::SpMatrix< T >::toFull(), spams::SpMatrix< T >::toFullTrans(), spams::Matrix< T >::toSparse(), spams::Matrix< T >::toSparseTrans(), spams::SpMatrix< T >::wAAt(), spams::SpMatrix< T >::wXAt(), spams::SpMatrix< T >::XAt(), and spams::SpMatrix< T >::XtX().
|
private |
number of non-zero values
Definition at line 914 of file linalg.h.
Referenced by spams::SpMatrix< T >::add_direct(), spams::SpMatrix< T >::clear(), spams::SpMatrix< T >::copy(), spams::SpMatrix< T >::print(), spams::SpMatrix< T >::resize(), spams::Matrix< T >::toSparse(), and spams::Matrix< T >::toSparseTrans().
|
private |
indices of the beginning of columns
Definition at line 906 of file linalg.h.
Referenced by spams::SpMatrix< T >::AAt(), spams::SpMatrix< T >::addVecToCols(), spams::SpMatrix< T >::addVecToColsWeighted(), spams::SpMatrix< T >::asum(), spams::SpMatrix< T >::clear(), spams::SpMatrix< T >::convert(), spams::SpMatrix< T >::convert2(), spams::SpMatrix< T >::copy(), spams::SpMatrix< T >::copy_direct(), spams::SpMatrix< T >::copyRow(), spams::SpMatrix< T >::dot(), spams::SpMatrix< T >::dot_direct(), spams::SpMatrix< T >::getData(), spams::SpMatrix< T >::mult(), spams::SpMatrix< T >::multTrans(), spams::SpMatrix< T >::normFsq(), spams::SpMatrix< T >::operator[](), spams::SpMatrix< T >::print(), spams::SpMatrix< T >::refCol(), spams::SpMatrix< T >::resize(), spams::SpMatrix< T >::scal(), spams::SpMatrix< T >::SpMatrix(), spams::SpMatrix< T >::toFull(), spams::SpMatrix< T >::toFullTrans(), spams::Matrix< T >::toSparse(), spams::Matrix< T >::toSparseTrans(), spams::SpVector< T >::toSpMatrix(), spams::SpMatrix< T >::wAAt(), spams::SpMatrix< T >::wXAt(), and spams::SpMatrix< T >::XAt().
|
private |
indices of the end of columns
Definition at line 908 of file linalg.h.
Referenced by spams::SpMatrix< T >::AAt(), spams::SpMatrix< T >::addVecToCols(), spams::SpMatrix< T >::addVecToColsWeighted(), spams::SpMatrix< T >::clear(), spams::SpMatrix< T >::convert(), spams::SpMatrix< T >::convert2(), spams::SpMatrix< T >::copyRow(), spams::SpMatrix< T >::dot(), spams::SpMatrix< T >::mult(), spams::SpMatrix< T >::multTrans(), spams::SpMatrix< T >::print(), spams::SpMatrix< T >::refCol(), spams::SpMatrix< T >::resize(), spams::SpMatrix< T >::SpMatrix(), spams::SpMatrix< T >::toFull(), spams::SpMatrix< T >::toFullTrans(), spams::Matrix< T >::toSparse(), spams::Matrix< T >::toSparseTrans(), spams::SpMatrix< T >::wAAt(), spams::SpMatrix< T >::wXAt(), and spams::SpMatrix< T >::XAt().
|
private |
row indices
Definition at line 904 of file linalg.h.
Referenced by spams::SpMatrix< T >::AAt(), spams::SpMatrix< T >::addVecToCols(), spams::SpMatrix< T >::addVecToColsWeighted(), spams::SpMatrix< T >::clear(), spams::SpMatrix< T >::convert(), spams::SpMatrix< T >::convert2(), spams::SpMatrix< T >::copy(), spams::SpMatrix< T >::copyRow(), spams::SpMatrix< T >::dot(), spams::SpMatrix< T >::getData(), spams::SpMatrix< T >::mult(), spams::SpMatrix< T >::multTrans(), spams::SpMatrix< T >::operator[](), spams::SpMatrix< T >::print(), spams::SpMatrix< T >::refCol(), spams::SpMatrix< T >::resize(), spams::SpMatrix< T >::SpMatrix(), spams::SpMatrix< T >::toFull(), spams::SpMatrix< T >::toFullTrans(), spams::Matrix< T >::toSparse(), spams::Matrix< T >::toSparseTrans(), spams::SpVector< T >::toSpMatrix(), spams::SpMatrix< T >::wAAt(), spams::SpMatrix< T >::wXAt(), and spams::SpMatrix< T >::XAt().
|
private |
data
Definition at line 902 of file linalg.h.
Referenced by spams::SpMatrix< T >::AAt(), spams::SpMatrix< T >::add_direct(), spams::SpMatrix< T >::addVecToCols(), spams::SpMatrix< T >::addVecToColsWeighted(), spams::SpMatrix< T >::asum(), spams::SpMatrix< T >::clear(), spams::SpMatrix< T >::convert(), spams::SpMatrix< T >::convert2(), spams::SpMatrix< T >::copy(), spams::SpMatrix< T >::copy_direct(), spams::SpMatrix< T >::copyRow(), spams::SpMatrix< T >::dot(), spams::SpMatrix< T >::dot_direct(), spams::SpMatrix< T >::getData(), spams::SpMatrix< T >::mult(), spams::SpMatrix< T >::multTrans(), spams::SpMatrix< T >::normFsq(), spams::SpMatrix< T >::operator[](), spams::SpMatrix< T >::print(), spams::SpMatrix< T >::refCol(), spams::SpMatrix< T >::resize(), spams::SpMatrix< T >::scal(), spams::SpMatrix< T >::SpMatrix(), spams::SpMatrix< T >::toFull(), spams::SpMatrix< T >::toFullTrans(), spams::Matrix< T >::toSparse(), spams::Matrix< T >::toSparseTrans(), spams::SpVector< T >::toSpMatrix(), spams::SpMatrix< T >::wAAt(), spams::SpMatrix< T >::wXAt(), and spams::SpMatrix< T >::XAt().