DMRITool
v0.1.1-139-g860d86b4
Diffusion MRI Tool
|
#include <linalg.h>
Public Member Functions | |
T | asum () const |
void | clear () |
T | dot (const SpVector< T > &vec) const |
T | fmaxval () const |
int | L () const |
T | length () const |
T | nrm2 () const |
T | nrm2sq () const |
T | nzmax () const |
void | print (const string &name) const |
int | r (const int i) const |
T * | rawX () const |
void | refIndices (Vector< int > &indices) const |
void | refVal (Vector< T > &val) const |
void | resize (const int nzmax) |
void | setL (const int L) |
SpVector (T *v, int *r, int L, int nzmax) | |
SpVector (int nzmax) | |
SpVector () | |
void | sqr () |
void | toFull (Vector< T > &out) const |
void | toSpMatrix (SpMatrix< T > &out, const int m, const int n) const |
T | v (const int i) const |
~SpVector () | |
Private Member Functions | |
SpVector< T > & | operator= (const SpVector< T > &vector) |
SpVector (const SpVector< T > &vector) | |
Private Attributes | |
bool | _externAlloc |
int | _L |
int | _nzmax |
int * | _r |
T * | _v |
Friends | |
class | Matrix< T > |
class | SpMatrix< T > |
class | Vector< T > |
spams::SpVector< T >::SpVector | ( | T * | v, |
int * | r, | ||
int | L, | ||
int | nzmax | ||
) |
spams::SpVector< T >::SpVector | ( | int | nzmax | ) |
Constructor, allocates nzmax slots.
Definition at line 4872 of file linalg.h.
References spams::SpVector< T >::_r, spams::SpVector< T >::_v, and spams::SpVector< T >::nzmax().
spams::SpVector< T >::SpVector | ( | ) |
spams::SpVector< T >::~SpVector | ( | ) |
Destructor.
Definition at line 4887 of file linalg.h.
References spams::SpVector< T >::clear().
|
explicitprivate |
forbids lazy copies
|
inline |
computes the sum of the magnitude of the elements
Definition at line 4891 of file linalg.h.
References spams::SpVector< T >::_L, and spams::SpVector< T >::_v.
Referenced by spams::SpMatrix< T >::norm_1_cols().
|
inline |
clears the vector
Modifiers clears the vector
Definition at line 4958 of file linalg.h.
References spams::SpVector< T >::_externAlloc, spams::SpVector< T >::_L, spams::SpVector< T >::_nzmax, spams::SpVector< T >::_r, and spams::SpVector< T >::_v.
Referenced by spams::SpMatrix< T >::refCol(), spams::SpVector< T >::resize(), and spams::SpVector< T >::~SpVector().
|
inline |
dot product
Definition at line 4937 of file linalg.h.
References spams::SpVector< T >::_L, spams::SpVector< T >::_r, and spams::SpVector< T >::_v.
Referenced by spams::ShiftMatrix< T >::m(), spams::DoubleRowMatrix< T >::m(), and spams::SpMatrix< T >::multTrans().
|
inline |
computes the linf norm of the vector
computes the l2 norm of the vector
Definition at line 4906 of file linalg.h.
References spams::SpVector< T >::_L, spams::SpVector< T >::_v, and spams::Vector< T >::fmaxval().
Referenced by spams::FISTA::GraphLasso< T >::eval_split().
|
inline |
Definition at line 958 of file linalg.h.
Referenced by spams::FISTA::GraphLasso< T >::eval_weighted(), spams::SpMatrix< T >::mult(), spams::FISTA::update_multipliers_ADMM(), spams::FISTA::update_multipliers_LinADMM(), and spams::FISTA::update_multipliers_weighted_ADMM().
|
inline |
returns the length of the vector
Definition at line 937 of file linalg.h.
Referenced by spams::SpMatrix< T >::norm_0_cols().
|
inline |
computes the l2 norm of the vector
Definition at line 4901 of file linalg.h.
References spams::SpVector< T >::_L, and spams::SpVector< T >::_v.
Referenced by spams::FISTA::GraphLasso< T >::eval_split().
|
inline |
computes the l2 norm ^2 of the vector
Definition at line 4896 of file linalg.h.
References spams::SpVector< T >::_L, and spams::SpVector< T >::_v.
Referenced by spams::SpMatrix< T >::norm_2sq_cols().
|
inline |
Accessors returns the length of the vector
Definition at line 935 of file linalg.h.
Referenced by spams::FISTA::GraphLasso< T >::prox_split(), spams::SpVector< T >::resize(), and spams::SpVector< T >::SpVector().
|
private |
|
inline |
print the vector to std::cerr
Definition at line 4912 of file linalg.h.
References spams::SpVector< T >::_L, spams::SpVector< T >::_nzmax, spams::SpVector< T >::_r, and spams::SpVector< T >::_v.
Referenced by spams::ShiftMatrix< T >::m(), and spams::DoubleRowMatrix< T >::m().
|
inline |
access table r
Definition at line 953 of file linalg.h.
Referenced by spams::FISTA::GraphLasso< T >::eval_weighted(), spams::SpMatrix< T >::mult(), spams::FISTA::update_multipliers_ADMM(), spams::FISTA::update_multipliers_LinADMM(), and spams::FISTA::update_multipliers_weighted_ADMM().
|
inline |
Definition at line 956 of file linalg.h.
Referenced by spams::FISTA::GraphLasso< T >::prox_split().
|
inline |
create a reference on the vector r
Definition at line 4920 of file linalg.h.
References spams::SpVector< T >::_L, spams::SpVector< T >::_r, and spams::Vector< T >::setPointer().
Referenced by spams::Trainer< T >::train().
|
inline |
creates a reference on the vector val
Definition at line 4926 of file linalg.h.
References spams::SpVector< T >::_L, spams::SpVector< T >::_v, and spams::Vector< T >::setPointer().
Referenced by spams::Trainer< T >::train().
|
inline |
resizes the vector
Definition at line 4971 of file linalg.h.
References spams::SpVector< T >::_externAlloc, spams::SpVector< T >::_L, spams::SpVector< T >::_nzmax, spams::SpVector< T >::_r, spams::SpVector< T >::_v, spams::SpVector< T >::clear(), and spams::SpVector< T >::nzmax().
Referenced by spams::ist(), spams::Trainer< T >::train(), and spams::Trainer< T >::trainOffline().
|
inline |
Definition at line 960 of file linalg.h.
References spams::Data< T >::m(), spams::Data< T >::n(), and spams::sqr().
Referenced by spams::Trainer< T >::train().
|
inline |
a <- a.^2
Definition at line 4932 of file linalg.h.
References spams::SpVector< T >::_L, and spams::SpVector< T >::_v.
|
inline |
resize the vector as a sparse matrix
Definition at line 5008 of file linalg.h.
References spams::SpVector< T >::_L, spams::SpVector< T >::_r, spams::SpVector< T >::_v, spams::Vector< T >::rawX(), and spams::Vector< T >::setZeros().
Referenced by spams::ShiftMatrix< T >::mult().
|
inline |
resize the vector as a sparse matrix
Definition at line 4985 of file linalg.h.
References spams::SpVector< T >::_L, spams::SpMatrix< T >::_pB, spams::SpMatrix< T >::_r, spams::SpVector< T >::_r, spams::SpMatrix< T >::_v, spams::SpVector< T >::_v, and spams::SpMatrix< T >::resize().
|
inline |
access table r
Definition at line 955 of file linalg.h.
Referenced by spams::SpMatrix< T >::mult(), and spams::FISTA::update_multipliers_weighted_ADMM().
|
private |
external allocation
Definition at line 985 of file linalg.h.
Referenced by spams::SpVector< T >::clear(), spams::SpMatrix< T >::refCol(), and spams::SpVector< T >::resize().
|
private |
length
Definition at line 991 of file linalg.h.
Referenced by spams::Vector< T >::add(), spams::SpVector< T >::asum(), spams::SpVector< T >::clear(), spams::Vector< T >::dot(), spams::SpVector< T >::dot(), spams::SpVector< T >::fmaxval(), spams::Matrix< T >::mult(), spams::SpVector< T >::nrm2(), spams::SpVector< T >::nrm2sq(), spams::SpVector< T >::print(), spams::Matrix< T >::quad(), spams::Matrix< T >::rank1Update(), spams::SpMatrix< T >::refCol(), spams::SpVector< T >::refIndices(), spams::SpVector< T >::refVal(), spams::SpVector< T >::resize(), spams::SpVector< T >::sqr(), spams::Vector< T >::sub(), spams::SpVector< T >::toFull(), spams::Vector< T >::toSparse(), and spams::SpVector< T >::toSpMatrix().
|
private |
maximum number of nonzeros elements
Definition at line 993 of file linalg.h.
Referenced by spams::SpVector< T >::clear(), spams::SpVector< T >::print(), spams::SpMatrix< T >::refCol(), and spams::SpVector< T >::resize().
|
private |
indices
Definition at line 989 of file linalg.h.
Referenced by spams::Vector< T >::add(), spams::SpVector< T >::clear(), spams::Vector< T >::dot(), spams::SpVector< T >::dot(), spams::Matrix< T >::mult(), spams::SpVector< T >::print(), spams::Matrix< T >::quad(), spams::Matrix< T >::rank1Update(), spams::SpMatrix< T >::refCol(), spams::SpVector< T >::refIndices(), spams::SpVector< T >::resize(), spams::SpVector< T >::SpVector(), spams::Vector< T >::sub(), spams::SpVector< T >::toFull(), spams::Vector< T >::toSparse(), and spams::SpVector< T >::toSpMatrix().
|
private |
data
Definition at line 987 of file linalg.h.
Referenced by spams::Vector< T >::add(), spams::SpVector< T >::asum(), spams::SpVector< T >::clear(), spams::Vector< T >::dot(), spams::SpVector< T >::dot(), spams::SpVector< T >::fmaxval(), spams::Matrix< T >::mult(), spams::SpVector< T >::nrm2(), spams::SpVector< T >::nrm2sq(), spams::SpVector< T >::print(), spams::Matrix< T >::quad(), spams::Matrix< T >::rank1Update(), spams::SpMatrix< T >::refCol(), spams::SpVector< T >::refVal(), spams::SpVector< T >::resize(), spams::SpVector< T >::SpVector(), spams::SpVector< T >::sqr(), spams::Vector< T >::sub(), spams::SpVector< T >::toFull(), spams::Vector< T >::toSparse(), and spams::SpVector< T >::toSpMatrix().