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"
40template <
typename TInternalVnlOptimizerType>
75template <
typename TInternalVnlOptimizerType>
121 itkGetConstMacro(Trace,
bool);
122 itkBooleanMacro(Trace);
128 itkGetConstMacro(MaximumNumberOfFunctionEvaluations,
unsigned int);
138 itkGetConstMacro(GradientConvergenceTolerance,
double);
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 };
171template <
typename TInternalVnlOptimizerType>
179 : TInternalVnlOptimizerType(f)
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
219ITK_GCC_PRAGMA_DIAG_PUSH()
220ITK_GCC_PRAGMA_DIAG(ignored
"-Wattributes")
223# pragma warning(disable : 4661)
228ITK_GCC_PRAGMA_DIAG_POP()
231#undef ITKOptimizersv4_EXPORT_EXPLICIT
Wrapper helper around vnl_lbfgsb.
Control indentation during Print() invocation.
Wrapper helper around vnl optimizer.
bool report_iter() override
LBFGSOptimizerBaseHelperv4(vnl_cost_function &f, LBFGSOptimizerBasev4< TInternalVnlOptimizerType > *itkObj)
LBFGSOptimizerBasev4< TInternalVnlOptimizerType > * m_ItkObj
TInternalVnlOptimizerType Superclass
Abstract base for vnl lbfgs algorithm optimizers in ITKv4 registration framework.
Superclass::StopConditionDescriptionType StopConditionDescriptionType
void SetMetric(MetricType *metric) override
Superclass::CostFunctionAdaptorType CostFunctionAdaptorType
virtual void SetTrace(bool flag)
Superclass::StopConditionReturnStringType StopConditionReturnStringType
InternalOptimizerType * GetOptimizer()
virtual void SetGradientConvergenceTolerance(double f)
Superclass::ScalesType ScalesType
~LBFGSOptimizerBasev4() override=default
Superclass::MetricType MetricType
Superclass::ParametersType ParametersType
void PrintSelf(std::ostream &os, Indent indent) const override
void StartOptimization(bool doOnlyInitialization=false) override
virtual void SetMaximumNumberOfFunctionEvaluations(unsigned int n)
std::unique_ptr< InternalOptimizerType > InternalOptimizerAutoPointer
StopConditionReturnStringType GetStopConditionDescription() const override
Light weight base class for most itk classes.
This is a base for the ITKv4 Optimization methods using the vnl library.
#define ITKOptimizersv4_EXPORT_EXPLICIT
static constexpr double e
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
template class ITKOptimizersv4_EXPORT_EXPLICIT LBFGSOptimizerBasev4< vnl_lbfgsb >
class ITK_TEMPLATE_EXPORT LBFGSOptimizerBaseHelperv4
template class ITKOptimizersv4_EXPORT_EXPLICIT LBFGSOptimizerBasev4< vnl_lbfgs >