18 #ifndef itkLBFGSOptimizerBasev4_h
19 #define itkLBFGSOptimizerBasev4_h
22 #include "vnl/algo/vnl_lbfgs.h"
23 #include "vnl/algo/vnl_lbfgsb.h"
25 #include "ITKOptimizersv4Export.h"
40 template <
typename TInternalVnlOptimizerType>
75 template <
typename TInternalVnlOptimizerType>
109 StartOptimization(
bool doOnlyInitialization =
false)
override;
121 itkGetConstMacro(Trace,
bool);
122 itkBooleanMacro(Trace);
126 SetMaximumNumberOfFunctionEvaluations(
unsigned int n);
128 itkGetConstMacro(MaximumNumberOfFunctionEvaluations,
unsigned int);
136 SetGradientConvergenceTolerance(
double f);
138 itkGetConstMacro(GradientConvergenceTolerance,
double);
142 GetStopConditionDescription()
const override;
148 PrintSelf(std::ostream & os,
Indent indent)
const override;
152 bool m_OptimizerInitialized{
false };
157 mutable std::ostringstream m_StopConditionDescription{};
159 bool m_Trace{
false };
160 unsigned int m_MaximumNumberOfFunctionEvaluations{ 2000 };
161 double m_GradientConvergenceTolerance{ 1
e-5 };
162 double m_InfinityNormOfProjectedGradient{ 0.0 };
163 double m_CostFunctionConvergenceFactor{ 1
e+7 };
171 template <
typename TInternalVnlOptimizerType>
179 : TInternalVnlOptimizerType(f)
188 report_iter()
override;
193 #ifndef ITK_MANUAL_INSTANTIATION
194 # include "itkLBFGSOptimizerBasev4.hxx"
200 #ifndef ITK_TEMPLATE_EXPLICIT_LBFGSOptimizerBasev4
209 #if defined(ITKOptimizersv4_EXPORTS)
211 # define ITKOptimizersv4_EXPORT_EXPLICIT ITK_FORWARD_EXPORT
214 # define ITKOptimizersv4_EXPORT_EXPLICIT ITKOptimizersv4_EXPORT
219 ITK_GCC_PRAGMA_DIAG_PUSH()
220 ITK_GCC_PRAGMA_DIAG(ignored
"-Wattributes")
222 #if defined(_MSC_VER)
223 # pragma warning(disable : 4661) // no suitable definition provided for explicit template instantiation request
228 ITK_GCC_PRAGMA_DIAG_POP()
231 #undef ITKOptimizersv4_EXPORT_EXPLICIT