DMRITool
v0.1.1-139-g860d86b4
Diffusion MRI Tool
|
#include <linalg.h>
Public Member Functions | |
void | add (const Vector< T > &x, const T a=1.0) |
void | add (const SpVector< T > &x, const T a=1.0) |
void | add (const T a) |
T | afused () const |
bool | allfalse () const |
template<> | |
bool | allfalse () const |
bool | alltrue () const |
template<> | |
bool | alltrue () const |
void | applyBayerPattern (const int offset) |
T | asum () const |
void | clear () |
void | copy (const Vector< T > &x) |
void | copyMask (Vector< T > &out, Vector< bool > &mask) const |
void | div (const Vector< T > &x) |
void | div (const Vector< T > &x, const Vector< T > &y) |
T | dot (const Vector< T > &x) const |
T | dot (const SpVector< T > &x) const |
void | exp () |
void | fakeSize (const int n) |
int | fmax () const |
T | fmaxval () const |
int | fmin () const |
T | fminval () const |
void | fusedProject (Vector< T > &out, const T lambda1, const T lambda2, const int itermax) |
void | fusedProjectHomotopy (Vector< T > &out, const T lambda1, const T lambda2, const T lambda3=0, const bool penalty=true) |
void | hardThrshold (const T nu) |
void | inv (const Vector< T > &x) |
void | inv () |
void | Invsqrt (const Vector< T > &x) |
void | Invsqrt () |
T | KL (const Vector< T > &X) |
void | l1l2project (Vector< T > &out, const T thrs, const T gamma, const bool pos=false) const |
void | l1l2projectb (Vector< T > &out, const T thrs, const T gamma, const bool pos=false, const int mode=1) |
void | l1project (Vector< T > &out, const T thrs, const bool simplex=false) const |
void | l1project_weighted (Vector< T > &out, const Vector< T > &weights, const T thrs, const bool residual=false) const |
void | log () |
void | logexp () |
void | logspace (const int n, const T a, const T b) |
template<> | |
void | logspace (const int n, const int a, const int b) |
T | lzero () const |
int | max () const |
T | maxval () const |
T | mean () |
int | min () const |
T | minval () const |
void | mult (const Vector< T > &x, const Vector< T > &y) |
void | mult_elementWise (const Vector< T > &B, Vector< T > &C) const |
int | n () const |
void | neg () |
int | nnz () const |
void | normalize () |
void | normalize2 () |
T | nrm2 () const |
T | nrm2sq () const |
T & | operator[] (const int index) |
T | operator[] (const int index) const |
void | print (const char *name) const |
template<> | |
void | print (const char *name) const |
template<> | |
void | print (const char *name) const |
template<> | |
void | print (const char *name) const |
template<> | |
void | print (const char *name) const |
void | project_sft (const Vector< int > &labels, const int clas) |
void | project_sft_binary (const Vector< T > &labels) |
void | randperm (int n) |
template<> | |
void | randperm (int n) |
T * | rawX () const |
void | resize (const int n) |
void | scal (const T a) |
void | set (const T val) |
void | setAleat () |
void | setData (T *X, const int n) |
void | setn (const int n) |
void | setPointer (T *X, const int n) |
void | setZeros () |
void | sign (Vector< T > &signs) const |
T | softmax (const int y) |
void | softThrshold (const T nu) |
void | sort (Vector< T > &out, const bool mode) const |
void | sort (const bool mode) |
void | sort2 (Vector< T > &out, Vector< int > &key, const bool mode) const |
void | sort2 (Vector< int > &key, const bool mode) |
void | sparseProject (Vector< 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) |
void | sqr (const Vector< T > &x) |
void | Sqrt (const Vector< T > &x) |
void | Sqrt () |
T | std () |
void | sub (const Vector< T > &x) |
void | sub (const SpVector< T > &x) |
T | sum () const |
void | thrsabsmin (const T nu) |
void | thrshold (const T nu) |
void | thrsmax (const T nu) |
void | thrsmin (const T nu) |
void | thrsPos () |
void | toSparse (SpVector< T > &vec) const |
void | unwhiten (Vector< T > &mean, const bool pattern=false) |
Vector () | |
Vector (int n) | |
Vector (const Vector< T > &vec) | |
Vector (T *X, int n) | |
void | whiten (Vector< T > &mean, const bool pattern=false) |
void | whiten (Vector< T > &mean, const Vector< T > &mask) |
void | whiten (const int V) |
virtual | ~Vector () |
Private Member Functions | |
Vector< T > & | operator= (const Vector< T > &vec) |
Private Attributes | |
bool | _externAlloc |
int | _n |
T * | _X |
Friends | |
class | Matrix< T > |
class | SpMatrix< T > |
class | SpVector< T > |
spams::Vector< T >::Vector | ( | ) |
spams::Vector< T >::Vector | ( | int | n | ) |
Constructor. Create a new vector of size n.
Definition at line 2697 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
spams::Vector< T >::Vector | ( | T * | X, |
int | n | ||
) |
|
explicit |
Copy constructor.
Definition at line 2710 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
|
virtual |
Destructor.
Definition at line 2720 of file linalg.h.
References spams::Vector< T >::clear().
|
inline |
A <- A + a*x.
Definition at line 3029 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::SpMatrix< T >::add_direct(), spams::Matrix< T >::addToCols(), spams::Matrix< T >::addVecToCols(), spams::Matrix< T >::center(), spams::FISTA::SqLoss< T >::compute_new_prim(), spams::FISTA::HingeLoss< T >::compute_new_prim(), spams::Matrix< T >::conjugateGradient(), spams::coreORMP(), spams::coreSOMP(), spams::Vector< T >::fusedProjectHomotopy(), spams::FISTA::MultiLogLoss< T >::grad(), spams::FISTA::LinADMM(), spams::ShiftMatrix< T >::mult(), spams::ShiftMatrix< T >::multTrans(), spams::FISTA::SqLoss< T >::prox_prim_var(), spams::FISTA::SqLoss< T >::prox_split(), spams::FISTA::HingeLoss< T >::prox_split(), spams::Matrix< T >::rank1Update(), spams::Vector< T >::softmax(), spams::Matrix< T >::sum_cols(), spams::SpMatrix< T >::sum_cols(), spams::Trainer< T >::train(), spams::Trainer< T >::trainOffline(), spams::FISTA::update_multipliers_ADMM(), spams::FISTA::update_multipliers_LinADMM(), spams::FISTA::update_multipliers_weighted_ADMM(), spams::FISTA::LogLoss< T, weighted >::var_fenchel(), and spams::FISTA::MultiLogLoss< T >::var_fenchel().
|
inline |
A <- A + a*x.
Definition at line 3035 of file linalg.h.
References spams::SpVector< T >::_L, spams::SpVector< T >::_r, spams::SpVector< T >::_v, and spams::Vector< T >::_X.
|
inline |
adds a to each value in the vector
Definition at line 3047 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
|
inline |
compute the sum of the differences
Definition at line 3336 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, and spams::Vector< T >::sum().
Referenced by spams::Vector< T >::fusedProjectHomotopy().
|
inline |
Referenced by spams::lasso_mask(), and spams::omp_mask().
|
inline |
Definition at line 2988 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
|
inline |
Referenced by spams::lasso_mask(), and spams::omp_mask().
|
inline |
Definition at line 2980 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
|
inline |
sort the vector
Definition at line 3917 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, and spams::Vector< T >::n().
|
inline |
computes the sum of the magnitudes of the vector
Definition at line 3324 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::coreGroupIST(), spams::coreIST(), spams::coreISTconstrained(), spams::Tree_Seq< T >::dual_norm_inf(), spams::FISTA::Lasso< T >::eval(), spams::FISTA::MixedL1L2< T >::eval(), spams::FISTA::MixedL1LINF< T >::eval(), spams::FISTA::normLINF< T >::fenchel(), spams::Vector< T >::fusedProjectHomotopy(), and spams::ist().
|
inline |
clear the vector
Definition at line 2917 of file linalg.h.
References spams::Vector< T >::_externAlloc, spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::Matrix< T >::refCol(), spams::Vector< T >::resize(), spams::Vector< T >::setPointer(), spams::Matrix< T >::toVect(), and spams::Vector< T >::~Vector().
|
inline |
make a copy of x
Definition at line 2865 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::n(), and spams::Vector< T >::resize().
Referenced by spams::FISTA::ADMM(), spams::Trainer< T >::cleanDict(), spams::Matrix< T >::conjugateGradient(), spams::SpMatrix< T >::copy_direct(), spams::coreLARS(), spams::coreORMP(), spams::coreSOMP(), spams::Matrix< T >::eigLargestMagnSym(), spams::Matrix< T >::eigLargestSymApprox(), spams::FISTA::SqLossMissing< T >::eval(), spams::FISTA::SqLoss< T >::eval(), spams::FISTA::Lasso< T >::fenchel(), spams::FISTA::LassoConstraint< T >::fenchel(), spams::FISTA::Ridge< T >::fenchel(), spams::FISTA::normL2< T >::fenchel(), spams::FISTA::normLINF< T >::fenchel(), spams::FISTA::GraphLasso< T >::fenchel(), spams::FISTA::TreeLasso< T >::fenchel(), spams::FISTA::GraphPathConv< T >::fenchel(), spams::Vector< T >::fusedProjectHomotopy(), spams::FISTA::SqLossMissing< T >::grad(), spams::FISTA::SqLoss< T >::grad(), spams::Vector< T >::l1l2project(), spams::Vector< T >::l1l2projectb(), spams::Vector< T >::l1project(), spams::Vector< T >::l1project_weighted(), spams::lassoReweighted(), spams::FISTA::LinADMM(), spams::Matrix< T >::merge(), spams::ShiftMatrix< T >::multTrans(), spams::Matrix< T >::NadarayaWatson(), spams::Tree_Seq< T >::proj_weighted_linf(), spams::FISTA::Lasso< T >::prox(), spams::FISTA::LassoConstraint< T >::prox(), spams::FISTA::Lzero< T >::prox(), spams::FISTA::None< T >::prox(), spams::FISTA::Ridge< T >::prox(), spams::FISTA::normL2< T >::prox(), spams::FISTA::normLINF< T >::prox(), spams::FISTA::FusedLasso< T >::prox(), spams::FISTA::GraphLasso< T >::prox(), spams::FISTA::TreeLasso< T >::prox(), spams::FISTA::TreeLzero< T >::prox(), spams::FISTA::GroupProx< T, Reg >::prox(), spams::FISTA::GraphPathL0< T >::prox(), spams::FISTA::GraphPathConv< T >::prox(), spams::FISTA::SqLoss< T >::prox_prim_var(), spams::FISTA::HingeLoss< T >::prox_prim_var(), spams::FISTA::GraphLasso< T >::prox_split(), spams::Vector< T >::sort(), spams::Vector< T >::sort2(), spams::Matrix< T >::sparseProject(), spams::Vector< T >::sparseProject(), spams::FISTA::Ridge< T >::sub_grad(), spams::Matrix< T >::svd(), spams::Matrix< T >::svdRankOne(), spams::FISTA::SqLoss< T >::test_backtracking(), spams::Trainer< T >::train(), spams::Trainer< T >::trainOffline(), spams::FISTA::update_multipliers_ADMM(), spams::FISTA::update_multipliers_weighted_ADMM(), spams::FISTA::SqLossMissing< T >::var_fenchel(), and spams::FISTA::SqLoss< T >::var_fenchel().
|
inline |
extract the rows of a matrix corresponding to a binary mask
Definition at line 4041 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::resize(), and spams::Vector< T >::setn().
Referenced by spams::lasso_mask(), and spams::omp_mask().
|
inline |
A <- A ./ x.
Definition at line 3064 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::coreLARS2W(), spams::coreORMP(), spams::coreSOMP(), spams::Vector< T >::l1project_weighted(), spams::FISTA::update_multipliers_ADMM(), spams::FISTA::update_multipliers_LinADMM(), and spams::FISTA::update_multipliers_weighted_ADMM().
|
inline |
A <- x ./ y.
Definition at line 3070 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
|
inline |
returns A'x
Definition at line 3012 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::computeError(), spams::Matrix< T >::conjugateGradient(), spams::coreSOMP(), spams::ProdMatrix< T >::diag(), spams::SpMatrix< T >::dot_direct(), spams::Matrix< T >::eigLargestSymApprox(), spams::FISTA::SqLossMissing< T >::fenchel(), spams::FISTA::SqLoss< T >::fenchel(), spams::Matrix< T >::multTrans(), spams::ProdMatrix< T >::operator()(), spams::ProdMatrix< T >::operator[](), spams::FISTA::GraphLasso< T >::prox(), spams::Matrix< T >::quad(), and spams::Matrix< T >::svdRankOne().
|
inline |
returns A'x, when x is sparse
Definition at line 3018 of file linalg.h.
References spams::SpVector< T >::_L, spams::SpVector< T >::_r, spams::SpVector< T >::_v, spams::Vector< T >::_X, and spams::Vector< T >::sum().
|
inline |
replace each value by its exponential
Definition at line 3287 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::FISTA::MultiLogLoss< T >::grad(), spams::Vector< T >::softmax(), spams::FISTA::LogLoss< T, weighted >::var_fenchel(), and spams::FISTA::MultiLogLoss< T >::var_fenchel().
|
inline |
|
inline |
returns the index of the value with largest magnitude
Definition at line 2843 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::coreLARS(), spams::coreLARS2(), spams::coreLARS2W(), spams::coreORMP(), spams::Vector< T >::fmaxval(), spams::Vector< T >::fusedProjectHomotopy(), spams::FISTA::MultiLogLoss< T >::grad(), and spams::FISTA::MultiLogLoss< T >::var_fenchel().
|
inline |
returns the maximum magnitude
Definition at line 2799 of file linalg.h.
References spams::Vector< T >::_X, and spams::Vector< T >::fmax().
Referenced by spams::coreIST(), spams::coreISTconstrained(), spams::FISTA::normLINF< T >::eval(), spams::FISTA::GraphLasso< T >::eval_weighted(), spams::FISTA::Lasso< T >::fenchel(), spams::FISTA::LassoConstraint< T >::fenchel(), spams::FISTA::MixedL1L2< T >::fenchel(), spams::FISTA::MixedL1LINF< T >::fenchel(), spams::FISTA::TraceNorm< T >::fenchel(), spams::SpVector< T >::fmaxval(), spams::GraphPath< T, Int >::init_graph(), spams::Matrix< T >::merge(), spams::Matrix< T >::norm_inf_cols(), and spams::GraphPath< T, Int >::scale_costs().
|
inline |
returns the index of the value with smallest magnitude
Definition at line 2848 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::Vector< T >::fminval(), and spams::Vector< T >::fusedProjectHomotopy().
|
inline |
returns the minimum magnitude
Definition at line 2804 of file linalg.h.
References spams::Vector< T >::_X, and spams::Vector< T >::fmin().
|
inline |
Modification of beta
Update first coordinate
Update alpha_j
Definition at line 3846 of file linalg.h.
References spams::Vector< T >::_X, spams::Vector< T >::n(), spams::Vector< T >::rawX(), spams::softThrs(), spams::Vector< T >::softThrshold(), and spams::Vector< T >::sum().
|
inline |
Computation of DtR
first element is selected, gamma and alpha are updated
update alpha
update DtR
Solve the Lasso using simplified LARS
exit if constraints are satisfied min_u ||b-u||_2^2 + lambda1||u||_1 +lambda2 Fused(u) + 0.5lambda3||u||_2^2
min_u ||b-u||_2^2 / lambda1||u||_1 +lambda2 Fused(u) + 0.5lambda3||u||_2^2 <= 1.0
Update pr_ind and pr_c
Compute DDu
Check constraints
Check changes of sign
Check new variables entering the active set
Update gamma, alpha, DtR, currentLambda
Update signs,pr_ind, pr_c
Definition at line 3675 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::add(), spams::Vector< T >::afused(), spams::Vector< T >::asum(), spams::Vector< T >::copy(), spams::Vector< T >::fmax(), spams::Vector< T >::fmin(), INFINITY, MIN, spams::Vector< T >::nrm2sq(), spams::Vector< T >::rawX(), spams::Vector< T >::scal(), spams::Vector< T >::set(), spams::Vector< T >::setZeros(), spams::Vector< T >::softThrshold(), spams::Vector< T >::sub(), and spams::Vector< T >::sum().
Referenced by spams::FISTA::FusedLasso< T >::prox(), and spams::Vector< T >::sparseProject().
|
inline |
performs soft-thresholding of the vector
Definition at line 2938 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::Matrix< T >::hardThrshold(), and spams::FISTA::Lzero< T >::prox().
|
inline |
A <- 1./x.
Definition at line 3103 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::n(), and spams::Vector< T >::resize().
Referenced by spams::Matrix< T >::inv_elem(), spams::Matrix< T >::NadarayaWatson(), spams::Tree_Seq< T >::proj_weighted_linf(), spams::FISTA::MixedL1L2< T >::sub_grad(), and spams::FISTA::LogLoss< T, weighted >::var_fenchel().
|
inline |
A <- 1./A.
Definition at line 3109 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
|
inline |
A <- 1 ./ sqrt(x)
A <- x .^ 2.
Definition at line 3083 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, and spams::Vector< T >::resize().
|
inline |
A <- 1 ./ sqrt(A)
A <- x .^ 2.
Definition at line 3093 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
|
inline |
compute the Kuhlback-Leiber divergence
Definition at line 3212 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::rawX(), and spams::Vector< T >::sum().
|
inline |
projects the vector onto the l1 ball of radius thrs, projects the vector onto the l1 ball of radius thrs, returns true if the returned vector is null
returns true if the returned vector is null min_u ||b-u||_2^2 / ||u||_1 + (gamma/2) ||u||_2^2 <= thrs
BEGIN
Definition at line 3593 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::copy(), spams::Vector< T >::l1project(), spams::Vector< T >::nrm2sq(), spams::Vector< T >::scal(), spams::Vector< T >::softThrshold(), spams::Vector< T >::sum(), and spams::Vector< T >::thrsPos().
Referenced by spams::Vector< T >::l1l2projectb(), and spams::Vector< T >::sparseProject().
|
inline |
returns true if the returned vector is null
min_u ||b-u||_2^2 / ||u||_2^2 + gamma ||u||_1 <= thrs
min_u ||b-u||_2^2 / ||u||_1 + (gamma/2) ||u||_2^2 <= thrs
min_u 0.5||b-u||_2^2 + gamma||u||_1 / ||u||_2^2 <= thrs
Definition at line 3567 of file linalg.h.
References spams::Vector< T >::copy(), spams::Vector< T >::l1l2project(), spams::Vector< T >::nrm2(), spams::Vector< T >::scal(), spams::Vector< T >::softThrshold(), and spams::Vector< T >::thrsPos().
|
inline |
projects the vector onto the l1 ball of radius thrs, returns true if the returned vector is null
Definition at line 3364 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::copy(), spams::Vector< T >::softThrshold(), spams::Vector< T >::sum(), and spams::Vector< T >::thrsPos().
Referenced by spams::Vector< T >::l1l2project(), spams::FISTA::normLINF< T >::prox(), and spams::Vector< T >::sparseProject().
|
inline |
projects the vector onto the l1 ball of radius thrs, returns true if the returned vector is null
Definition at line 3417 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::copy(), spams::Vector< T >::div(), MAX, MIN, spams::Vector< T >::setZeros(), and spams::Vector< T >::sort2().
Referenced by spams::MaxFlow< T >::project_weighted().
|
inline |
replace each value by its logarithm
Definition at line 3292 of file linalg.h.
References spams::Vector< T >::_X.
|
inline |
replace each value by its exponential
Definition at line 3297 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
|
inline |
generate logarithmically spaced values
Definition at line 2809 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, and spams::Vector< T >::resize().
Referenced by spams::Vector< T >::logspace().
|
inline |
generate logarithmically spaced values
Definition at line 2830 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::logspace(), and spams::Vector< T >::resize().
|
inline |
Definition at line 3328 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::FISTA::Lzero< T >::eval().
|
inline |
returns the index of the largest value
Definition at line 2761 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::coreLARS(), spams::coreLARS2(), spams::coreLARS2W(), spams::coreSOMP(), spams::Vector< T >::maxval(), and spams::Vector< T >::softmax().
|
inline |
returns the maximum value
Definition at line 2789 of file linalg.h.
References spams::Vector< T >::_X, and spams::Vector< T >::max().
Referenced by spams::coreGroupIST(), spams::coreGroupISTConstrained(), spams::FISTA::LassoConstraint< T >::fenchel(), spams::Matrix< T >::NadarayaWatson(), spams::omp(), spams::omp_mask(), and spams::Vector< T >::softmax().
|
inline |
whiten
return the mean
Definition at line 3260 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::sum().
Referenced by spams::Matrix< T >::mean(), spams::Vector< T >::project_sft(), spams::Vector< T >::project_sft_binary(), spams::Vector< T >::std(), spams::Vector< T >::unwhiten(), and spams::Vector< T >::whiten().
|
inline |
returns the index of the minimum value
Definition at line 2775 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::Vector< T >::minval().
|
inline |
returns the minimum value
Definition at line 2794 of file linalg.h.
References spams::Vector< T >::_X, and spams::Vector< T >::min().
|
inline |
A <- x .* y.
Definition at line 3114 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::n(), and spams::Vector< T >::resize().
Referenced by spams::FISTA::SqLoss< T >::compute_new_prim(), spams::FISTA::HingeLoss< T >::compute_new_prim(), spams::coreSOMP(), spams::Vector< int >::mult_elementWise(), spams::FISTA::SqLoss< T >::test_backtracking(), and spams::FISTA::LogLoss< T, weighted >::var_fenchel().
|
inline |
|
inline |
returns the size of the vector
Definition at line 591 of file linalg.h.
Referenced by spams::SpMatrix< T >::AAt(), spams::Vector< T >::applyBayerPattern(), spams::SubMatrix< T >::convertIndicesI(), spams::SubMatrix< T >::convertIndicesJ(), spams::Vector< T >::copy(), spams::Matrix< T >::copyMask(), spams::coreORMP(), spams::count_cc_graph(), spams::FISTA::SqLossMissing< T >::eval(), spams::FISTA::SqLoss< T >::eval(), spams::FISTA::HingeLoss< T >::eval(), spams::FISTA::LogLoss< T, weighted >::eval(), spams::FISTA::Lasso< T >::eval(), spams::FISTA::Ridge< T >::eval(), spams::FISTA::normL2< T >::eval(), spams::FISTA::normLINF< T >::eval(), spams::FISTA::FusedLasso< T >::eval(), spams::FISTA::ProxMatToVec< T, ProxMat >::eval(), spams::FISTA::GroupProx< T, Reg >::eval(), spams::FISTA::MixedL1L2< T >::eval(), spams::FISTA::MixedL1LINF< T >::eval(), spams::FISTA::LogLoss< T, weighted >::fenchel(), spams::FISTA::Lasso< T >::fenchel(), spams::FISTA::LassoConstraint< T >::fenchel(), spams::FISTA::Ridge< T >::fenchel(), spams::FISTA::normL2< T >::fenchel(), spams::FISTA::normLINF< T >::fenchel(), spams::FISTA::GraphLasso< T >::fenchel(), spams::FISTA::TreeLasso< T >::fenchel(), spams::FISTA::ProxMatToVec< T, ProxMat >::fenchel(), spams::FISTA::GroupProx< T, Reg >::fenchel(), spams::FISTA::MixedL1L2< T >::fenchel(), spams::FISTA::MixedL1LINF< T >::fenchel(), spams::FISTA::GraphPathConv< T >::fenchel(), spams::Vector< T >::fusedProject(), spams::FISTA::SqLossMissing< T >::grad(), spams::FISTA::SqLoss< T >::grad(), spams::FISTA::LogLoss< T, weighted >::grad(), spams::FISTA::MultiLogLoss< T >::grad(), spams::FISTA::LogLoss< T, weighted >::init(), spams::FISTA::MultiLogLoss< T >::init(), spams::MaxFlow< T >::init_split_variables_aux(), spams::Vector< T >::inv(), spams::lasso_mask(), spams::Vector< T >::mult(), spams::Matrix< T >::multDiagLeft(), spams::Matrix< T >::multDiagRight(), spams::ShiftMatrix< T >::multTrans(), spams::Matrix< T >::NadarayaWatson(), spams::omp_mask(), spams::Tree_Seq< T >::proj(), spams::Tree_Seq< T >::proj_weighted_linf(), spams::Tree_Seq< T >::proj_zero(), spams::FISTA::Lasso< T >::prox(), spams::FISTA::LassoConstraint< T >::prox(), spams::FISTA::Lzero< T >::prox(), spams::FISTA::Ridge< T >::prox(), spams::FISTA::normL2< T >::prox(), spams::FISTA::normLINF< T >::prox(), spams::FISTA::FusedLasso< T >::prox(), spams::FISTA::TreeLasso< T >::prox(), spams::FISTA::TreeLzero< T >::prox(), spams::FISTA::ProxMatToVec< T, ProxMat >::prox(), spams::FISTA::GroupProx< T, Reg >::prox(), spams::FISTA::HingeLoss< T >::prox_prim_var(), spams::FISTA::GraphLasso< T >::prox_split(), spams::Matrix< T >::quad_mult(), spams::Vector< T >::randperm(), spams::Matrix< T >::rank1Update_mult(), spams::Vector< T >::resize(), spams::Vector< T >::setPointer(), spams::FISTA::Lasso< T >::sub_grad(), spams::FISTA::Ridge< T >::sub_grad(), spams::FISTA::TreeLasso< T >::sub_grad(), spams::FISTA::MixedL1L2< T >::sub_grad(), spams::Matrix< T >::subMatrixSym(), spams::FISTA::SqLoss< T >::test_backtracking(), spams::Trainer< T >::trainOffline(), spams::Matrix< T >::unwhiten(), spams::Vector< T >::unwhiten(), spams::FISTA::update_multipliers_ADMM(), spams::FISTA::update_multipliers_LinADMM(), spams::FISTA::update_multipliers_weighted_ADMM(), spams::FISTA::SqLossMissing< T >::var_fenchel(), spams::FISTA::SqLoss< T >::var_fenchel(), spams::FISTA::LogLoss< T, weighted >::var_fenchel(), spams::FISTA::MultiLogLoss< T >::var_fenchel(), spams::VectorToUtlVector(), spams::VectorToVnlVector(), spams::Matrix< T >::whiten(), spams::Vector< T >::whiten(), and spams::SpMatrix< T >::XAt().
|
inline |
A <- -A.
Definition at line 3282 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::FISTA::LogLoss< T, weighted >::var_fenchel().
|
inline |
Definition at line 2822 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, and spams::Vector< T >::sum().
|
inline |
normalize the vector
Definition at line 3122 of file linalg.h.
References EPSILON, spams::Vector< T >::nrm2(), and spams::Vector< T >::scal().
Referenced by spams::Matrix< T >::clean(), spams::Trainer< T >::cleanDict(), spams::Matrix< T >::normalize(), and spams::Matrix< T >::svdRankOne().
|
inline |
normalize the vector
Definition at line 3128 of file linalg.h.
References spams::Vector< T >::nrm2(), and spams::Vector< T >::scal().
Referenced by spams::Vector< T >::sparseProject(), spams::Trainer< T >::train(), and spams::Trainer< T >::trainOffline().
|
inline |
returns ||A||_2
Algebric operations returns ||A||_2
Definition at line 3002 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::Matrix< T >::eigLargestMagnSym(), spams::Matrix< T >::eigLargestSymApprox(), spams::FISTA::normL2< T >::eval(), spams::FISTA::normL2< T >::fenchel(), spams::Vector< T >::l1l2projectb(), spams::Matrix< T >::norm_1_2_col(), spams::Matrix< T >::norm_2_cols(), spams::Matrix< T >::norm_inf_2_col(), spams::Vector< T >::normalize(), spams::Vector< T >::normalize2(), spams::FISTA::normL2< T >::prox(), spams::FISTA::Rank< T >::prox(), spams::FISTA::GraphLasso< T >::prox_split(), and spams::Matrix< T >::svdRankOne().
|
inline |
returns ||A||_2^2
Definition at line 3007 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::computeError(), spams::Matrix< T >::conjugateGradient(), spams::FISTA::SqLossMissing< T >::eval(), spams::FISTA::SqLoss< T >::eval(), spams::FISTA::Ridge< T >::eval(), spams::FISTA::SqLossMissing< T >::fenchel(), spams::FISTA::SqLoss< T >::fenchel(), spams::Vector< T >::fusedProjectHomotopy(), spams::ist(), spams::ist_groupLasso(), spams::Vector< T >::l1l2project(), spams::lasso_mask(), spams::lassoReweighted(), spams::lassoWeight(), spams::lassoWeightPreComputed(), spams::Matrix< T >::norm_2sq_cols(), spams::omp(), spams::omp_mask(), spams::FISTA::GraphLasso< T >::prox(), and spams::Vector< T >::sparseProject().
|
private |
= operator,
|
inline |
returns a reference to X[index]
Definition at line 2853 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
|
inline |
returns X[index]
Definition at line 2859 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
|
inline |
Accessors Print the vector to std::cout
|
inline |
Print the vector to std::cout.
Definition at line 2725 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
|
inline |
Print the vector to std::cout.
Definition at line 2734 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
|
inline |
Print the vector to std::cout.
Definition at line 2743 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
|
inline |
Print the vector to std::cout.
Definition at line 2752 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
|
inline |
Definition at line 3482 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, spams::abs(), EPSILON, and spams::Vector< T >::mean().
Referenced by spams::FISTA::MultiLogLoss< T >::var_fenchel().
|
inline |
Definition at line 3460 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, spams::abs(), EPSILON, and spams::Vector< T >::mean().
Referenced by spams::FISTA::LogLoss< T, weighted >::var_fenchel().
|
inline |
put a random permutation of size n (for integral vectors)
Referenced by spams::Trainer< T >::train(), and spams::Trainer< T >::trainOffline().
|
inline |
put a random permutation of size n (for integral vectors)
Definition at line 2897 of file linalg.h.
References spams::Vector< T >::_X, spams::Vector< T >::n(), and spams::Vector< T >::resize().
|
inline |
returns a modifiable reference of the data, DANGEROUS
Definition at line 593 of file linalg.h.
Referenced by spams::Matrix< T >::addDiag(), spams::SpMatrix< T >::addVecToCols(), spams::SpMatrix< T >::addVecToColsWeighted(), spams::SpMatrix< T >::convert2(), spams::SubMatrix< T >::convertIndicesI(), spams::SubMatrix< T >::convertIndicesJ(), spams::SubMatrix< T >::copyCol(), spams::ShiftMatrix< T >::copyRow(), spams::coreGroupIST(), spams::coreGroupISTConstrained(), spams::coreIST(), spams::coreISTconstrained(), spams::coreLARS(), spams::coreLARS2(), spams::coreLARS2W(), spams::coreORMP(), spams::coreSOMP(), spams::Matrix< T >::diag(), spams::SubMatrix< T >::diag(), spams::downDateLasso(), spams::Tree_Seq< T >::dual_norm_inf(), spams::Graph< T >::dual_norm_inf(), spams::FISTA::normL2< T >::eval(), spams::FISTA::normLINF< T >::eval(), spams::FISTA::GraphLasso< T >::eval(), spams::FISTA::TreeLasso< T >::eval(), spams::FISTA::TreeLzero< T >::eval(), spams::FISTA::ProxMatToVec< T, ProxMat >::eval(), spams::FISTA::GroupProx< T, Reg >::eval(), spams::FISTA::GraphPathL0< T >::eval(), spams::FISTA::GraphPathConv< T >::eval(), spams::FISTA::GraphPathConv< T >::eval_dual_norm(), spams::FISTA::GraphPathConv< T >::eval_dual_norm_paths(), spams::FISTA::GraphPathL0< T >::eval_paths(), spams::FISTA::GraphPathConv< T >::eval_paths(), spams::FISTA::TreeLasso< T >::fenchel(), spams::FISTA::ProxMatToVec< T, ProxMat >::fenchel(), spams::FISTA::GroupProx< T, Reg >::fenchel(), spams::FISTA::GraphPathConv< T >::fenchel(), spams::Vector< T >::fusedProject(), spams::Vector< T >::fusedProjectHomotopy(), spams::Vector< T >::KL(), spams::SpMatrix< T >::mult(), spams::ShiftMatrix< T >::mult(), spams::Matrix< T >::multDiagLeft(), spams::Matrix< T >::multDiagRight(), spams::Matrix< T >::multTrans(), spams::SpMatrix< T >::multTrans(), spams::ShiftMatrix< T >::multTrans(), spams::Tree_Seq< T >::proj(), spams::Tree_Seq< T >::proj_weighted_linf(), spams::Tree_Seq< T >::proj_zero(), spams::FISTA::normL2< T >::prox(), spams::FISTA::normLINF< T >::prox(), spams::FISTA::GraphLasso< T >::prox(), spams::FISTA::TreeLasso< T >::prox(), spams::FISTA::TreeLzero< T >::prox(), spams::FISTA::ProxMatToVec< T, ProxMat >::prox(), spams::FISTA::GroupProx< T, Reg >::prox(), spams::FISTA::GraphPathL0< T >::prox(), spams::FISTA::GraphPathConv< T >::prox(), spams::FISTA::GraphLasso< T >::prox_split(), spams::Matrix< T >::setDiag(), spams::Vector< T >::sign(), spams::Matrix< T >::singularValues(), spams::Vector< T >::sort2(), spams::Tree_Seq< T >::sub_grad(), spams::Matrix< T >::subMatrixSym(), spams::Matrix< T >::svd(), spams::SpVector< T >::toFull(), spams::Trainer< T >::train(), spams::UtlVectorToVector(), spams::VectorToUtlVector(), spams::VectorToVnlVector(), and spams::VnlVectorToVector().
|
inline |
resize the vector
Definition at line 2876 of file linalg.h.
References spams::Vector< T >::_externAlloc, spams::Vector< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::clear(), spams::Vector< T >::n(), and spams::Vector< T >::setZeros().
Referenced by spams::Matrix< T >::center(), spams::Vector< T >::copy(), spams::Matrix< T >::copyCol(), spams::Vector< T >::copyMask(), spams::Matrix< T >::copyRow(), spams::SpMatrix< T >::copyRow(), spams::coreSOMP(), spams::Matrix< T >::diag(), spams::FISTA::EvalGraphPath(), spams::Matrix< T >::extractRow(), spams::SpMatrix< T >::getData(), spams::FISTA::SqLoss< T >::init_prim_var(), spams::FISTA::HingeLoss< T >::init_prim_var(), spams::Vector< T >::inv(), spams::Vector< T >::Invsqrt(), spams::ist(), spams::lasso(), spams::lasso2(), spams::lasso_mask(), spams::lassoReweighted(), spams::lassoWeight(), spams::lassoWeightPreComputed(), spams::Vector< T >::logspace(), spams::Matrix< T >::mult(), spams::Vector< T >::mult(), spams::SpMatrix< T >::mult(), spams::ShiftMatrix< T >::mult(), spams::DoubleRowMatrix< T >::mult(), spams::Matrix< T >::multTrans(), spams::SpMatrix< T >::multTrans(), spams::ShiftMatrix< T >::multTrans(), spams::SpMatrix< T >::norm_0_cols(), spams::SpMatrix< T >::norm_1_cols(), spams::Matrix< T >::norm_2_cols(), spams::Matrix< T >::norm_2_rows(), spams::Matrix< T >::norm_2sq_cols(), spams::SpMatrix< T >::norm_2sq_cols(), spams::Matrix< T >::norm_2sq_rows(), spams::Matrix< T >::norm_inf_cols(), spams::Matrix< T >::norm_inf_rows(), spams::Matrix< T >::norm_l1_rows(), spams::omp(), spams::omp_mask(), spams::FISTA::FusedLasso< T >::prox(), spams::FISTA::ProxMatToVec< T, ProxMat >::prox(), spams::FISTA::PROX(), spams::Vector< T >::randperm(), spams::Matrix< T >::singularValues(), spams::Matrix< T >::sparseProject(), spams::Vector< T >::sqr(), spams::Vector< T >::Sqrt(), spams::FISTA::Lasso< T >::sub_grad(), spams::FISTA::Ridge< T >::sub_grad(), spams::FISTA::TreeLasso< T >::sub_grad(), spams::Matrix< T >::sum_cols(), spams::SpMatrix< T >::sum_cols(), spams::Matrix< T >::svd(), spams::Matrix< T >::svdRankOne(), spams::Trainer< T >::train(), spams::Trainer< T >::trainOffline(), spams::UtlVectorToVector(), spams::FISTA::LogLoss< T, weighted >::var_fenchel(), and spams::VnlVectorToVector().
|
inline |
scale the vector by a
Definition at line 3277 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::Matrix< T >::center_rows(), spams::FISTA::SqLoss< T >::compute_new_prim(), spams::FISTA::HingeLoss< T >::compute_new_prim(), spams::Matrix< T >::conjugateGradient(), spams::Matrix< T >::eigLargestMagnSym(), spams::Matrix< T >::eigLargestSymApprox(), spams::Vector< T >::fusedProjectHomotopy(), spams::FISTA::LogLoss< T, weighted >::grad(), spams::FISTA::MultiLogLoss< T >::grad(), spams::Vector< T >::l1l2project(), spams::Vector< T >::l1l2projectb(), spams::Matrix< T >::mult(), spams::SpMatrix< T >::mult(), spams::ShiftMatrix< T >::mult(), spams::DoubleRowMatrix< T >::mult(), spams::SpMatrix< T >::multTrans(), spams::Vector< T >::normalize(), spams::Vector< T >::normalize2(), spams::FISTA::Ridge< T >::prox(), spams::FISTA::normL2< T >::prox(), spams::FISTA::SqLoss< T >::prox_prim_var(), spams::FISTA::HingeLoss< T >::prox_prim_var(), spams::FISTA::GraphLasso< T >::prox_split(), spams::Vector< T >::sparseProject(), spams::FISTA::Ridge< T >::sub_grad(), spams::Matrix< T >::svdRankOne(), spams::Trainer< T >::train(), spams::Trainer< T >::trainOffline(), spams::FISTA::LogLoss< T, weighted >::var_fenchel(), spams::FISTA::MultiLogLoss< T >::var_fenchel(), and spams::Matrix< T >::whiten().
|
inline |
set each value of the vector to val
Definition at line 2997 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::ShiftMatrix< T >::center(), spams::coreGroupIST(), spams::coreGroupISTConstrained(), spams::coreISTconstrained(), spams::coreLARS(), spams::coreLARS2(), spams::coreLARS2W(), spams::coreORMP(), spams::coreORMPB(), spams::coreSOMP(), spams::FISTA::FISTA_Generic(), spams::Vector< T >::fusedProjectHomotopy(), spams::FISTA::ISTA_Generic(), spams::lassoReweighted(), spams::Matrix< T >::meanCol(), spams::Matrix< T >::meanRow(), spams::Matrix< T >::NadarayaWatson(), spams::omp(), spams::omp_mask(), spams::FISTA::subGradientDescent_Generic(), spams::Trainer< T >::train(), spams::FISTA::update_multipliers_ADMM(), spams::FISTA::update_multipliers_LinADMM(), and spams::FISTA::update_multipliers_weighted_ADMM().
|
inline |
put random values in the vector (White Gaussian Noise)
put random values in the vector (white Gaussian Noise)
Definition at line 2912 of file linalg.h.
Referenced by spams::Matrix< T >::clean(), spams::Matrix< T >::eigLargestMagnSym(), spams::FISTA::Rank< T >::eval(), spams::Matrix< T >::normalize(), and spams::Matrix< T >::svdRankOne().
|
inline |
Definition at line 607 of file linalg.h.
Referenced by spams::ShiftMatrix< T >::copyRow(), spams::FISTA::TreeLasso< T >::fenchel(), spams::ShiftMatrix< T >::mult(), spams::ShiftMatrix< T >::multTrans(), spams::Tree_Seq< T >::proj_weighted_linf(), spams::FISTA::TreeLasso< T >::prox(), spams::FISTA::TreeLzero< T >::prox(), and spams::FISTA::GraphLasso< T >::prox_split().
|
inline |
Definition at line 627 of file linalg.h.
Referenced by spams::Vector< T >::copyMask(), spams::lasso_mask(), spams::omp_mask(), and spams::MaxFlow< T >::project_weighted().
|
inline |
change the data of the vector
Definition at line 2889 of file linalg.h.
References spams::Vector< T >::_externAlloc, spams::Vector< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::clear(), and spams::Vector< T >::n().
Referenced by spams::FISTA::GroupProx< T, Reg >::eval(), spams::FISTA::GroupProx< T, Reg >::fenchel(), spams::FISTA::GroupProx< T, Reg >::prox(), spams::SpVector< T >::refIndices(), and spams::SpVector< T >::refVal().
|
inline |
Set all values to zero.
Modifiers Set all values to zero
Definition at line 2871 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::Matrix< T >::center_rows(), spams::SpMatrix< T >::copyRow(), spams::coreLARS(), spams::coreLARS2(), spams::coreLARS2W(), spams::coreSOMP(), spams::Vector< T >::fusedProjectHomotopy(), spams::SpMatrix< T >::getData(), spams::FISTA::MultiLogLoss< T >::grad(), spams::FISTA::SqLoss< T >::init_prim_var(), spams::FISTA::HingeLoss< T >::init_prim_var(), spams::MaxFlow< T >::init_split_variables_aux(), spams::ist_groupLasso(), spams::Vector< T >::l1project_weighted(), spams::lasso(), spams::lasso2(), spams::lasso_mask(), spams::lassoWeight(), spams::lassoWeightPreComputed(), spams::Matrix< T >::mult(), spams::SpMatrix< T >::mult(), spams::ShiftMatrix< T >::mult(), spams::DoubleRowMatrix< T >::mult(), spams::Matrix< T >::multTrans(), spams::SpMatrix< T >::multTrans(), spams::ShiftMatrix< T >::multTrans(), 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::FISTA::normL2< T >::prox(), spams::FISTA::Rank< T >::prox(), spams::FISTA::GraphLasso< T >::prox_split(), spams::Vector< T >::resize(), spams::Tree_Seq< T >::sub_grad(), spams::FISTA::None< T >::sub_grad(), spams::MaxFlow< T >::sub_gradient(), spams::Matrix< T >::sum_cols(), spams::SpMatrix< T >::sum_cols(), spams::SpVector< T >::toFull(), spams::Trainer< T >::train(), spams::Trainer< T >::trainOffline(), spams::FISTA::MultiLogLoss< T >::var_fenchel(), and spams::Matrix< T >::whiten().
|
inline |
puts in signs, the sign of each point in the vector
Definition at line 3351 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, and spams::Vector< T >::rawX().
|
inline |
replace each value by its exponential
Definition at line 3308 of file linalg.h.
References spams::Vector< T >::_X, spams::Vector< T >::add(), spams::Vector< T >::exp(), INFINITY, spams::Vector< T >::max(), spams::Vector< T >::maxval(), and spams::Vector< T >::sum().
Referenced by spams::FISTA::MultiLogLoss< T >::eval().
|
inline |
performs soft-thresholding of the vector
Definition at line 2925 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::Vector< T >::fusedProject(), spams::Vector< T >::fusedProjectHomotopy(), spams::Vector< T >::l1l2project(), spams::Vector< T >::l1l2projectb(), spams::Vector< T >::l1project(), spams::FISTA::Lasso< T >::prox(), spams::FISTA::TraceNorm< T >::prox(), spams::Matrix< T >::softThrshold(), and spams::Vector< T >::sparseProject().
|
inline |
sort the vector
projects the vector onto the l1 ball of radius thrs, sort the vector
Definition at line 3899 of file linalg.h.
References spams::Vector< T >::copy(), and spams::Vector< T >::sort().
Referenced by spams::Vector< T >::sort().
|
inline |
sort the vector
Definition at line 3888 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, decr, and incr.
|
inline |
Definition at line 3911 of file linalg.h.
References spams::Vector< T >::copy(), and spams::Vector< T >::sort2().
Referenced by spams::Vector< T >::l1project_weighted(), and spams::Vector< T >::sort2().
|
inline |
sort the vector
Definition at line 3905 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, spams::quick_sort(), and spams::Vector< T >::rawX().
|
inline |
min_u ||b-u||_2^2 / ||u||_1 <= thrs
min_u ||b-u||_2^2 / ||u||_2^2 + lambda1||u||_1 <= thrs
min_u ||b-u||_2^2 / ||u||_1 + (lambda1/2) ||u||_2^2 <= thrs
min_u 0.5||b-u||_2^2 + lambda1||u||_1 / ||u||_2^2 <= thrs
min_u 0.5||b-u||_2^2 + lambda1||u||_1 +lambda2 Fused(u) / ||u||_2^2 <= thrs
min_u 0.5||b-u||_2^2 + lambda1||u||_1 +lambda2 Fused(u) +0.5lambda_3 ||u||_2^2
min_u ||b-u||_2^2 / lambda1||u||_1 +lambda2 Fused(u) + 0.5lambda3||u||_2^2 <= thrs
min_u ||b-u||_2^2 / (1-lambda1)*||u||_2^2 + lambda1||u||_1 <= thrs
Definition at line 3508 of file linalg.h.
References spams::Vector< T >::copy(), spams::Vector< T >::fusedProjectHomotopy(), spams::Vector< T >::l1l2project(), spams::Vector< T >::l1project(), spams::Vector< T >::normalize2(), spams::Vector< T >::nrm2sq(), spams::Vector< T >::scal(), spams::Vector< T >::softThrshold(), and spams::Vector< T >::thrsPos().
Referenced by spams::Trainer< T >::cleanDict(), spams::FISTA::LassoConstraint< T >::prox(), spams::Matrix< T >::sparseProject(), spams::Trainer< T >::train(), and spams::Trainer< T >::trainOffline().
|
inline |
A <- x .^ 2.
Definition at line 3077 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, and spams::Vector< T >::resize().
Referenced by spams::coreORMP(), and spams::coreSOMP().
|
inline |
A <- 1 ./ sqrt(x)
A <- x .^ 2.
Definition at line 3088 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, and spams::Vector< T >::resize().
Referenced by spams::Matrix< T >::singularValues(), and spams::Matrix< T >::svd().
|
inline |
A <- 1 ./ sqrt(x)
A <- x .^ 2.
Definition at line 3097 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
|
inline |
whiten
return the std
Definition at line 3265 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, utl::E, and spams::Vector< T >::mean().
|
inline |
A <- A - x.
Definition at line 3052 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::ShiftMatrix< T >::copyRow(), spams::coreORMP(), spams::coreSOMP(), spams::Vector< T >::fusedProjectHomotopy(), spams::FISTA::SqLoss< T >::test_backtracking(), and spams::Trainer< T >::trainOffline().
|
inline |
A <- A + a*x.
Definition at line 3058 of file linalg.h.
References spams::SpVector< T >::_L, spams::SpVector< T >::_r, spams::SpVector< T >::_v, and spams::Vector< T >::_X.
|
inline |
returns the sum of the vector
Definition at line 3344 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::Vector< T >::afused(), spams::Matrix< T >::center(), spams::coreGroupISTConstrained(), spams::Vector< T >::dot(), spams::FISTA::TraceNorm< T >::eval(), spams::Vector< T >::fusedProject(), spams::Vector< T >::fusedProjectHomotopy(), spams::FISTA::MultiLogLoss< T >::grad(), spams::Vector< T >::KL(), spams::Vector< T >::l1l2project(), spams::Vector< T >::l1project(), spams::Vector< T >::mean(), spams::ShiftMatrix< T >::multTrans(), spams::Vector< T >::nnz(), spams::Vector< T >::softmax(), and spams::FISTA::MultiLogLoss< T >::var_fenchel().
|
inline |
performs thresholding of the vector
Definition at line 2960 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, MAX, and MIN.
Referenced by spams::FISTA::GraphLasso< T >::prox_split().
|
inline |
performs soft-thresholding of the vector
performs thresholding of the vector
Definition at line 2967 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
|
inline |
performs soft-thresholding of the vector
performs thresholding of the vector
Definition at line 2948 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, and MAX.
Referenced by spams::Matrix< T >::thrsmax().
|
inline |
performs thresholding of the vector
Definition at line 2954 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, and MIN.
Referenced by spams::Matrix< T >::thrsmin().
|
inline |
performs soft-thresholding of the vector
Definition at line 2973 of file linalg.h.
References spams::Vector< T >::_n, and spams::Vector< T >::_X.
Referenced by spams::Trainer< T >::cleanDict(), spams::FISTA::Lasso< T >::fenchel(), spams::FISTA::Ridge< T >::fenchel(), spams::FISTA::normL2< T >::fenchel(), spams::FISTA::normLINF< T >::fenchel(), spams::FISTA::GraphLasso< T >::fenchel(), spams::FISTA::TreeLasso< T >::fenchel(), spams::FISTA::GraphPathConv< T >::fenchel(), spams::Vector< T >::l1l2project(), spams::Vector< T >::l1l2projectb(), spams::Vector< T >::l1project(), spams::FISTA::Lasso< T >::prox(), spams::FISTA::Lzero< T >::prox(), spams::FISTA::Ridge< T >::prox(), spams::FISTA::normL2< T >::prox(), spams::FISTA::normLINF< T >::prox(), spams::FISTA::GraphLasso< T >::prox(), spams::FISTA::TreeLasso< T >::prox(), spams::FISTA::TreeLzero< T >::prox(), spams::FISTA::GraphPathL0< T >::prox(), spams::FISTA::GraphPathConv< T >::prox(), spams::Matrix< T >::singularValues(), spams::Vector< T >::sparseProject(), spams::Matrix< T >::svd(), spams::Matrix< T >::thrsPos(), spams::Trainer< T >::train(), and spams::Trainer< T >::trainOffline().
|
inline |
make a sparse copy
Conversion make a sparse copy
Definition at line 4025 of file linalg.h.
References spams::SpVector< T >::_L, spams::Vector< T >::_n, spams::SpVector< T >::_r, spams::SpVector< T >::_v, and spams::Vector< T >::_X.
Referenced by spams::computeError(), spams::FISTA::SqLossMissing< T >::eval(), spams::FISTA::SqLoss< T >::eval(), spams::FISTA::HingeLoss< T >::eval(), spams::FISTA::LogLoss< T, weighted >::eval(), spams::FISTA::SqLossMissing< T >::grad(), spams::FISTA::SqLoss< T >::grad(), spams::FISTA::LogLoss< T, weighted >::grad(), spams::ist(), spams::ShiftMatrix< T >::mult(), spams::FISTA::SqLoss< T >::test_backtracking(), spams::Trainer< T >::trainOffline(), spams::FISTA::SqLossMissing< T >::var_fenchel(), spams::FISTA::SqLoss< T >::var_fenchel(), and spams::FISTA::LogLoss< T, weighted >::var_fenchel().
|
inline |
whiten
unwhiten
Definition at line 3233 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::mean(), and spams::Vector< T >::n().
|
inline |
whiten
Definition at line 3134 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, spams::Vector< T >::mean(), and spams::Vector< T >::n().
Referenced by spams::FISTA::SqLossMissing< T >::var_fenchel(), and spams::FISTA::SqLoss< T >::var_fenchel().
|
inline |
whiten
Definition at line 3179 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, utl::cblas_asum(), spams::Vector< T >::mean(), and spams::Vector< T >::n().
|
inline |
whiten
Definition at line 3198 of file linalg.h.
References spams::Vector< T >::_n, spams::Vector< T >::_X, and spams::Vector< T >::mean().
|
private |
if the data has been externally allocated
Definition at line 752 of file linalg.h.
Referenced by spams::Vector< T >::clear(), spams::Matrix< T >::refCol(), spams::Vector< T >::resize(), spams::Vector< T >::setPointer(), and spams::Matrix< T >::toVect().
|
private |
size of the vector
Definition at line 756 of file linalg.h.
Referenced by spams::Vector< T >::add(), spams::Vector< T >::afused(), spams::Vector< T >::allfalse(), spams::Vector< T >::alltrue(), spams::Vector< T >::applyBayerPattern(), spams::Vector< T >::asum(), spams::Vector< T >::clear(), spams::Vector< T >::copy(), spams::Matrix< T >::copyMask(), spams::Vector< T >::copyMask(), spams::Vector< T >::div(), spams::Vector< T >::dot(), spams::Vector< T >::exp(), spams::Vector< T >::fmax(), spams::Vector< T >::fmin(), spams::Vector< T >::fusedProjectHomotopy(), spams::Vector< T >::hardThrshold(), spams::Vector< T >::inv(), spams::Vector< T >::Invsqrt(), spams::Vector< T >::KL(), spams::Vector< T >::l1l2project(), spams::Vector< T >::l1project(), spams::Vector< T >::l1project_weighted(), spams::Vector< T >::logexp(), spams::Vector< T >::logspace(), spams::Vector< T >::lzero(), spams::Vector< T >::max(), spams::Vector< T >::mean(), spams::Vector< T >::min(), spams::Vector< T >::mult(), spams::Vector< T >::neg(), spams::Vector< T >::nnz(), spams::Vector< T >::nrm2(), spams::Vector< T >::nrm2sq(), spams::Vector< T >::operator[](), spams::Vector< T >::print(), spams::Vector< T >::project_sft(), spams::Vector< T >::project_sft_binary(), spams::Matrix< T >::rank1Update(), spams::Matrix< T >::refCol(), spams::Vector< T >::resize(), spams::Vector< T >::scal(), spams::Vector< T >::set(), spams::Vector< T >::setPointer(), spams::Vector< T >::setZeros(), spams::Vector< T >::sign(), spams::Vector< T >::softThrshold(), spams::Vector< T >::sort(), spams::Vector< T >::sort2(), spams::Vector< T >::sqr(), spams::Vector< T >::Sqrt(), spams::Vector< T >::std(), spams::Vector< T >::sub(), spams::Vector< T >::sum(), spams::Vector< T >::thrsabsmin(), spams::Vector< T >::thrshold(), spams::Vector< T >::thrsmax(), spams::Vector< T >::thrsmin(), spams::Vector< T >::thrsPos(), spams::Vector< T >::toSparse(), spams::Matrix< T >::toVect(), spams::Vector< T >::unwhiten(), spams::Vector< T >::Vector(), and spams::Vector< T >::whiten().
|
private |
data
Definition at line 754 of file linalg.h.
Referenced by spams::Vector< T >::add(), spams::Vector< T >::afused(), spams::Vector< T >::allfalse(), spams::Vector< T >::alltrue(), spams::Vector< T >::applyBayerPattern(), spams::Vector< T >::asum(), spams::Vector< T >::clear(), spams::Vector< T >::copy(), spams::Matrix< T >::copyCol(), spams::Matrix< T >::copyMask(), spams::Vector< T >::copyMask(), spams::Matrix< T >::copyRow(), spams::Vector< T >::div(), spams::Vector< T >::dot(), spams::Vector< T >::exp(), spams::Vector< T >::fmax(), spams::Vector< T >::fmaxval(), spams::Vector< T >::fmin(), spams::Vector< T >::fminval(), spams::Vector< T >::fusedProject(), spams::Vector< T >::fusedProjectHomotopy(), spams::Vector< T >::hardThrshold(), spams::Vector< T >::inv(), spams::Vector< T >::Invsqrt(), spams::Vector< T >::KL(), spams::Vector< T >::l1l2project(), spams::Vector< T >::l1project(), spams::Vector< T >::l1project_weighted(), spams::Vector< T >::log(), spams::Vector< T >::logexp(), spams::Vector< T >::logspace(), spams::Vector< T >::lzero(), spams::Vector< T >::max(), spams::Vector< T >::maxval(), spams::Vector< T >::min(), spams::Vector< T >::minval(), spams::Matrix< T >::mult(), spams::Vector< T >::mult(), spams::Matrix< T >::multTrans(), spams::Vector< T >::neg(), spams::Vector< T >::nnz(), spams::Vector< T >::nrm2(), spams::Vector< T >::nrm2sq(), spams::Vector< T >::operator[](), spams::Vector< T >::print(), spams::Vector< T >::project_sft(), spams::Vector< T >::project_sft_binary(), spams::Vector< T >::randperm(), spams::Matrix< T >::rank1Update(), spams::Matrix< T >::refCol(), spams::Vector< T >::resize(), spams::Vector< T >::scal(), spams::Vector< T >::set(), spams::Vector< T >::setPointer(), spams::Vector< T >::setZeros(), spams::Vector< T >::sign(), spams::Vector< T >::softmax(), spams::Vector< T >::softThrshold(), spams::Vector< T >::sort(), spams::Vector< T >::sort2(), spams::Vector< T >::sqr(), spams::Vector< T >::Sqrt(), spams::Vector< T >::std(), spams::Vector< T >::sub(), spams::Vector< T >::sum(), spams::Vector< T >::thrsabsmin(), spams::Vector< T >::thrshold(), spams::Vector< T >::thrsmax(), spams::Vector< T >::thrsmin(), spams::Vector< T >::thrsPos(), spams::Vector< T >::toSparse(), spams::Matrix< T >::toVect(), spams::Vector< T >::unwhiten(), spams::Vector< T >::Vector(), spams::SpMatrix< T >::wAAt(), spams::Matrix< T >::whiten(), spams::Vector< T >::whiten(), and spams::SpMatrix< T >::wXAt().