DMRITool  v0.1.1-139-g860d86b4
Diffusion MRI Tool
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
itk::SpamsWeightedLassoSolver< TPrecision > Class Template Reference

#include <itkSpamsWeightedLassoSolver.h>

+ Inheritance diagram for itk::SpamsWeightedLassoSolver< TPrecision >:
+ Collaboration diagram for itk::SpamsWeightedLassoSolver< TPrecision >:

Detailed Description

template<class TPrecision>
class itk::SpamsWeightedLassoSolver< TPrecision >

solve weighted LASSO using spams

For all columns b of B, and w of W, it computes one column x of X which is the solution of

0) when mode=0 1) when mode=1 2) when mode=2 (default)

\[ \min_{x} \|Ax-b\|^2 + lambda* w^T abs(x) \]

where A is a matrix, w is a vector, b, x are vectors, and lambda is a scalar value.

Author
Jian Cheng (JC), jian..nosp@m.chen.nosp@m.g.198.nosp@m.3@gm.nosp@m.ail.c.nosp@m.om

Definition at line 49 of file itkSpamsWeightedLassoSolver.h.

Public Types

enum  ConstraintType {
  L1CONS =0,
  L2CONS,
  PENALTY
}
 
typedef Superclass::MatrixPointer MatrixPointer
 
typedef Superclass::MatrixType MatrixType
 
typedef SmartPointer< SelfPointer
 
typedef SpamsWeightedLassoSolver Self
 
typedef utl_shared_ptr< spams::Matrix< double > > SpamsMatrixPointer
 
typedef spams::Matrix< double > SpamsMatrixType
 
typedef utl_shared_ptr< spams::SpMatrix< double > > SpamsSpMatrixPointer
 
typedef spams::SpMatrix< double > SpamsSpMatrixType
 
typedef utl_shared_ptr< spams::Vector< double > > SpamsVectorPointer
 
typedef spams::Vector< double > SpamsVectorType
 
typedef SolverBase< TPrecision > Superclass
 
typedef Superclass::ValueType ValueType
 
typedef Superclass::VectorPointer VectorPointer
 
typedef Superclass::VectorType VectorType
 
- Public Types inherited from itk::SolverBase< TPrecision >
typedef utl_shared_ptr< MatrixTypeMatrixPointer
 
typedef utl::NDArray< ValueType, 2 > MatrixType
 
typedef SmartPointer< SelfPointer
 
typedef SolverBase Self
 
typedef Object Superclass
 
typedef utl_shared_ptr< std::vector< ValueType > > ValueContainerPointer
 
typedef std::vector< ValueTypeValueContainerType
 
typedef TPrecision ValueType
 
typedef utl_shared_ptr< VectorTypeVectorPointer
 
typedef utl::NDArray< ValueType, 1 > VectorType
 

Public Member Functions

void Clear () ITK_OVERRIDE
 
void ClearA ()
 
void ClearB ()
 
void ClearW ()
 
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
ValueType EvaluateCostFunction (const MatrixType &x=MatrixType()) const ITK_OVERRIDE
 
ValueType EvaluateCostFunctionInColumn (const VectorType &x, const int col) const
 
virtual MatrixPointer GetA ()
 
virtual MatrixPointer GetB ()
 
virtual ConstraintType GetConstraintType ()
 
virtual double GetLambda ()
 
virtual const char * GetNameOfClass () const
 
virtual int GetNumberOfThreads ()
 
virtual bool GetPositive ()
 
virtual MatrixPointer GetW ()
 
virtual MatrixPointer GetX ()
 
int GetXDimension () const ITK_OVERRIDE
 
int GetXNumber () const
 
virtual void PositiveOff ()
 
virtual void PositiveOn ()
 
void SetA (const MatrixPointer &mat)
 
void SetB (const MatrixPointer &B)
 
void Setb (const VectorPointer &b)
 
virtual void SetConstraintType (ConstraintType _arg)
 
virtual void SetLambda (double _arg)
 
virtual void SetNumberOfThreads (int _arg)
 
virtual void SetPositive (bool _arg)
 
void SetW (const MatrixPointer &W)
 
void Setw (const VectorPointer &w)
 
void Solve (const VectorType &xInitial=VectorType()) ITK_OVERRIDE
 
void VerifyInputs () const ITK_OVERRIDE
 
- Public Member Functions inherited from itk::SolverBase< TPrecision >
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual void EndSolve ()
 
virtual ValueType EvaluateCostFunction (const VectorType &x=VectorType()) const
 
virtual VectorType EvaluateGradientOfCostFunction (const VectorType &x) const
 
virtual const VectorTypeGetx ()
 
virtual void Initialize (const VectorType &xInitial=VectorType())
 
virtual void Solve (const MatrixType &xInitial=MatrixType())
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::SolverBase< TPrecision >
static Pointer New ()
 

Protected Member Functions

virtual LightObject::Pointer InternalClone () const ITK_OVERRIDE
 
void PrintSelf (std::ostream &os, Indent indent) const ITK_OVERRIDE
 
 SpamsWeightedLassoSolver ()
 
virtual ~SpamsWeightedLassoSolver ()
 
- Protected Member Functions inherited from itk::SolverBase< TPrecision >
void PrintSelf (std::ostream &os, Indent indent) const ITK_OVERRIDE
 
 SolverBase ()
 
virtual ~SolverBase ()
 

Protected Attributes

MatrixPointer m_A
 
SpamsMatrixPointer m_As
 
MatrixPointer m_B
 
SpamsMatrixPointer m_Bs
 
ConstraintType m_ConstraintType
 
double m_Lambda
 
int m_NumberOfThreads
 
bool m_Positive
 
MatrixPointer m_W
 
SpamsMatrixPointer m_Ws
 
MatrixPointer m_X
 
SpamsSpMatrixPointer m_Xs
 
- Protected Attributes inherited from itk::SolverBase< TPrecision >
VectorType m_x
 

Private Member Functions

void operator= (const Self &)
 
 SpamsWeightedLassoSolver (const Self &)
 

Member Typedef Documentation

template<class TPrecision>
typedef Superclass::MatrixPointer itk::SpamsWeightedLassoSolver< TPrecision >::MatrixPointer

Definition at line 68 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
typedef Superclass::MatrixType itk::SpamsWeightedLassoSolver< TPrecision >::MatrixType

Definition at line 66 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
typedef SmartPointer<Self> itk::SpamsWeightedLassoSolver< TPrecision >::Pointer

Definition at line 57 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
typedef SpamsWeightedLassoSolver itk::SpamsWeightedLassoSolver< TPrecision >::Self

Standard class typedefs.

Definition at line 55 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
typedef utl_shared_ptr<spams::Matrix<double> > itk::SpamsWeightedLassoSolver< TPrecision >::SpamsMatrixPointer

Definition at line 74 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
typedef spams::Matrix<double> itk::SpamsWeightedLassoSolver< TPrecision >::SpamsMatrixType

Definition at line 71 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
typedef utl_shared_ptr<spams::SpMatrix<double> > itk::SpamsWeightedLassoSolver< TPrecision >::SpamsSpMatrixPointer

Definition at line 75 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
typedef spams::SpMatrix<double> itk::SpamsWeightedLassoSolver< TPrecision >::SpamsSpMatrixType

Definition at line 72 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
typedef utl_shared_ptr<spams::Vector<double> > itk::SpamsWeightedLassoSolver< TPrecision >::SpamsVectorPointer

Definition at line 76 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
typedef spams::Vector<double> itk::SpamsWeightedLassoSolver< TPrecision >::SpamsVectorType

Definition at line 73 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
typedef SolverBase<TPrecision> itk::SpamsWeightedLassoSolver< TPrecision >::Superclass

Definition at line 56 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
typedef Superclass::ValueType itk::SpamsWeightedLassoSolver< TPrecision >::ValueType

Definition at line 63 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
typedef Superclass::VectorPointer itk::SpamsWeightedLassoSolver< TPrecision >::VectorPointer

Definition at line 69 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
typedef Superclass::VectorType itk::SpamsWeightedLassoSolver< TPrecision >::VectorType

Definition at line 67 of file itkSpamsWeightedLassoSolver.h.

Member Enumeration Documentation

template<class TPrecision>
enum itk::SpamsWeightedLassoSolver::ConstraintType
Enumerator
L1CONS 
L2CONS 
PENALTY 

Definition at line 78 of file itkSpamsWeightedLassoSolver.h.

Constructor & Destructor Documentation

template<class TPrecision >
itk::SpamsWeightedLassoSolver< TPrecision >::SpamsWeightedLassoSolver ( )
protected

Definition at line 32 of file itkSpamsWeightedLassoSolver.hxx.

References spams::PENALTY, and itk::SpamsWeightedLassoSolver< TPrecision >::SetA().

+ Here is the call graph for this function:

template<class TPrecision>
virtual itk::SpamsWeightedLassoSolver< TPrecision >::~SpamsWeightedLassoSolver ( )
inlineprotectedvirtual

Definition at line 154 of file itkSpamsWeightedLassoSolver.h.

References ITK_OVERRIDE.

template<class TPrecision>
itk::SpamsWeightedLassoSolver< TPrecision >::SpamsWeightedLassoSolver ( const Self )
private

Member Function Documentation

template<class TPrecision>
void itk::SpamsWeightedLassoSolver< TPrecision >::Clear ( )
inlinevirtual

Reimplemented from itk::SolverBase< TPrecision >.

Definition at line 123 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
void itk::SpamsWeightedLassoSolver< TPrecision >::ClearA ( )
inline

Definition at line 130 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
void itk::SpamsWeightedLassoSolver< TPrecision >::ClearB ( )
inline

Definition at line 138 of file itkSpamsWeightedLassoSolver.h.

References ITK_OVERRIDE.

template<class TPrecision>
void itk::SpamsWeightedLassoSolver< TPrecision >::ClearW ( )
inline

Definition at line 134 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
virtual::itk::LightObject::Pointer itk::SpamsWeightedLassoSolver< TPrecision >::CreateAnother ( void  ) const
template<class TPrecision >
SpamsWeightedLassoSolver< TPrecision >::ValueType itk::SpamsWeightedLassoSolver< TPrecision >::EvaluateCostFunction ( const MatrixType x = MatrixType()) const
virtual

Reimplemented from itk::SolverBase< TPrecision >.

Definition at line 235 of file itkSpamsWeightedLassoSolver.hxx.

References itk::SpamsWeightedLassoSolver< TPrecision >::PrintSelf(), and utl::NDArrayBase< T, Dim >::Size().

Referenced by itk::SpamsWeightedLassoSolver< TPrecision >::EvaluateCostFunctionInColumn().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class TPrecision >
SpamsWeightedLassoSolver< TPrecision >::ValueType itk::SpamsWeightedLassoSolver< TPrecision >::EvaluateCostFunctionInColumn ( const VectorType x,
const int  col 
) const
template<class TPrecision>
virtual MatrixPointer itk::SpamsWeightedLassoSolver< TPrecision >::GetA ( )
virtual
template<class TPrecision>
virtual MatrixPointer itk::SpamsWeightedLassoSolver< TPrecision >::GetB ( )
virtual
template<class TPrecision>
virtual ConstraintType itk::SpamsWeightedLassoSolver< TPrecision >::GetConstraintType ( )
virtual
template<class TPrecision>
virtual double itk::SpamsWeightedLassoSolver< TPrecision >::GetLambda ( )
virtual
template<class TPrecision>
virtual const char* itk::SpamsWeightedLassoSolver< TPrecision >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::SolverBase< TPrecision >.

template<class TPrecision>
virtual int itk::SpamsWeightedLassoSolver< TPrecision >::GetNumberOfThreads ( )
virtual
template<class TPrecision>
virtual bool itk::SpamsWeightedLassoSolver< TPrecision >::GetPositive ( )
virtual
template<class TPrecision>
virtual MatrixPointer itk::SpamsWeightedLassoSolver< TPrecision >::GetW ( )
virtual
template<class TPrecision>
virtual MatrixPointer itk::SpamsWeightedLassoSolver< TPrecision >::GetX ( )
virtual
template<class TPrecision>
int itk::SpamsWeightedLassoSolver< TPrecision >::GetXDimension ( ) const
inlinevirtual

Reimplemented from itk::SolverBase< TPrecision >.

Definition at line 110 of file itkSpamsWeightedLassoSolver.h.

References utlException.

template<class TPrecision>
int itk::SpamsWeightedLassoSolver< TPrecision >::GetXNumber ( ) const
inline

Definition at line 116 of file itkSpamsWeightedLassoSolver.h.

References utlException.

template<class TPrecision >
LightObject::Pointer itk::SpamsWeightedLassoSolver< TPrecision >::InternalClone ( ) const
protectedvirtual

Reimplemented from itk::SolverBase< TPrecision >.

Definition at line 144 of file itkSpamsWeightedLassoSolver.hxx.

References itk::SpamsWeightedLassoSolver< TPrecision >::Solve().

Referenced by itk::SpamsWeightedLassoSolver< TPrecision >::VerifyInputs().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class TPrecision>
static Pointer itk::SpamsWeightedLassoSolver< TPrecision >::New ( )
static

Method for creation through the object factory.

template<class TPrecision>
void itk::SpamsWeightedLassoSolver< TPrecision >::operator= ( const Self )
private
template<class TPrecision>
virtual void itk::SpamsWeightedLassoSolver< TPrecision >::PositiveOff ( )
virtual
template<class TPrecision>
virtual void itk::SpamsWeightedLassoSolver< TPrecision >::PositiveOn ( )
virtual
template<class TPrecision >
void itk::SpamsWeightedLassoSolver< TPrecision >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
protected

Definition at line 252 of file itkSpamsWeightedLassoSolver.hxx.

References utl::PrintUtlMatrix(), and PrintVar3.

Referenced by itk::SpamsWeightedLassoSolver< TPrecision >::EvaluateCostFunction().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class TPrecision >
void itk::SpamsWeightedLassoSolver< TPrecision >::SetA ( const MatrixPointer mat)

Definition at line 51 of file itkSpamsWeightedLassoSolver.hxx.

References itk::SpamsWeightedLassoSolver< TPrecision >::SetB(), and spams::UtlMatrixToMatrix().

Referenced by itk::SpamsWeightedLassoSolver< TPrecision >::SpamsWeightedLassoSolver().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class TPrecision >
void itk::SpamsWeightedLassoSolver< TPrecision >::SetB ( const MatrixPointer B)

Definition at line 66 of file itkSpamsWeightedLassoSolver.hxx.

References itk::SpamsWeightedLassoSolver< TPrecision >::Setb(), and spams::UtlMatrixToMatrix().

Referenced by itk::SpamsWeightedLassoSolver< TPrecision >::SetA().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class TPrecision >
void itk::SpamsWeightedLassoSolver< TPrecision >::Setb ( const VectorPointer b)

Definition at line 81 of file itkSpamsWeightedLassoSolver.hxx.

References itk::SpamsWeightedLassoSolver< TPrecision >::SetW(), and spams::UtlMatrixToMatrix().

Referenced by itk::SpamsWeightedLassoSolver< TPrecision >::SetB().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class TPrecision>
virtual void itk::SpamsWeightedLassoSolver< TPrecision >::SetConstraintType ( ConstraintType  _arg)
virtual
template<class TPrecision>
virtual void itk::SpamsWeightedLassoSolver< TPrecision >::SetLambda ( double  _arg)
virtual
template<class TPrecision>
virtual void itk::SpamsWeightedLassoSolver< TPrecision >::SetNumberOfThreads ( int  _arg)
virtual
template<class TPrecision>
virtual void itk::SpamsWeightedLassoSolver< TPrecision >::SetPositive ( bool  _arg)
virtual
template<class TPrecision >
void itk::SpamsWeightedLassoSolver< TPrecision >::SetW ( const MatrixPointer W)

Definition at line 98 of file itkSpamsWeightedLassoSolver.hxx.

References itk::SpamsWeightedLassoSolver< TPrecision >::Setw(), and spams::UtlMatrixToMatrix().

Referenced by itk::SpamsWeightedLassoSolver< TPrecision >::Setb().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class TPrecision >
void itk::SpamsWeightedLassoSolver< TPrecision >::Setw ( const VectorPointer w)

Definition at line 113 of file itkSpamsWeightedLassoSolver.hxx.

References spams::UtlMatrixToMatrix(), and itk::SpamsWeightedLassoSolver< TPrecision >::VerifyInputs().

Referenced by itk::SpamsWeightedLassoSolver< TPrecision >::SetW().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class TPrecision >
void itk::SpamsWeightedLassoSolver< TPrecision >::Solve ( const VectorType xInitial = VectorType())
virtual
template<class TPrecision >
void itk::SpamsWeightedLassoSolver< TPrecision >::VerifyInputs ( ) const
virtual

Reimplemented from itk::SolverBase< TPrecision >.

Definition at line 131 of file itkSpamsWeightedLassoSolver.hxx.

References itk::SpamsWeightedLassoSolver< TPrecision >::InternalClone(), and utlException.

Referenced by itk::SpamsWeightedLassoSolver< TPrecision >::Setw().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

template<class TPrecision>
MatrixPointer itk::SpamsWeightedLassoSolver< TPrecision >::m_A
protected

MxN matrix

Definition at line 161 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
SpamsMatrixPointer itk::SpamsWeightedLassoSolver< TPrecision >::m_As
protected

Definition at line 166 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
MatrixPointer itk::SpamsWeightedLassoSolver< TPrecision >::m_B
protected

Definition at line 162 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
SpamsMatrixPointer itk::SpamsWeightedLassoSolver< TPrecision >::m_Bs
protected

Definition at line 167 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
ConstraintType itk::SpamsWeightedLassoSolver< TPrecision >::m_ConstraintType
protected

Definition at line 172 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
double itk::SpamsWeightedLassoSolver< TPrecision >::m_Lambda
protected

Definition at line 176 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
int itk::SpamsWeightedLassoSolver< TPrecision >::m_NumberOfThreads
protected

Definition at line 177 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
bool itk::SpamsWeightedLassoSolver< TPrecision >::m_Positive
protected

Definition at line 174 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
MatrixPointer itk::SpamsWeightedLassoSolver< TPrecision >::m_W
protected

Definition at line 163 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
SpamsMatrixPointer itk::SpamsWeightedLassoSolver< TPrecision >::m_Ws
protected

Definition at line 168 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
MatrixPointer itk::SpamsWeightedLassoSolver< TPrecision >::m_X
protected

Definition at line 164 of file itkSpamsWeightedLassoSolver.h.

template<class TPrecision>
SpamsSpMatrixPointer itk::SpamsWeightedLassoSolver< TPrecision >::m_Xs
protected

Definition at line 170 of file itkSpamsWeightedLassoSolver.h.


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