18 #ifndef itkLBFGS2Optimizerv4_h
19 #define itkLBFGS2Optimizerv4_h
23 #include "ITKOptimizersv4Export.h"
88 extern ITKOptimizersv4_EXPORT std::ostream &
174 #if !defined(ITK_LEGACY_REMOVE)
176 static constexpr
LineSearchMethodEnum LINESEARCH_DEFAULT = LineSearchMethodEnum::LINESEARCH_DEFAULT;
177 static constexpr
LineSearchMethodEnum LINESEARCH_MORETHUENTE = LineSearchMethodEnum::LINESEARCH_MORETHUENTE;
179 LineSearchMethodEnum::LINESEARCH_BACKTRACKING_ARMIJO;
180 static constexpr
LineSearchMethodEnum LINESEARCH_BACKTRACKING = LineSearchMethodEnum::LINESEARCH_BACKTRACKING;
182 LineSearchMethodEnum::LINESEARCH_BACKTRACKING_WOLFE;
184 LineSearchMethodEnum::LINESEARCH_BACKTRACKING_STRONG_WOLFE;
213 StartOptimization(
bool doOnlyInitialization =
false)
override;
216 GetStopConditionDescription()
const override;
235 SetHessianApproximationAccuracy(
int m);
237 GetHessianApproximationAccuracy()
const;
251 GetSolutionAccuracy()
const;
262 SetDeltaConvergenceDistance(
int nPast);
264 GetDeltaConvergenceDistance()
const;
280 GetDeltaConvergenceTolerance()
const;
293 SetMaximumIterations(
int maxIterations);
295 GetMaximumIterations()
const;
303 return GetMaximumIterations();
308 SetMaximumIterations(static_cast<int>(_arg));
319 SetLineSearch(
const LineSearchMethodEnum & linesearch);
321 GetLineSearch()
const;
330 SetMaximumLineSearchEvaluations(
int n);
332 GetMaximumLineSearchEvaluations()
const;
343 SetMinimumLineSearchStep(PrecisionType step);
345 GetMinimumLineSearchStep()
const;
356 SetMaximumLineSearchStep(PrecisionType step);
358 GetMaximumLineSearchStep()
const;
367 SetLineSearchAccuracy(PrecisionType ftol);
369 GetLineSearchAccuracy()
const;
383 SetWolfeCoefficient(PrecisionType wc);
385 GetWolfeCoefficient()
const;
401 SetLineSearchGradientAccuracy(PrecisionType gtol);
403 GetLineSearchGradientAccuracy()
const;
414 SetMachinePrecisionTolerance(PrecisionType xtol);
416 GetMachinePrecisionTolerance()
const;
433 SetOrthantwiseCoefficient(PrecisionType orthant_c);
435 GetOrthantwiseCoefficient()
const;
453 SetOrthantwiseStart(
int start);
455 GetOrthantwiseStart()
const;
466 SetOrthantwiseEnd(
int end);
468 GetOrthantwiseEnd()
const;
472 itkGetConstMacro(CurrentParameterNorm, PrecisionType);
475 itkGetConstMacro(CurrentGradientNorm, PrecisionType);
480 itkGetConstMacro(CurrentStepSize, PrecisionType);
483 itkGetConstMacro(CurrentNumberOfEvaluations, PrecisionType);
489 PrintSelf(std::ostream & os,
Indent indent)
const override;
494 UpdateProgressCallback(
void * instance,
495 const PrecisionType * x,
496 const PrecisionType * g,
497 const PrecisionType fx,
498 const PrecisionType xnorm,
499 const PrecisionType gnorm,
500 const PrecisionType step,
507 UpdateProgress(
const PrecisionType * x,
508 const PrecisionType * g,
509 const PrecisionType fx,
510 const PrecisionType xnorm,
511 const PrecisionType gnorm,
512 const PrecisionType step,
519 EvaluateCostCallback(
void * instance,
520 const PrecisionType * x,
523 const PrecisionType step);
526 EvaluateCost(
const PrecisionType * x, PrecisionType * g,
const int n,
const PrecisionType step);
530 class PrivateImplementationHolder;
532 std::unique_ptr<PrivateImplementationHolder>
m_Pimpl;