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 | Private Attributes | List of all members
itk::L2RegularizedLeastSquaresSolver< TPrecision > Class Template Reference

#include <itkL2RegularizedLeastSquaresSolver.h>

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

Detailed Description

template<class TPrecision>
class itk::L2RegularizedLeastSquaresSolver< TPrecision >

solve least square problem with L2 regularization

The least square with L2 regularization is

\[ \min_{x} \|Ax-b\|^2 + x^T \Lambda x \]

where A, are matrices, b, x are vectors.

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 43 of file itkL2RegularizedLeastSquaresSolver.h.

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef Superclass::MatrixPointer MatrixPointer
 
typedef Superclass::MatrixType MatrixType
 
typedef SmartPointer< SelfPointer
 
typedef L2RegularizedLeastSquaresSolver Self
 
typedef SolverBase< TPrecision > Superclass
 
typedef Superclass::ValueContainerType ValueContainerType
 
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 ClearLambda ()
 
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
ValueType EvaluateCostFunction (const VectorType &x=VectorType()) const ITK_OVERRIDE
 
virtual MatrixPointer GetA ()
 
virtual VectorPointer Getb ()
 
virtual ValueType GetConditionNumber ()
 
virtual MatrixPointer GetLambda ()
 
virtual MatrixPointer GetLS ()
 
virtual const char * GetNameOfClass () const
 
int GetXDimension () const ITK_OVERRIDE
 
void Initialize (const VectorType &xInitial=VectorType()) ITK_OVERRIDE
 
void SetA (const MatrixPointer &mat)
 
virtual void Setb (VectorPointer _arg)
 
void SetLambda (const MatrixPointer &mat)
 
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 MatrixType &x=MatrixType()) const
 
virtual VectorType EvaluateGradientOfCostFunction (const VectorType &x) const
 
virtual const VectorTypeGetx ()
 
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
 
 L2RegularizedLeastSquaresSolver ()
 
void PrintSelf (std::ostream &os, Indent indent) const ITK_OVERRIDE
 
virtual ~L2RegularizedLeastSquaresSolver ()
 
- 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
 
VectorPointer m_b
 
bool m_IsLambdaSymmetric
 
MatrixPointer m_Lambda
 
- Protected Attributes inherited from itk::SolverBase< TPrecision >
VectorType m_x
 

Private Member Functions

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

Private Attributes

ValueType m_ConditionNumber
 
MatrixPointer m_LS
 

Member Typedef Documentation

template<class TPrecision>
typedef SmartPointer<const Self> itk::L2RegularizedLeastSquaresSolver< TPrecision >::ConstPointer

Definition at line 50 of file itkL2RegularizedLeastSquaresSolver.h.

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

Definition at line 61 of file itkL2RegularizedLeastSquaresSolver.h.

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

Definition at line 59 of file itkL2RegularizedLeastSquaresSolver.h.

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

Definition at line 49 of file itkL2RegularizedLeastSquaresSolver.h.

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

Standard class typedefs.

Definition at line 47 of file itkL2RegularizedLeastSquaresSolver.h.

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

Definition at line 48 of file itkL2RegularizedLeastSquaresSolver.h.

Definition at line 64 of file itkL2RegularizedLeastSquaresSolver.h.

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

Definition at line 56 of file itkL2RegularizedLeastSquaresSolver.h.

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

Definition at line 62 of file itkL2RegularizedLeastSquaresSolver.h.

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

Definition at line 60 of file itkL2RegularizedLeastSquaresSolver.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file itkL2RegularizedLeastSquaresSolver.hxx.

References itk::L2RegularizedLeastSquaresSolver< TPrecision >::SetA().

+ Here is the call graph for this function:

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

Definition at line 113 of file itkL2RegularizedLeastSquaresSolver.h.

References ITK_OVERRIDE.

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

Member Function Documentation

template<class TPrecision >
void itk::L2RegularizedLeastSquaresSolver< TPrecision >::Clear ( )
virtual

m_LS is released when releasing m_A and m_lambda

Reimplemented from itk::SolverBase< TPrecision >.

Definition at line 98 of file itkL2RegularizedLeastSquaresSolver.hxx.

References itk::L2RegularizedLeastSquaresSolver< TPrecision >::Initialize().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 86 of file itkL2RegularizedLeastSquaresSolver.h.

template<class TPrecision>
void itk::L2RegularizedLeastSquaresSolver< TPrecision >::Clearb ( )
inline

Definition at line 99 of file itkL2RegularizedLeastSquaresSolver.h.

References ITK_OVERRIDE.

template<class TPrecision>
void itk::L2RegularizedLeastSquaresSolver< TPrecision >::ClearLambda ( )
inline

Definition at line 92 of file itkL2RegularizedLeastSquaresSolver.h.

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

if x is not set, evaluate the cost function for m_x

Reimplemented from itk::SolverBase< TPrecision >.

Definition at line 145 of file itkL2RegularizedLeastSquaresSolver.hxx.

References utl::NDArrayBase< T, Dim >::InnerProduct(), itk::L2RegularizedLeastSquaresSolver< TPrecision >::InternalClone(), utl::ProductUtlMv(), utl::ProductUtlvM(), and utl::NDArrayBase< T, Dim >::Size().

Referenced by itk::L2RegularizedLeastSquaresSolver< TPrecision >::Solve().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class TPrecision>
virtual MatrixPointer itk::L2RegularizedLeastSquaresSolver< TPrecision >::GetA ( )
virtual
template<class TPrecision>
virtual VectorPointer itk::L2RegularizedLeastSquaresSolver< TPrecision >::Getb ( )
virtual
template<class TPrecision>
virtual ValueType itk::L2RegularizedLeastSquaresSolver< TPrecision >::GetConditionNumber ( )
virtual
template<class TPrecision>
virtual MatrixPointer itk::L2RegularizedLeastSquaresSolver< TPrecision >::GetLambda ( )
virtual
template<class TPrecision>
virtual MatrixPointer itk::L2RegularizedLeastSquaresSolver< TPrecision >::GetLS ( )
virtual
template<class TPrecision>
virtual const char* itk::L2RegularizedLeastSquaresSolver< TPrecision >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods)

Reimplemented from itk::SolverBase< TPrecision >.

template<class TPrecision>
int itk::L2RegularizedLeastSquaresSolver< TPrecision >::GetXDimension ( ) const
inlinevirtual

Reimplemented from itk::SolverBase< TPrecision >.

Definition at line 77 of file itkL2RegularizedLeastSquaresSolver.h.

References ITK_OVERRIDE, and utlException.

template<class TPrecision >
void itk::L2RegularizedLeastSquaresSolver< TPrecision >::Initialize ( const VectorType xInitial = VectorType())
virtual

m_LS is re-calcutated only if m_A or m_Lambda is re-set

Reimplemented from itk::SolverBase< TPrecision >.

Definition at line 110 of file itkL2RegularizedLeastSquaresSolver.hxx.

References utl::ProductUtlMMt(), utl::ProductUtlXtX(), and itk::L2RegularizedLeastSquaresSolver< TPrecision >::Solve().

Referenced by itk::L2RegularizedLeastSquaresSolver< TPrecision >::Clear().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from itk::SolverBase< TPrecision >.

Definition at line 162 of file itkL2RegularizedLeastSquaresSolver.hxx.

References itk::L2RegularizedLeastSquaresSolver< TPrecision >::PrintSelf().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Method for creation through the object factory.

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

Definition at line 182 of file itkL2RegularizedLeastSquaresSolver.hxx.

References utl::PrintUtlMatrix(), and utl::PrintUtlVector().

Referenced by itk::L2RegularizedLeastSquaresSolver< TPrecision >::InternalClone().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

m_LS is released when setting m_A and m_lambda

Definition at line 47 of file itkL2RegularizedLeastSquaresSolver.hxx.

References itk::L2RegularizedLeastSquaresSolver< TPrecision >::SetLambda().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class TPrecision>
virtual void itk::L2RegularizedLeastSquaresSolver< TPrecision >::Setb ( VectorPointer  _arg)
virtual
template<class TPrecision >
void itk::L2RegularizedLeastSquaresSolver< TPrecision >::SetLambda ( const MatrixPointer mat)

Definition at line 64 of file itkL2RegularizedLeastSquaresSolver.hxx.

References itk::L2RegularizedLeastSquaresSolver< TPrecision >::VerifyInputs().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from itk::SolverBase< TPrecision >.

Definition at line 135 of file itkL2RegularizedLeastSquaresSolver.hxx.

References itk::L2RegularizedLeastSquaresSolver< TPrecision >::EvaluateCostFunction(), and utl::ProductUtlMv().

Referenced by itk::L2RegularizedLeastSquaresSolver< TPrecision >::Initialize().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class TPrecision >
void itk::L2RegularizedLeastSquaresSolver< TPrecision >::VerifyInputs ( ) const
virtual

Reimplemented from itk::SolverBase< TPrecision >.

Definition at line 81 of file itkL2RegularizedLeastSquaresSolver.hxx.

References itk::L2RegularizedLeastSquaresSolver< TPrecision >::Clear(), and utlGlobalException.

Referenced by itk::L2RegularizedLeastSquaresSolver< TPrecision >::SetLambda().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

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

MxN matrix

Definition at line 120 of file itkL2RegularizedLeastSquaresSolver.h.

template<class TPrecision>
VectorPointer itk::L2RegularizedLeastSquaresSolver< TPrecision >::m_b
protected

Mx1 vector

Definition at line 122 of file itkL2RegularizedLeastSquaresSolver.h.

template<class TPrecision>
ValueType itk::L2RegularizedLeastSquaresSolver< TPrecision >::m_ConditionNumber
private

Definition at line 136 of file itkL2RegularizedLeastSquaresSolver.h.

template<class TPrecision>
bool itk::L2RegularizedLeastSquaresSolver< TPrecision >::m_IsLambdaSymmetric
protected

Definition at line 127 of file itkL2RegularizedLeastSquaresSolver.h.

template<class TPrecision>
MatrixPointer itk::L2RegularizedLeastSquaresSolver< TPrecision >::m_Lambda
protected

NxN matrix

Definition at line 125 of file itkL2RegularizedLeastSquaresSolver.h.

template<class TPrecision>
MatrixPointer itk::L2RegularizedLeastSquaresSolver< TPrecision >::m_LS
private

MxN matrix

Definition at line 135 of file itkL2RegularizedLeastSquaresSolver.h.


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