18 #ifndef __itkL2RegularizedLeastSquaresSolver_h 19 #define __itkL2RegularizedLeastSquaresSolver_h 21 #include "vnl/vnl_matrix.h" 42 template <
class TPrecision>
67 void SetA(
const MatrixPointer& mat);
68 itkGetMacro(A, MatrixPointer);
69 void SetLambda(
const MatrixPointer& mat);
70 itkGetMacro(Lambda, MatrixPointer);
71 itkSetMacro(b, VectorPointer);
72 itkGetMacro(b, VectorPointer);
74 itkGetMacro(LS, MatrixPointer);
75 itkGetMacro(ConditionNumber, ValueType);
79 int N = m_A->Columns();
80 utlException(N==0,
"wrong size! m_A->Columns()="<<m_A->Columns());
88 m_A=MatrixPointer(
new MatrixType());
89 m_LS=MatrixPointer(
new MatrixType());
94 m_Lambda=MatrixPointer(
new MatrixType());
95 m_LS=MatrixPointer(
new MatrixType());
97 m_IsLambdaSymmetric =
true;
101 m_b=VectorPointer(
new VectorType());
106 void Solve(
const VectorType& xInitial=VectorType())
ITK_OVERRIDE;
107 void Initialize(
const VectorType& xInitial=VectorType())
ITK_OVERRIDE;
109 ValueType EvaluateCostFunction(
const VectorType& x=VectorType())
const ITK_OVERRIDE;
115 void PrintSelf(std::ostream& os, Indent indent)
const ITK_OVERRIDE;
117 virtual typename LightObject::Pointer InternalClone()
const ITK_OVERRIDE;
132 void operator=(
const Self&);
142 #if ITK_TEMPLATE_EXPLICIT 143 # include "Templates/itkL2RegularizedLeastSquaresSolver+-.h" 146 #if !defined(ITK_MANUAL_INSTANTIATION) && !defined(__itkL2RegularizedLeastSquaresSolver_hxx) NDArray is a N-Dimensional array class (row-major, c version)
Superclass::ValueType ValueType
Superclass::MatrixPointer MatrixPointer
SmartPointer< Self > Pointer
ValueType m_ConditionNumber
SolverBase< TPrecision > Superclass
#define utlException(cond, expout)
Superclass::ValueContainerType ValueContainerType
virtual ~L2RegularizedLeastSquaresSolver()
Superclass::MatrixType MatrixType
Superclass::VectorType VectorType
L2RegularizedLeastSquaresSolver Self
Superclass::VectorPointer VectorPointer
SmartPointer< const Self > ConstPointer
solve least square problem with L2 regularization
utl_shared_ptr< VectorType > VectorPointer
utl_shared_ptr< MatrixType > MatrixPointer
int GetXDimension() const ITK_OVERRIDE
Base class for some optimization solvers using primal-dual updates.
std::vector< ValueType > ValueContainerType