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

The main ipopt algorithm class. More...

#include <IpIpoptAlg.hpp>

+ Inheritance diagram for Ipopt::IpoptAlgorithm:

Public Member Functions

virtual bool InitializeImpl (const OptionsList &options, const std::string &prefix)
 overloaded from AlgorithmStrategyObject
 
SolverReturn Optimize (bool isResto=false)
 Main solve method.
 
Constructors/Destructors
 IpoptAlgorithm (const SmartPtr< SearchDirectionCalculator > &search_dir_calculator, const SmartPtr< LineSearch > &line_search, const SmartPtr< MuUpdate > &mu_update, const SmartPtr< ConvergenceCheck > &conv_check, const SmartPtr< IterateInitializer > &iterate_initializer, const SmartPtr< IterationOutput > &iter_output, const SmartPtr< HessianUpdater > &hessian_updater, const SmartPtr< EqMultiplierCalculator > &eq_multiplier_calculator=NULL, const std::string &linear_solver_name="")
 Constructor.
 
virtual ~IpoptAlgorithm ()
 Destructor.
 
Access to internal strategy objects
SmartPtr< SearchDirectionCalculatorSearchDirCalc ()
 
- Public Member Functions inherited from Ipopt::AlgorithmStrategyObject
bool Initialize (const Journalist &jnlst, IpoptNLP &ip_nlp, IpoptData &ip_data, IpoptCalculatedQuantities &ip_cq, const OptionsList &options, const std::string &prefix)
 This method is called every time the algorithm starts again - it is used to reset any internal state.
 
bool ReducedInitialize (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Reduced version of the Initialize method, which does not require special Ipopt information.
 
 AlgorithmStrategyObject ()
 Default Constructor.
 
virtual ~AlgorithmStrategyObject ()
 Destructor.
 
- 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 print_copyright_message (const Journalist &jnlst)
 
static void RegisterOptions (SmartPtr< RegisteredOptions > roptions)
 Methods for IpoptType.
 

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.

 IpoptAlgorithm ()
 Default Constructor.
 
 IpoptAlgorithm (const IpoptAlgorithm &)
 Copy Constructor.
 
void operator= (const IpoptAlgorithm &)
 Default Assignment Operator.
 
Main steps of the algorithm
void UpdateHessian ()
 Method for updating the current Hessian.
 
bool UpdateBarrierParameter ()
 Method to update the barrier parameter.
 
bool ComputeSearchDirection ()
 Method to setup the call to the PDSystemSolver.
 
void ComputeAcceptableTrialPoint ()
 Method computing the new iterate (usually vialine search).
 
void AcceptTrialPoint ()
 Method for accepting the trial point as the new iteration, possibly after adjusting the variable bounds in the NLP.
 
void OutputIteration ()
 Do all the output for one iteration.
 
void InitializeIterates ()
 Sets up initial values for the iterates.
 
void PrintProblemStatistics ()
 Print the problem size statistics.
 
void ComputeFeasibilityMultipliers ()
 Tries to compute Lagrangian multipliers for a feasibility problem.
 
void ComputeFeasibilityMultipliersPostprocess ()
 Compute the Lagrangian multipliers for a feasibility problem in post processing.
 
auxiliary functions
void calc_number_of_bounds (const Vector &x, const Vector &x_L, const Vector &x_U, const Matrix &Px_L, const Matrix &Px_U, Index &n_tot, Index &n_only_lower, Index &n_both, Index &n_only_upper)
 
Number correct_bound_multiplier (const Vector &trial_z, const Vector &trial_slack, const Vector &trial_compl, SmartPtr< const Vector > &new_trial_z)
 Method for ensuring that the trial multipliers are not too far from the primal estime.
 

Private Attributes

Strategy objects
SmartPtr< SearchDirectionCalculatorsearch_dir_calculator_
 
SmartPtr< LineSearchline_search_
 
SmartPtr< MuUpdatemu_update_
 
SmartPtr< ConvergenceCheckconv_check_
 
SmartPtr< IterateInitializeriterate_initializer_
 
SmartPtr< IterationOutputiter_output_
 
SmartPtr< HessianUpdaterhessian_updater_
 
SmartPtr< EqMultiplierCalculatoreq_multiplier_calculator_
 The multiplier calculator (for y_c and y_d) has to be set only if option recalc_y is set to true.
 
internal flags
bool skip_print_problem_stats_
 Flag indicating if the statistic should not be printed.
 
Algorithmic parameters
Number kappa_sigma_
 safeguard factor for bound multipliers.
 
bool recalc_y_
 Flag indicating whether the y multipliers should be recalculated with the eq_mutliplier_calculator object for each new point.
 
Number recalc_y_feas_tol_
 Feasibility threshold for recalc_y.
 
bool mehrotra_algorithm_
 Flag indicating if we want to do Mehrotras's algorithm.
 
std::string linear_solver_name_
 String specifying linear solver.
 
Number constr_viol_tol_
 Constraint violation tolerance on unscaled problem.
 

Additional Inherited Members

- Protected Member Functions inherited from Ipopt::AlgorithmStrategyObject
const JournalistJnlst () const
 
IpoptNLPIpNLP () const
 
IpoptDataIpData () const
 
IpoptCalculatedQuantitiesIpCq () const
 
bool HaveIpData () const
 

Detailed Description

The main ipopt algorithm class.

Main Ipopt algorithm class, contains the main optimize method, handles the execution of the optimization. The constructor initializes the data structures through the nlp, and the Optimize method then assumes that everything is initialized and ready to go. After an optimization is complete, the user can access the solution through the passed in ip_data structure. Multiple calls to the Optimize method are allowed as long as the structure of the problem remains the same (i.e. starting point or nlp parameter changes only).

Definition at line 39 of file IpIpoptAlg.hpp.

Constructor & Destructor Documentation

◆ IpoptAlgorithm() [1/3]

Ipopt::IpoptAlgorithm::IpoptAlgorithm ( const SmartPtr< SearchDirectionCalculator > &  search_dir_calculator,
const SmartPtr< LineSearch > &  line_search,
const SmartPtr< MuUpdate > &  mu_update,
const SmartPtr< ConvergenceCheck > &  conv_check,
const SmartPtr< IterateInitializer > &  iterate_initializer,
const SmartPtr< IterationOutput > &  iter_output,
const SmartPtr< HessianUpdater > &  hessian_updater,
const SmartPtr< EqMultiplierCalculator > &  eq_multiplier_calculator = NULL,
const std::string &  linear_solver_name = "" 
)

Constructor.

The IpoptAlgorithm uses smart pointers for these passed-in pieces to make sure that a user of IpoptAlgoroithm cannot pass in an object created on the stack!

The optional linear_solver_name is used for printing.

Parameters
search_dir_calculatorsearch direction calculator
line_searchline search
mu_updatemu updater
conv_checkconvergence check
iterate_initializeriterate initializer
iter_outputiteration output
hessian_updaterhessian updater
eq_multiplier_calculatorcalculator for multipliers
linear_solver_namename of linear solver
Since
3.14.0

◆ ~IpoptAlgorithm()

virtual Ipopt::IpoptAlgorithm::~IpoptAlgorithm ( )
virtual

Destructor.

◆ IpoptAlgorithm() [2/3]

Ipopt::IpoptAlgorithm::IpoptAlgorithm ( )
private

Default Constructor.

◆ IpoptAlgorithm() [3/3]

Ipopt::IpoptAlgorithm::IpoptAlgorithm ( const IpoptAlgorithm )
private

Copy Constructor.

Member Function Documentation

◆ InitializeImpl()

virtual bool Ipopt::IpoptAlgorithm::InitializeImpl ( const OptionsList options,
const std::string &  prefix 
)
virtual

◆ Optimize()

SolverReturn Ipopt::IpoptAlgorithm::Optimize ( bool  isResto = false)

Main solve method.

◆ RegisterOptions()

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

Methods for IpoptType.

◆ SearchDirCalc()

SmartPtr< SearchDirectionCalculator > Ipopt::IpoptAlgorithm::SearchDirCalc ( )
inline

Definition at line 89 of file IpIpoptAlg.hpp.

◆ print_copyright_message()

static void Ipopt::IpoptAlgorithm::print_copyright_message ( const Journalist jnlst)
static

◆ operator=()

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

Default Assignment Operator.

◆ UpdateHessian()

void Ipopt::IpoptAlgorithm::UpdateHessian ( )
private

Method for updating the current Hessian.

This can either just evaluate the exact Hessian (based on the current iterate), or perform a quasi-Newton update.

◆ UpdateBarrierParameter()

bool Ipopt::IpoptAlgorithm::UpdateBarrierParameter ( )
private

Method to update the barrier parameter.

Returns
false, if the algorithm can't continue with the regular procedure and needs to revert to a fallback mechanism in the line search (such as restoration phase)

◆ ComputeSearchDirection()

bool Ipopt::IpoptAlgorithm::ComputeSearchDirection ( )
private

Method to setup the call to the PDSystemSolver.

Returns
false, if the algorithm can't continue with the regular procedure and needs to revert to a fallback mechanism in the line search (such as restoration phase)

◆ ComputeAcceptableTrialPoint()

void Ipopt::IpoptAlgorithm::ComputeAcceptableTrialPoint ( )
private

Method computing the new iterate (usually vialine search).

The acceptable point is the one in trial after return.

◆ AcceptTrialPoint()

void Ipopt::IpoptAlgorithm::AcceptTrialPoint ( )
private

Method for accepting the trial point as the new iteration, possibly after adjusting the variable bounds in the NLP.

◆ OutputIteration()

void Ipopt::IpoptAlgorithm::OutputIteration ( )
private

Do all the output for one iteration.

◆ InitializeIterates()

void Ipopt::IpoptAlgorithm::InitializeIterates ( )
private

Sets up initial values for the iterates.

Corrects the initial values for x and s (force in bounds)

◆ PrintProblemStatistics()

void Ipopt::IpoptAlgorithm::PrintProblemStatistics ( )
private

Print the problem size statistics.

◆ ComputeFeasibilityMultipliers()

void Ipopt::IpoptAlgorithm::ComputeFeasibilityMultipliers ( )
private

Tries to compute Lagrangian multipliers for a feasibility problem.

Only computes multipliers if primal feasible but not converged yet. Restores current iterate if multiplier computation fails or new point does not satisfy convergence criteria, too.

◆ ComputeFeasibilityMultipliersPostprocess()

void Ipopt::IpoptAlgorithm::ComputeFeasibilityMultipliersPostprocess ( )
private

Compute the Lagrangian multipliers for a feasibility problem in post processing.

Always tries to compute multipliers and does not restore current iterate if failing.

◆ calc_number_of_bounds()

void Ipopt::IpoptAlgorithm::calc_number_of_bounds ( const Vector x,
const Vector x_L,
const Vector x_U,
const Matrix Px_L,
const Matrix Px_U,
Index n_tot,
Index n_only_lower,
Index n_both,
Index n_only_upper 
)
private

◆ correct_bound_multiplier()

Number Ipopt::IpoptAlgorithm::correct_bound_multiplier ( const Vector trial_z,
const Vector trial_slack,
const Vector trial_compl,
SmartPtr< const Vector > &  new_trial_z 
)
private

Method for ensuring that the trial multipliers are not too far from the primal estime.

If a correction is made, new_trial_z is a pointer to the corrected multiplier, and the return value of this method give the magnitutde of the largest correction that we done. If no correction was made, new_trial_z is just a pointer to trial_z, and the return value is zero.

Member Data Documentation

◆ search_dir_calculator_

SmartPtr<SearchDirectionCalculator> Ipopt::IpoptAlgorithm::search_dir_calculator_
private

Definition at line 126 of file IpIpoptAlg.hpp.

◆ line_search_

SmartPtr<LineSearch> Ipopt::IpoptAlgorithm::line_search_
private

Definition at line 127 of file IpIpoptAlg.hpp.

◆ mu_update_

SmartPtr<MuUpdate> Ipopt::IpoptAlgorithm::mu_update_
private

Definition at line 128 of file IpIpoptAlg.hpp.

◆ conv_check_

SmartPtr<ConvergenceCheck> Ipopt::IpoptAlgorithm::conv_check_
private

Definition at line 129 of file IpIpoptAlg.hpp.

◆ iterate_initializer_

SmartPtr<IterateInitializer> Ipopt::IpoptAlgorithm::iterate_initializer_
private

Definition at line 130 of file IpIpoptAlg.hpp.

◆ iter_output_

SmartPtr<IterationOutput> Ipopt::IpoptAlgorithm::iter_output_
private

Definition at line 131 of file IpIpoptAlg.hpp.

◆ hessian_updater_

SmartPtr<HessianUpdater> Ipopt::IpoptAlgorithm::hessian_updater_
private

Definition at line 132 of file IpIpoptAlg.hpp.

◆ eq_multiplier_calculator_

SmartPtr<EqMultiplierCalculator> Ipopt::IpoptAlgorithm::eq_multiplier_calculator_
private

The multiplier calculator (for y_c and y_d) has to be set only if option recalc_y is set to true.

If set, then it is also used to compute the dual multipliers for square problems.

Definition at line 138 of file IpIpoptAlg.hpp.

◆ skip_print_problem_stats_

bool Ipopt::IpoptAlgorithm::skip_print_problem_stats_
private

Flag indicating if the statistic should not be printed.

Definition at line 206 of file IpIpoptAlg.hpp.

◆ kappa_sigma_

Number Ipopt::IpoptAlgorithm::kappa_sigma_
private

safeguard factor for bound multipliers.

If value >= 1, then the dual variables will never deviate from the primal estimate by more than the factors kappa_sigma and 1./kappa_sigma.

Definition at line 217 of file IpIpoptAlg.hpp.

◆ recalc_y_

bool Ipopt::IpoptAlgorithm::recalc_y_
private

Flag indicating whether the y multipliers should be recalculated with the eq_mutliplier_calculator object for each new point.

Definition at line 222 of file IpIpoptAlg.hpp.

◆ recalc_y_feas_tol_

Number Ipopt::IpoptAlgorithm::recalc_y_feas_tol_
private

Feasibility threshold for recalc_y.

Definition at line 224 of file IpIpoptAlg.hpp.

◆ mehrotra_algorithm_

bool Ipopt::IpoptAlgorithm::mehrotra_algorithm_
private

Flag indicating if we want to do Mehrotras's algorithm.

This means that a number of options are ignored, or have to be set (or are automatically set) to certain values.

Definition at line 230 of file IpIpoptAlg.hpp.

◆ linear_solver_name_

std::string Ipopt::IpoptAlgorithm::linear_solver_name_
private

String specifying linear solver.

Definition at line 232 of file IpIpoptAlg.hpp.

◆ constr_viol_tol_

Number Ipopt::IpoptAlgorithm::constr_viol_tol_
private

Constraint violation tolerance on unscaled problem.

Definition at line 234 of file IpIpoptAlg.hpp.


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