DMRITool  v0.1.1-139-g860d86b4
Diffusion MRI Tool
itkIterativeSolverBase.h
Go to the documentation of this file.
1 
18 #ifndef __itkIterativeSolverBase_h
19 #define __itkIterativeSolverBase_h
20 
21 #include "itkSolverBase.h"
22 
23 namespace itk
24 {
25 
33 template <class TPrecision>
34 class ITK_EXPORT IterativeSolverBase : public SolverBase<TPrecision>
35 {
36 public:
40  typedef SmartPointer<Self> Pointer;
41 
43  itkNewMacro(Self);
44 
47 
48  typedef TPrecision ValueType;
51 
52  typedef std::vector<ValueType> ValueContainerType;
53 
54  typedef enum
55  {
56  NONE=0,
60  RESTART
62 
63  // itkSetMacro(CostFunction, ValueContainerType);
64  itkGetConstReferenceMacro(CostFunction, ValueContainerType);
65  // itkSetMacro(DifferenceNormOfPrimalResidual, ValueContainerType);
66  itkGetConstReferenceMacro(DifferenceNormOfPrimalResidual, ValueContainerType);
67  // itkSetMacro(DifferenceNormOfDualResidual, ValueContainerType);
68  itkGetConstReferenceMacro(DifferenceNormOfDualResidual, ValueContainerType);
69  // itkSetMacro(EPSOfPrimalResidual, ValueContainerType);
70  itkGetConstReferenceMacro(EPSOfPrimalResidual, ValueContainerType);
71  // itkSetMacro(EPSOfDualResidual, ValueContainerType);
72  itkGetConstReferenceMacro(EPSOfDualResidual, ValueContainerType);
73  // itkSetMacro(DifferenceNormOfSeparateVariable, ValueContainerType);
74  // itkGetConstReferenceMacro(DifferenceNormOfSeparateVariable, ValueContainerType);
75 
76  itkSetMacro(MaxNumberOfIterations, int);
77  itkGetConstReferenceMacro(MaxNumberOfIterations, int);
78  // itkSetMacro(NumberOfIterations, int);
79  itkGetConstReferenceMacro(NumberOfIterations, int);
80  itkSetMacro(MinRelativeChangeOfCostFunction, ValueType);
81  itkGetConstReferenceMacro(MinRelativeChangeOfCostFunction, ValueType);
82  itkSetMacro(MinRelativeChangeOfPrimalResidual, ValueType);
83  itkGetConstReferenceMacro(MinRelativeChangeOfPrimalResidual, ValueType);
84  itkSetMacro(MinRelativeChangeOfDualResidual, ValueType);
85  itkGetConstReferenceMacro(MinRelativeChangeOfDualResidual, ValueType);
86  // itkSetMacro(MinRelativeChangeOfSeparateVarible, ValueType);
87  // itkGetConstReferenceMacro(MinRelativeChangeOfSeparateVariable, ValueType);
88 
89  itkSetMacro(EPSOfVaribles, ValueType);
90  itkGetConstReferenceMacro(EPSOfVaribles, ValueType);
91 
92  itkSetMacro(NumberOfChangeLessThanThreshold, int);
93  itkGetConstReferenceMacro(NumberOfChangeLessThanThreshold, int);
94 
95  void Initialize(const VectorType& xInitial=VectorType()) ITK_OVERRIDE;
96  virtual void Iterate() {}
97 
100 
101  virtual void Solve(const VectorType& xInitial=VectorType()) ITK_OVERRIDE;
102 
103  virtual void Clear() ITK_OVERRIDE;
104 
105 protected:
107  virtual ~IterativeSolverBase() {};
108 
109  void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
110  virtual typename LightObject::Pointer InternalClone() const ITK_OVERRIDE;
111 
112  ValueContainerType m_CostFunction;
114  ValueContainerType m_DifferenceNormOfDualResidual;
115  // ValueContainerType m_DifferenceNormOfSeparateVariable;
116 
117  ValueContainerType m_EPSOfPrimalResidual;
118  ValueContainerType m_EPSOfDualResidual;
119 
125  // ValueType m_MinRelativeChangeOfSeparateVariable;
126 
127  ValueType m_EPSOfVaribles;
128 
129  UpdateInfomationType m_UpdateInformation;
131 
132 private:
133  IterativeSolverBase(const Self&); //purposely not implemented
134  void operator=(const Self&); //purposely not implemented
135 
136 };
137 
138 }
139 
140 // Define instantiation macro for this template.
141 #define ITK_TEMPLATE_IterativeSolverBase(_, EXPORT, TypeX, TypeY) \
142  namespace itk \
143  { \
144  _( 1 ( class EXPORT IterativeSolverBase< ITK_TEMPLATE_1 TypeX > ) ) \
145  namespace Templates \
146  { \
147  typedef IterativeSolverBase< ITK_TEMPLATE_1 TypeX > IterativeSolverBase##TypeY; \
148  } \
149  }
150 
151 #if ITK_TEMPLATE_EXPLICIT
152 #include "Templates/itkIterativeSolverBase+-.h"
153 #endif
154 
155 #if !defined(ITK_MANUAL_INSTANTIATION) && !defined(__itkIterativeSolverBase_hxx)
157 #endif
158 
159 #endif
std::vector< ValueType > ValueContainerType
NDArray is a N-Dimensional array class (row-major, c version)
Definition: utlFunctors.h:131
UpdateInfomationType m_UpdateInformation
Base class for some optimization solvers using primal-dual updates.
Superclass::VectorType VectorType
SolverBase< TPrecision > Superclass
virtual void HistoryUpdateAndConvergenceCheck()
#define ITK_OVERRIDE
Definition: utlITKMacro.h:46
ValueContainerType m_DifferenceNormOfDualResidual
ValueContainerType m_EPSOfPrimalResidual
ValueContainerType m_DifferenceNormOfPrimalResidual
ValueContainerType m_EPSOfDualResidual
Base class for some optimization solvers using primal-dual updates.
Definition: itkSolverBase.h:39
SmartPointer< Self > Pointer
Superclass::MatrixType MatrixType