16#ifdef gsHLBFGS_ENABLED
17#include <gsHLBFGS/gsHLBFGS.h>
33template <
class T,
class Optimizer>
36 Base::defaultOptions();
39template <
class T,
class Optimizer>
43 m_DeltaU.setZero(m_dofs);
54template <
class T,
class Optimizer>
59 m_optimizer.options().setInt(
"MaxIterations",m_maxIterations);
60 m_optimizer.options().setInt(
"Verbose",m_verbose);
63 m_optimizer.options().setReal(
"MinGradientLength",m_tolF);
64 m_optimizer.options().setReal(
"MinStepLength",m_tolU);
66#ifdef gsHLBFGS_ENABLED
67 else if (
dynamic_cast<gsHLBFGS<T>*
>(&m_optimizer))
69 m_optimizer.options().setReal(
"MinGradLen",m_tolF);
70 m_optimizer.options().setReal(
"MinStepLen",m_tolU);
74 else if (
dynamic_cast<gsOptim<T>*
>(&m_optimizer))
76 m_optimizer.options().setReal(
"RelObjFnChangeTol",m_tolF);
77 m_optimizer.options().setReal(
"RelSolChangeTol",m_tolU);
81 else if (
dynamic_cast<gsIpOpt<T>*
>(&m_optimizer))
83 m_optimizer.options().setReal(
"MinGradientLength",m_tolF);
84 m_optimizer.options().setReal(
"MinStepLength",m_tolU);
91template <
class T,
class Optimizer>
95 m_optimizer.solve(m_U+m_DeltaU);
97 m_DeltaU = m_optimizer.currentDesign() - m_U;
100 m_numIterations = m_optimizer.iterations();
This class describes the gradient descent method.
Definition gsGradientDescent.h:72
Class defining an optimization problem.
Definition gsIpOpt.h:31
Base class for the Optim wrapper.
Definition gsOptim.h:130
void _init()
Initializes the method.
Definition gsStaticOpt.hpp:40
void defaultOptions() override
See gsStaticBase.
Definition gsStaticOpt.hpp:34
void getOptions() override
See gsStaticBase.
Definition gsStaticOpt.hpp:55
gsStatus solve() override
gsStaticBase base functions
Definition gsStaticOpt.hpp:92
#define GISMO_ERROR(message)
Definition gsDebug.h:118
Provides declaration of the gradient descent method.
Provides declaration of an optimization problem.
Provides declaration of an optimization problem.
The G+Smo namespace, containing all definitions for the library.
gsStatus
Definition gsStructuralAnalysisTypes.h:21
@ NotStarted
ALM has not started yet.