Ipopt Documentation  
 
Loading...
Searching...
No Matches
Ipopt::AlgorithmBuilder Class Reference

Builder for creating a complete IpoptAlg object. More...

#include <IpAlgBuilder.hpp>

+ Inheritance diagram for Ipopt::AlgorithmBuilder:

Public Member Functions

Constructors/Destructors
 AlgorithmBuilder (SmartPtr< AugSystemSolver > custom_solver=NULL, const std::string &custom_solver_name=std::string())
 Constructor.
 
virtual ~AlgorithmBuilder ()
 Destructor.
 
Convenience methods for building solvers without having

to duplicate the significant amount of preprocessor flag and option checking that takes place.

These solvers are used to create a number of core algorithm components across the different Build* methods, but depending on what options are chosen, the first method requiring the solver to be used can vary. Therefore, each of the Factory methods below is paired with a Getter method, which is called by all parts of this algorithm builder to ensure the Factory is only called once.

virtual SmartPtr< SymLinearSolverSymLinearSolverFactory (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Create a solver that can be used to solve a symmetric linear system.
 
SmartPtr< SymLinearSolverGetSymLinearSolver (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Get the symmetric linear system solver for this algorithm.
 
virtual SmartPtr< AugSystemSolverAugSystemSolverFactory (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Create a solver that can be used to solve an augmented system.
 
SmartPtr< AugSystemSolverGetAugSystemSolver (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Get the augmented system solver for this algorithm.
 
virtual SmartPtr< PDSystemSolverPDSystemSolverFactory (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Create a solver that can be used to solve a primal-dual system.
 
SmartPtr< PDSystemSolverGetPDSystemSolver (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Get the primal-dual system solver for this algorithm.
 
Methods to build parts of the algorithm
virtual void BuildIpoptObjects (const Journalist &jnlst, const OptionsList &options, const std::string &prefix, const SmartPtr< NLP > &nlp, SmartPtr< IpoptNLP > &ip_nlp, SmartPtr< IpoptData > &ip_data, SmartPtr< IpoptCalculatedQuantities > &ip_cq)
 Allocates memory for the IpoptNLP, IpoptData, and IpoptCalculatedQuanties arguments.
 
virtual SmartPtr< IpoptAlgorithmBuildBasicAlgorithm (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Creates an instance of the IpoptAlgorithm class by building each of its required constructor arguments piece-by-piece.
 
virtual SmartPtr< IterationOutputBuildIterationOutput (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Creates an instance of the IterationOutput class.
 
virtual SmartPtr< HessianUpdaterBuildHessianUpdater (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Creates an instance of the HessianUpdater class.
 
virtual SmartPtr< ConvergenceCheckBuildConvergenceCheck (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Creates an instance of the ConvergenceCheck class.
 
virtual SmartPtr< SearchDirectionCalculatorBuildSearchDirectionCalculator (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Creates an instance of the SearchDirectionCalculator class.
 
virtual SmartPtr< EqMultiplierCalculatorBuildEqMultiplierCalculator (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Creates an instance of the EqMultiplierCalculator class.
 
virtual SmartPtr< IterateInitializerBuildIterateInitializer (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Creates an instance of the IterateInitializer class.
 
virtual SmartPtr< LineSearchBuildLineSearch (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Creates an instance of the LineSearch class.
 
virtual SmartPtr< MuUpdateBuildMuUpdate (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Creates an instance of the MuUpdate class.
 
- Public Member Functions inherited from Ipopt::ReferencedObject
 ReferencedObject ()
 
virtual ~ReferencedObject ()
 
Index ReferenceCount () const
 
void AddRef (const Referencer *referencer) const
 
void ReleaseRef (const Referencer *referencer) const
 

Static Public Member Functions

static void RegisterOptions (SmartPtr< RegisteredOptions > roptions)
 Methods for IpoptTypeInfo.
 

Protected Member Functions

SmartPtr< LibraryLoaderGetHSLLoader (const OptionsList &options, const std::string &prefix)
 Gives Library Loader for HSL library if not all HSL routines are linked in.
 
SmartPtr< LibraryLoaderGetPardisoLoader (const OptionsList &options, const std::string &prefix)
 Gives Library Loader for Pardiso library from pardiso-project.org.
 

Private Member Functions

Default Compiler Generated Methods

(Hidden to avoid implicit creation/calling).

These methods are not implemented and we do not want the compiler to implement them for us, so we declare them private and do not define them. This ensures that they will not be implicitly created/called.

 AlgorithmBuilder (const AlgorithmBuilder &)
 Default Constructor.
 
void operator= (const AlgorithmBuilder &)
 Default Assignment Operator.
 

Private Attributes

SmartPtr< AugSystemSolvercustom_solver_
 Optional pointer to AugSystemSolver.
 
std::string custom_solver_name_
 
std::string linear_solver
 name of linear solver constructed in SymLinearSolverFactory
 
SmartPtr< LibraryLoaderhslloader
 loader of HSL library (at runtime)
 
SmartPtr< LibraryLoaderpardisoloader
 loader of Pardiso library (at runtime)
 
IpoptAlgorithm constructor arguments.

These components are built in separate Build methods in the order defined by BuildBasicAlgorithm.

A single core component may require one or more other core components in its constructor, so the this class holds pointers to each component for use between the separate Build methods.

SmartPtr< IterationOutputIterOutput_
 
SmartPtr< HessianUpdaterHessUpdater_
 
SmartPtr< ConvergenceCheckConvCheck_
 
SmartPtr< SearchDirectionCalculatorSearchDirCalc_
 
SmartPtr< EqMultiplierCalculatorEqMultCalculator_
 
SmartPtr< IterateInitializerIterInitializer_
 
SmartPtr< LineSearchLineSearch_
 
SmartPtr< MuUpdateMuUpdate_
 
Commonly used solver components

for building core algorithm components.

Each of these members is paired with a Factory/Getter method.

SmartPtr< SymLinearSolverSymSolver_
 
SmartPtr< AugSystemSolverAugSolver_
 
SmartPtr< PDSystemSolverPDSolver_
 

Detailed Description

Builder for creating a complete IpoptAlg object.

This object contains all subelements (such as line search objects etc). How the resulting IpoptAlg object is built can be influenced by the options.

More advanced customization can be achieved by subclassing this class and overloading the virtual methods that build the individual parts. The advantage of doing this is that it allows one to reuse the extensive amount of options processing that takes place, for instance, when generating the symmetric linear system solver. Another method for customizing the algorithm is using the optional custom_solver argument, which allows the expert user to provide a specialized linear solver for the augmented system (e.g., type GenAugSystemSolver), possibly for user-defined matrix objects. The optional custom_solver constructor argument is likely obsolete, however, as more control over this this process can be achieved by implementing a subclass of this AlgBuilder (e.g., by overloading the AugSystemSolverFactory method).

Definition at line 49 of file IpAlgBuilder.hpp.

Constructor & Destructor Documentation

◆ AlgorithmBuilder() [1/2]

Ipopt::AlgorithmBuilder::AlgorithmBuilder ( SmartPtr< AugSystemSolver custom_solver = NULL,
const std::string &  custom_solver_name = std::string() 
)

Constructor.

Parameters
custom_solvercustom linear solver interface object
custom_solver_namename of custom linear solver (since 3.14.12)

◆ ~AlgorithmBuilder()

virtual Ipopt::AlgorithmBuilder::~AlgorithmBuilder ( )
inlinevirtual

Destructor.

Definition at line 61 of file IpAlgBuilder.hpp.

◆ AlgorithmBuilder() [2/2]

Ipopt::AlgorithmBuilder::AlgorithmBuilder ( const AlgorithmBuilder )
private

Default Constructor.

Copy Constructor

Member Function Documentation

◆ RegisterOptions()

static void Ipopt::AlgorithmBuilder::RegisterOptions ( SmartPtr< RegisteredOptions roptions)
static

Methods for IpoptTypeInfo.

register the options used by the algorithm builder

◆ SymLinearSolverFactory()

virtual SmartPtr< SymLinearSolver > Ipopt::AlgorithmBuilder::SymLinearSolverFactory ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix 
)
virtual

Create a solver that can be used to solve a symmetric linear system.

Dependencies: None

◆ GetSymLinearSolver()

SmartPtr< SymLinearSolver > Ipopt::AlgorithmBuilder::GetSymLinearSolver ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix 
)

Get the symmetric linear system solver for this algorithm.

This method will call the SymLinearSolverFactory exactly once (the first time it is used), and store its instance on SymSolver_ for use in subsequent calls.

◆ AugSystemSolverFactory()

virtual SmartPtr< AugSystemSolver > Ipopt::AlgorithmBuilder::AugSystemSolverFactory ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix 
)
virtual

Create a solver that can be used to solve an augmented system.

Dependencies: -> GetSymLinearSolver() -> SymLinearSolverFactory() -> custom_solver_

◆ GetAugSystemSolver()

SmartPtr< AugSystemSolver > Ipopt::AlgorithmBuilder::GetAugSystemSolver ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix 
)

Get the augmented system solver for this algorithm.

This method will call the AugSystemSolverFactory exactly once (the first time it is used), and store its instance on AugSolver_ for use in subsequent calls.

◆ PDSystemSolverFactory()

virtual SmartPtr< PDSystemSolver > Ipopt::AlgorithmBuilder::PDSystemSolverFactory ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix 
)
virtual

Create a solver that can be used to solve a primal-dual system.

Dependencies: -> GetAugSystemSolver() -> AugSystemSolverFactory() -> GetSymLinearSolver() -> SymLinearSolverFactory() -> custom_solver_

◆ GetPDSystemSolver()

SmartPtr< PDSystemSolver > Ipopt::AlgorithmBuilder::GetPDSystemSolver ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix 
)

Get the primal-dual system solver for this algorithm.

This method will call the PDSystemSolverFactory exactly once (the first time it is used), and store its instance on PDSolver_ for use in subsequent calls.

◆ BuildIpoptObjects()

virtual void Ipopt::AlgorithmBuilder::BuildIpoptObjects ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix,
const SmartPtr< NLP > &  nlp,
SmartPtr< IpoptNLP > &  ip_nlp,
SmartPtr< IpoptData > &  ip_data,
SmartPtr< IpoptCalculatedQuantities > &  ip_cq 
)
virtual

Allocates memory for the IpoptNLP, IpoptData, and IpoptCalculatedQuanties arguments.

Dependencies: None

Reimplemented in Ipopt::InexactAlgorithmBuilder.

◆ BuildBasicAlgorithm()

virtual SmartPtr< IpoptAlgorithm > Ipopt::AlgorithmBuilder::BuildBasicAlgorithm ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix 
)
virtual

Creates an instance of the IpoptAlgorithm class by building each of its required constructor arguments piece-by-piece.

The default algorithm can be customized by overloading this method or by overloading one or more of the Build* methods called in this method's default implementation. Additional control can be achieved by overloading any of the *SolverFactory methods. This method will call (in this order): -> BuildIterationOutput() -> BuildHessianUpdater() -> BuildConvergenceCheck() -> BuildSearchDirectionCalculator() -> BuildEqMultiplierCalculator() -> BuildIterateInitializer() -> BuildLineSearch() -> BuildMuUpdate()

Reimplemented in Ipopt::InexactAlgorithmBuilder.

◆ BuildIterationOutput()

virtual SmartPtr< IterationOutput > Ipopt::AlgorithmBuilder::BuildIterationOutput ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix 
)
virtual

Creates an instance of the IterationOutput class.

This method is called in the default implementation of BuildBasicAlgorithm. It can be overloaded to customize that portion the default algorithm. Dependencies: None

◆ BuildHessianUpdater()

virtual SmartPtr< HessianUpdater > Ipopt::AlgorithmBuilder::BuildHessianUpdater ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix 
)
virtual

Creates an instance of the HessianUpdater class.

This method is called in the default implementation of BuildBasicAlgorithm. It can be overloaded to customize that portion the default algorithm. Dependencies: None

◆ BuildConvergenceCheck()

virtual SmartPtr< ConvergenceCheck > Ipopt::AlgorithmBuilder::BuildConvergenceCheck ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix 
)
virtual

Creates an instance of the ConvergenceCheck class.

This method is called in the default implementation of BuildBasicAlgorithm. It can be overloaded to customize that portion the default algorithm. Dependencies: None

◆ BuildSearchDirectionCalculator()

virtual SmartPtr< SearchDirectionCalculator > Ipopt::AlgorithmBuilder::BuildSearchDirectionCalculator ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix 
)
virtual

Creates an instance of the SearchDirectionCalculator class.

This method is called in the default implementation of BuildBasicAlgorithm. It can be overloaded to customize that portion the default algorithm. Dependencies: -> GetPDSystemSolver() -> PDSystemSolverFactory() -> GetAugSystemSolver() -> AugSystemSolverFactory() -> GetSymLinearSolver() -> SymLinearSolverFactory() -> custom_solver_

◆ BuildEqMultiplierCalculator()

virtual SmartPtr< EqMultiplierCalculator > Ipopt::AlgorithmBuilder::BuildEqMultiplierCalculator ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix 
)
virtual

Creates an instance of the EqMultiplierCalculator class.

This method is called in the default implementation of BuildBasicAlgorithm. It can be overloaded to customize that portion the default algorithm. Dependencies: -> GetAugSystemSolver() -> AugSystemSolverFactory() -> GetSymLinearSolver() -> SymLinearSolverFactory() -> custom_solver_

◆ BuildIterateInitializer()

virtual SmartPtr< IterateInitializer > Ipopt::AlgorithmBuilder::BuildIterateInitializer ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix 
)
virtual

Creates an instance of the IterateInitializer class.

This method is called in the default implementation of BuildBasicAlgorithm. It can be overloaded to customize that portion the default algorithm. Dependencies: -> EqMultCalculator_ -> GetAugSystemSolver() -> AugSystemSolverFactory() -> GetSymLinearSolver() -> SymLinearSolverFactory() -> custom_solver_

◆ BuildLineSearch()

virtual SmartPtr< LineSearch > Ipopt::AlgorithmBuilder::BuildLineSearch ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix 
)
virtual

Creates an instance of the LineSearch class.

This method is called in the default implementation of BuildBasicAlgorithm. It can be overloaded to customize that portion the default algorithm. Dependencies: -> EqMultCalculator_ -> ConvCheck_ -> GetAugSystemSolver() -> AugSystemSolverFactory() -> GetSymLinearSolver() -> SymLinearSolverFactory() -> custom_solver_ -> GetPDSystemSolver() -> PDSystemSolverFactory() -> GetAugSystemSolver() -> AugSystemSolverFactory() -> GetSymLinearSolver() -> SymLinearSolverFactory() -> custom_solver_

◆ BuildMuUpdate()

virtual SmartPtr< MuUpdate > Ipopt::AlgorithmBuilder::BuildMuUpdate ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix 
)
virtual

Creates an instance of the MuUpdate class.

This method is called in the default implementation of BuildBasicAlgorithm. It can be overloaded to customize that portion the default algorithm. Dependencies: -> LineSearch_ -> EqMultCalculator_ -> ConvCheck_ -> GetPDSystemSolver() -> PDSystemSolverFactory() -> GetAugSystemSolver() -> AugSystemSolverFactory() -> GetSymLinearSolver() -> SymLinearSolverFactory() -> custom_solver_

◆ GetHSLLoader()

SmartPtr< LibraryLoader > Ipopt::AlgorithmBuilder::GetHSLLoader ( const OptionsList options,
const std::string &  prefix 
)
protected

Gives Library Loader for HSL library if not all HSL routines are linked in.

Creates new loader if not existing yet.

Since
3.14.0

◆ GetPardisoLoader()

SmartPtr< LibraryLoader > Ipopt::AlgorithmBuilder::GetPardisoLoader ( const OptionsList options,
const std::string &  prefix 
)
protected

Gives Library Loader for Pardiso library from pardiso-project.org.

Creates new loader if not existing yet.

Since
3.14.0

◆ operator=()

void Ipopt::AlgorithmBuilder::operator= ( const AlgorithmBuilder )
private

Default Assignment Operator.

Member Data Documentation

◆ IterOutput_

SmartPtr<IterationOutput> Ipopt::AlgorithmBuilder::IterOutput_
private

Definition at line 383 of file IpAlgBuilder.hpp.

◆ HessUpdater_

SmartPtr<HessianUpdater> Ipopt::AlgorithmBuilder::HessUpdater_
private

Definition at line 384 of file IpAlgBuilder.hpp.

◆ ConvCheck_

SmartPtr<ConvergenceCheck> Ipopt::AlgorithmBuilder::ConvCheck_
private

Definition at line 385 of file IpAlgBuilder.hpp.

◆ SearchDirCalc_

SmartPtr<SearchDirectionCalculator> Ipopt::AlgorithmBuilder::SearchDirCalc_
private

Definition at line 386 of file IpAlgBuilder.hpp.

◆ EqMultCalculator_

SmartPtr<EqMultiplierCalculator> Ipopt::AlgorithmBuilder::EqMultCalculator_
private

Definition at line 387 of file IpAlgBuilder.hpp.

◆ IterInitializer_

SmartPtr<IterateInitializer> Ipopt::AlgorithmBuilder::IterInitializer_
private

Definition at line 388 of file IpAlgBuilder.hpp.

◆ LineSearch_

SmartPtr<LineSearch> Ipopt::AlgorithmBuilder::LineSearch_
private

Definition at line 389 of file IpAlgBuilder.hpp.

◆ MuUpdate_

SmartPtr<MuUpdate> Ipopt::AlgorithmBuilder::MuUpdate_
private

Definition at line 390 of file IpAlgBuilder.hpp.

◆ SymSolver_

SmartPtr<SymLinearSolver> Ipopt::AlgorithmBuilder::SymSolver_
private

Definition at line 398 of file IpAlgBuilder.hpp.

◆ AugSolver_

SmartPtr<AugSystemSolver> Ipopt::AlgorithmBuilder::AugSolver_
private

Definition at line 399 of file IpAlgBuilder.hpp.

◆ PDSolver_

SmartPtr<PDSystemSolver> Ipopt::AlgorithmBuilder::PDSolver_
private

Definition at line 400 of file IpAlgBuilder.hpp.

◆ custom_solver_

SmartPtr<AugSystemSolver> Ipopt::AlgorithmBuilder::custom_solver_
private

Optional pointer to AugSystemSolver.

If this is set in the constructor, we will use this to solve the linear systems.

Definition at line 405 of file IpAlgBuilder.hpp.

◆ custom_solver_name_

std::string Ipopt::AlgorithmBuilder::custom_solver_name_
private

Definition at line 406 of file IpAlgBuilder.hpp.

◆ linear_solver

std::string Ipopt::AlgorithmBuilder::linear_solver
private

name of linear solver constructed in SymLinearSolverFactory

Definition at line 409 of file IpAlgBuilder.hpp.

◆ hslloader

SmartPtr<LibraryLoader> Ipopt::AlgorithmBuilder::hslloader
private

loader of HSL library (at runtime)

Definition at line 412 of file IpAlgBuilder.hpp.

◆ pardisoloader

SmartPtr<LibraryLoader> Ipopt::AlgorithmBuilder::pardisoloader
private

loader of Pardiso library (at runtime)

Definition at line 414 of file IpAlgBuilder.hpp.


The documentation for this class was generated from the following file: