18 #ifndef itkLBFGS2Optimizerv4_h
19 #define itkLBFGS2Optimizerv4_h
23 #include "ITKOptimizersv4Export.h"
109 LINESEARCH_DEFAULT = 0,
112 LINESEARCH_MORETHUENTE = 0,
123 LINESEARCH_BACKTRACKING_ARMIJO = 1,
126 LINESEARCH_BACKTRACKING = 2,
138 LINESEARCH_BACKTRACKING_WOLFE = 2,
150 LINESEARCH_BACKTRACKING_STRONG_WOLFE = 3,
179 virtual void StartOptimization(
bool doOnlyInitialization =
false) ITK_OVERRIDE;
184 virtual
void SetScales(const
ScalesType &) ITK_OVERRIDE;
187 virtual
void SetWeights(const
ScalesType ) ITK_OVERRIDE;
197 void SetHessianApproximationAccuracy(
int m);
198 int GetHessianApproximationAccuracy() const;
220 void SetDeltaConvergenceDistance(
int nPast);
221 int GetDeltaConvergenceDistance() const;
247 void SetMaximumIterations(
int maxIterations);
248 int GetMaximumIterations() const;
253 virtual
SizeValueType GetNumberOfIterations() const ITK_OVERRIDE {
return GetMaximumIterations(); }
263 void SetLineSearch(
const LineSearchMethod &linesearch);
264 LineSearchMethod GetLineSearch()
const;
272 void SetMaximumLineSearchEvaluations(
int n);
273 int GetMaximumLineSearchEvaluations()
const;
283 void SetMinimumLineSearchStep(PrecisionType step);
284 PrecisionType GetMinimumLineSearchStep()
const;
294 void SetMaximumLineSearchStep(PrecisionType step);
295 PrecisionType GetMaximumLineSearchStep()
const;
303 void SetLineSearchAccuracy( PrecisionType ftol );
304 PrecisionType GetLineSearchAccuracy()
const;
317 void SetWolfeCoefficient( PrecisionType wc );
318 PrecisionType GetWolfeCoefficient()
const;
333 void SetLineSearchGradientAccuracy( PrecisionType gtol );
334 PrecisionType GetLineSearchGradientAccuracy()
const;
344 void SetMachinePrecisionTolerance(PrecisionType xtol);
345 PrecisionType GetMachinePrecisionTolerance()
const;
361 void SetOrthantwiseCoefficient( PrecisionType orthant_c);
362 PrecisionType GetOrthantwiseCoefficient()
const;
379 void SetOrthantwiseStart(
int start);
380 int GetOrthantwiseStart()
const;
390 void SetOrthantwiseEnd(
int end);
391 int GetOrthantwiseEnd()
const;
395 itkGetConstMacro(CurrentParameterNorm, PrecisionType);
398 itkGetConstMacro(CurrentGradientNorm, PrecisionType);
403 itkGetConstMacro(CurrentStepSize, PrecisionType);
406 itkGetConstMacro(CurrentNumberOfEvaluations, PrecisionType);
411 virtual
void PrintSelf(std::ostream & os,
Indent indent) const ITK_OVERRIDE;
415 static
int UpdateProgressCallback(
void *
Instance,
416 const PrecisionType *x,
417 const PrecisionType *g,
418 const PrecisionType fx,
419 const PrecisionType xnorm,
420 const PrecisionType gnorm,
421 const PrecisionType step,
428 int UpdateProgress( const PrecisionType *x,
429 const PrecisionType *g,
430 const PrecisionType fx,
431 const PrecisionType xnorm,
432 const PrecisionType gnorm,
433 const PrecisionType step,
440 static PrecisionType EvaluateCostCallback(
void *instance,
441 const PrecisionType *x,
444 const PrecisionType step
447 PrecisionType EvaluateCost( const PrecisionType *x,
450 const PrecisionType step
457 class PrivateImplementationHolder;
462 const
double *m_CurrentGradient;
463 const
double *m_CurrentParameter;
465 double m_CurrentStepSize;
466 double m_CurrentParameterNorm;
467 double m_CurrentGradientNorm;
468 int m_CurrentNumberOfEvaluations;
Light weight base class for most itk classes.
Superclass::ScalesType ScalesType
unsigned long SizeValueType
Superclass::MetricType MetricType
SmartPointer< const Self > ConstPointer
Superclass::ParametersType ParametersType
virtual void SetNumberOfIterations(const SizeValueType _arg) override
Wrap of the libLBFGS[1] algorithm for use in ITKv4 registration framework. LibLBFGS is a translation ...
Implements an Automatic Pointer to an object.
Control indentation during Print() invocation.
std::string StopConditionReturnStringType
Abstract base for object-to-object optimizers.
SmartPointer< Self > Pointer
ObjectToObjectOptimizerBaseTemplate< double > Superclass