18 #ifndef __itkL1RegularizedLeastSquaresFistaSolver_h 19 #define __itkL1RegularizedLeastSquaresFistaSolver_h 43 template <
class TPrecision>
69 void SetA(
const MatrixPointer& mat);
70 itkGetMacro(A, MatrixPointer);
71 void Setw(
const VectorPointer& w);
72 void SetwForInitialization(
const VectorPointer& w);
73 itkGetMacro(w, VectorPointer);
74 void Setb(
const VectorPointer& b);
75 itkGetMacro(b, VectorPointer);
77 itkSetMacro(UseL2SolverForInitialization,
bool);
78 itkGetMacro(UseL2SolverForInitialization,
bool);
79 itkBooleanMacro(UseL2SolverForInitialization);
83 int N = m_A->Columns();
84 utlException(N==0,
"wrong size! m_A->Columns()="<<m_A->Columns());
91 m_A=MatrixPointer(
new MatrixType());
92 m_AtA=MatrixPointer(
new MatrixType());
93 m_Atb=VectorPointer(
new VectorType());
94 m_b=VectorPointer(
new VectorType());
95 m_w=VectorPointer(
new VectorType());
100 m_A=MatrixPointer(
new MatrixType());
101 m_AtA=MatrixPointer(
new MatrixType());
102 m_Atb=VectorPointer(
new VectorType());
103 m_L2Solver->ClearA();
107 m_w=VectorPointer(
new VectorType());
108 m_L2Solver->ClearLamabda();
112 m_b=VectorPointer(
new VectorType());
113 m_Atb=VectorPointer(
new VectorType());
114 m_L2Solver->Clearb();
122 void Solve(
const VectorType& xInitial=VectorType())
ITK_OVERRIDE;
124 void Initialize(
const VectorType& xInitial=VectorType())
ITK_OVERRIDE;
126 ValueType EvaluateCostFunction(
const VectorType& x=VectorType())
const ITK_OVERRIDE;
133 void PrintSelf(std::ostream& os, Indent indent)
const ITK_OVERRIDE;
135 virtual typename LightObject::Pointer InternalClone()
const ITK_OVERRIDE;
149 void operator=(
const Self&);
165 #define ITK_TEMPLATE_L1RegularizedLeastSquaresFISTASolver(_, EXPORT, TypeX, TypeY) \ 168 _( 1 ( class EXPORT L1RegularizedLeastSquaresFISTASolver< ITK_TEMPLATE_1 TypeX > ) ) \ 169 namespace Templates \ 171 typedef L1RegularizedLeastSquaresFISTASolver< ITK_TEMPLATE_1 TypeX > L1RegularizedLeastSquaresFISTASolver##TypeY; \ 175 #if ITK_TEMPLATE_EXPLICIT 176 #include "Templates/itkL1RegularizedLeastSquaresFISTASolver+-.h" 179 #if !defined(ITK_MANUAL_INSTANTIATION) && !defined(__itkL1RegularizedLeastSquaresFISTASolver_hxx) NDArray is a N-Dimensional array class (row-major, c version)
SmartPointer< Self > Pointer
Base class for some optimization solvers using primal-dual updates.
Superclass::VectorType VectorType
Superclass::MatrixPointer MatrixPointer
solve least square problem with L1 regularization using FISTA
virtual ~L1RegularizedLeastSquaresFISTASolver()
int GetXDimension() const ITK_OVERRIDE
Superclass::ValueContainerType ValueContainerType
#define utlException(cond, expout)
L1RegularizedLeastSquaresFISTASolver Self
void Clear() ITK_OVERRIDE
Superclass::MatrixType MatrixType
Superclass::ValueType ValueType
Superclass::VectorPointer VectorPointer
SmartPointer< Self > Pointer
IterativeSolverBase< TPrecision > Superclass
solve least square problem with L2 regularization
bool m_UseL2SolverForInitialization
L2SolverType::Pointer m_L2Solver
L2RegularizedLeastSquaresSolver< TPrecision > L2SolverType
std::vector< ValueType > ValueContainerType
Superclass::UpdateInfomationType UpdateInfomationType