19 #ifndef __itkSpamsWeightedLassoSolver_h 20 #define __itkSpamsWeightedLassoSolver_h 48 template <
class TPrecision>
85 itkSetMacro(ConstraintType, ConstraintType);
86 itkGetMacro(ConstraintType, ConstraintType);
88 itkSetMacro(NumberOfThreads,
int);
89 itkGetMacro(NumberOfThreads,
int);
91 itkSetMacro(Lambda,
double);
92 itkGetMacro(Lambda,
double);
94 void SetA(
const MatrixPointer& mat);
95 itkGetMacro(A, MatrixPointer);
96 void SetW(
const MatrixPointer& W);
97 void Setw(
const VectorPointer& w);
98 itkGetMacro(W, MatrixPointer);
99 void SetB(
const MatrixPointer& B);
100 void Setb(
const VectorPointer& b);
101 itkGetMacro(B, MatrixPointer);
103 itkGetMacro(X, MatrixPointer);
105 itkSetMacro(Positive,
bool);
106 itkGetMacro(Positive,
bool);
107 itkBooleanMacro(Positive);
112 int N = m_A->Columns();
113 utlException(N==0,
"wrong size! m_A.Columns()="<<m_A->Columns());
118 int M = m_B->Columns();
119 utlException(M==0,
"wrong size! m_B.Columns()="<<m_B->Columns());
132 m_A=MatrixPointer(
new MatrixType()); m_As=SpamsMatrixPointer(
new SpamsMatrixType());
136 m_W=MatrixPointer(
new MatrixType()); m_Ws=SpamsMatrixPointer(
new SpamsMatrixType());
140 m_B=MatrixPointer(
new MatrixType()); m_Bs=SpamsMatrixPointer(
new SpamsMatrixType());
146 void Solve(
const VectorType& xInitial=VectorType())
ITK_OVERRIDE;
148 ValueType EvaluateCostFunctionInColumn(
const VectorType& x,
const int col)
const;
149 ValueType EvaluateCostFunction(
const MatrixType& x=MatrixType())
const ITK_OVERRIDE;
156 void PrintSelf(std::ostream& os, Indent indent)
const ITK_OVERRIDE;
158 virtual typename LightObject::Pointer InternalClone()
const ITK_OVERRIDE;
181 void operator=(
const Self&);
189 #define ITK_TEMPLATE_SpamsWeightedLassoSolver(_, EXPORT, TypeX, TypeY) \ 192 _( 1 ( class EXPORT SpamsWeightedLassoSolver< ITK_TEMPLATE_1 TypeX > ) ) \ 193 namespace Templates \ 195 typedef SpamsWeightedLassoSolver< ITK_TEMPLATE_1 TypeX > SpamsWeightedLassoSolver##TypeY; \ 199 #if ITK_TEMPLATE_EXPLICIT 200 #include "Templates/itkSpamsWeightedLassoSolver+-.h" 203 #if !defined(ITK_MANUAL_INSTANTIATION) && !defined(__itkSpamsWeightedLassoSolver_hxx) ConstraintType m_ConstraintType
SpamsSpMatrixPointer m_Xs
spams::Vector< double > SpamsVectorType
Superclass::VectorType VectorType
SolverBase< TPrecision > Superclass
#define utlException(cond, expout)
spams::Matrix< double > SpamsMatrixType
SmartPointer< Self > Pointer
Superclass::VectorPointer VectorPointer
Superclass::MatrixType MatrixType
Contains sparse decomposition algorithms It requires the toolbox linalg.
Superclass::ValueType ValueType
spams::SpMatrix< double > SpamsSpMatrixType
utl_shared_ptr< spams::Vector< double > > SpamsVectorPointer
utl_shared_ptr< MatrixType > MatrixPointer
solve weighted LASSO using spams
Superclass::MatrixPointer MatrixPointer
int GetXDimension() const ITK_OVERRIDE
SpamsWeightedLassoSolver Self
void Clear() ITK_OVERRIDE
virtual ~SpamsWeightedLassoSolver()
Base class for some optimization solvers using primal-dual updates.
utl_shared_ptr< spams::Matrix< double > > SpamsMatrixPointer
utl_shared_ptr< spams::SpMatrix< double > > SpamsSpMatrixPointer