Pipal  1.2.0
Penalty Interior-Point ALgorithm
Loading...
Searching...
No Matches
Pipal::Solver< Real > Class Template Reference

Solver class for the Pipal library. More...

#include <Solver.hxx>

Public Types

using ProblemPtr = typename Problem<Real>::UniquePtr
using ObjectiveFunc = typename ProblemWrapper<Real>::ObjectiveFunc
using ObjectiveGradientFunc = typename ProblemWrapper<Real>::ObjectiveGradientFunc
using ConstraintsFunc = typename ProblemWrapper<Real>::ConstraintsFunc
using ConstraintsJacobianFunc = typename ProblemWrapper<Real>::ConstraintsJacobianFunc
using LagrangianHessianFunc = typename ProblemWrapper<Real>::LagrangianHessianFunc
using BoundsFunc = typename ProblemWrapper<Real>::BoundsFunc

Public Member Functions

 Solver ()=default
 Default constructor for the Pipal class.
 Solver (std::string const &name, ObjectiveFunc const &objective, ObjectiveGradientFunc const &objective_gradient, ConstraintsFunc const &constraints, ConstraintsJacobianFunc const &constraints_jacobian, LagrangianHessianFunc const &lagrangian_hessian, BoundsFunc const &primal_lower_bounds, BoundsFunc const &primal_upper_bounds, BoundsFunc const &constraints_lower_bounds, BoundsFunc const &constraints_upper_bounds)
 Constructor for the Pipal class.
 Solver (ProblemPtr &&problem)
 Constructor for the Pipal class (with a unique pointer to a Problem object).
 Solver (Solver const &)=delete
 Deleted copy constructor.
Solveroperator= (Solver const &)=delete
 Deleted assignment operator.
 Solver (Solver &&)=delete
 Deleted move constructor.
Solveroperator= (Solver &&)=delete
 Deleted move assignment operator.
 ~Solver ()=default
 Destructor for the Pipal class.
void problem (ProblemPtr &&problem)
 Set the problem to be solved using a unique pointer.
Problem< Real > const & problem () const
 Get the problem being solved.
bool verbose_mode () const
 Get the verbose mode.
void verbose_mode (bool const t_verbose)
 Set the verbose mode.
bool bfgs () const
 Get the BFGS mode.
void bfgs (bool const t_bfgs)
 Set the BFGS mode.
Algorithm algorithm () const
 Get the algorithm mode.
void algorithm (Algorithm const t_algorithm)
 Set the algorithm mode.
void tolerance (Real const t_tolerance)
 Set the convergence tolerance for the solver.
Real tolerance () const
 Get the tolerance for convergence.
void max_iterations (Integer const t_max_iterations)
 Set the maximum number of iterations for the solver.
Integer max_iterations () const
 Get the maximum number of iterations.
bool optimize (Vector< Real > const &x_guess, Vector< Real > &x_sol)
 Solves the optimization problem using the interior-point method.
void getSolution (Vector< Real > &x, Vector< Real > &l)
 Extract a primal-dual solution in original ordering.

Private Member Functions

void buildIterate ()
 Initialize an Iterate object for a given problem/input.
void evalStep ()
 Compute the search direction for the current iterate.
void updateParameters ()
 Update penalty and interior-point parameters based on KKT errors.
void lineSearch ()
 Line-search driver.
void bfgsUpdate (Vector< Real > const &s, Vector< Real > const &y)
 Browder-Broyden-Fletcher-Goldfarb-Shanno (BFGS) update for the Hessian approximation.
void updateIterate ()
 Update the iterate after a trial step is accepted.
void updatePoint ()
 Apply a step to the primal and dual variables of the iterate.
void backtracking ()
 Backtracking line search.
void evalFunctions ()
 Evaluate objective and constraint functions at the current iterate.
void evalGradients ()
 Evaluate objective gradient and constraint Jacobian.
void evalHessian ()
 Evaluate the Hessian of the Lagrangian and assemble internal H.
void evalNewtonMatrix ()
 Assemble and (attempt to) factorize the Newton system matrix.
void evalScalings ()
 Evaluate scaling multipliers for objective and constraints.
void evalModels ()
 Evaluate model reductions and quality metric for a direction.
void fractionToBoundary ()
 Fraction-to-boundary rule for primal and dual variables.
void evalNewtonRhs ()
 Build the right-hand side vector for the Newton system.
void evalSlacks ()
 Compute internal slack variables from current iterate.
void evalMerit ()
 Compute the merit function value for the current iterate.
void initNewtonMatrix ()
 Reserve and initialize the internal sparse Newton matrix structure.
void resetDirection (Direction< Real > &d) const
 Reset a search direction to zero and initialize norms.
void evalLambdaOriginal (Vector< Real > &l) const
 Reconstruct multipliers in the original variable/constraint space.
Real evalViolation (Array< Real > const &cE, Array< Real > const &cI) const
 Compute the 1-norm feasibility violation from equality/inequality values.
void evalNewtonStep ()
 Recover direction components from the Newton system solution.
void evalTrialStep (Direction< Real > &v) const
 Store a trial step into another direction object.
Integer checkTermination () const
 Check termination criteria for the solver.
Integer fullStepCheck ()
 Full-step check for trial penalty parameters.
Integer secondOrderCorrection ()
 Second-order correction (SOC).
void evalXOriginal (Vector< Real > &x)
 Reconstruct the full primal vector in the original variable ordering.
void setDirection (Vector< Real > const &dx, Vector< Real > const &dr1, Vector< Real > const &dr2, Vector< Real > const &ds1, Vector< Real > const &ds2, Vector< Real > const &dlE, Vector< Real > const &dlI, Real const dx_norm, Real const dl_norm)
 Populate a Direction object from its component vectors.
void evalTrialSteps (Direction< Real > &d1, Direction< Real > &d2, Direction< Real > &d3)
 Compute and store directions for a few parameter combinations.
void evalTrialStepCut ()
 Scale a trial step by the fraction-to-boundary values.
void evalLinearCombination (Direction< Real > const &d1, Direction< Real > const &d2, Direction< Real > const &d3, Real const a1, Real const a2, Real const a3)
 Evaluate a linear combination of up to three directions.
Real evalKKTError (Real const rho, Real const mu)
 Compute the infinity-norm of the KKT optimality vector.
void evalKKTErrors ()
 Compute the three KKT error measures used by the solver.
void setPrimals (Vector< Real > const &x, Array< Real > const &r1, Array< Real > const &r2, Array< Real > const &s1, Array< Real > const &s2, Array< Real > const &lE, Array< Real > const &lI, Real const f, Array< Real > const &cE, Array< Real > const &cI, Real const phi)
 Set primal/dual blocks and associated quantities on an iterate.
void buildInput (std::string const &name, Vector< Real > const &x0, Vector< Real > const &bl, Vector< Real > const &bu, Vector< Real > const &cl, Vector< Real > const &cu)
 Build the input data for the solver.
void evalInfeasibility (Iterate< Real > &z) const
 Compute scaled and unscaled feasibility violations.
void resetMuMaxExp ()
 Reset maximum exponent used for mu increases to its default.
void buildParameter (Algorithm t_algorithm)
 Initialize algorithm parameters.
void setMuMaxExpZero ()
 Force mu exponent increases to use zero as maximum exponent.
void setRho (Real const rho)
 Set penalty parameter rho.
void setRhoLast (Real const rho)
 Set last (previous) penalty parameter value.
void setMu (Real const mu)
 Set interior-point parameter mu.
void evalDependent ()
 Evaluate quantities that depend on penalty/interior parameters.
void resetCounter ()
 Reset all internal counters to zero.
void incrementFactorizationCount ()
 Increment the matrix factorization counter.
void incrementFunctionCount ()
 Increment the function evaluation counter.
void incrementGradientCount ()
 Increment the gradient evaluation counter.
void incrementHessianCount ()
 Increment the Hessian evaluation counter.
void incrementIterationCount ()
 Increment the iteration counter.

Private Attributes

Counter m_counter
Acceptance< Real > m_acceptance
Input< Real > m_input
Direction< Real > m_direction
Iterate< Real > m_iterate
Output< Real > m_output
Parameter< Real > m_parameter
ProblemPtr m_problem
bool m_verbose {false}
bool m_bfgs {false}

Detailed Description

template<typename Real>
class Pipal::Solver< Real >

The Solver class provides an interface for solving the optimization problems using Frank E. Curtis Pipal algorithm. It utilizes the Problem class to define the optimization problem and implements various methods for solving it.

Template Parameters
RealThe floating-point type used for computations (e.g., float, double).

Member Typedef Documentation

◆ BoundsFunc

template<typename Real>
using Pipal::Solver< Real >::BoundsFunc = typename ProblemWrapper<Real>::BoundsFunc

◆ ConstraintsFunc

template<typename Real>
using Pipal::Solver< Real >::ConstraintsFunc = typename ProblemWrapper<Real>::ConstraintsFunc

◆ ConstraintsJacobianFunc

template<typename Real>
using Pipal::Solver< Real >::ConstraintsJacobianFunc = typename ProblemWrapper<Real>::ConstraintsJacobianFunc

◆ LagrangianHessianFunc

template<typename Real>
using Pipal::Solver< Real >::LagrangianHessianFunc = typename ProblemWrapper<Real>::LagrangianHessianFunc

◆ ObjectiveFunc

template<typename Real>
using Pipal::Solver< Real >::ObjectiveFunc = typename ProblemWrapper<Real>::ObjectiveFunc

◆ ObjectiveGradientFunc

template<typename Real>
using Pipal::Solver< Real >::ObjectiveGradientFunc = typename ProblemWrapper<Real>::ObjectiveGradientFunc

◆ ProblemPtr

template<typename Real>
using Pipal::Solver< Real >::ProblemPtr = typename Problem<Real>::UniquePtr

Constructor & Destructor Documentation

◆ Solver() [1/5]

template<typename Real>
Pipal::Solver< Real >::Solver ( )
default

Initializes the solver with default values for the objective, gradient, constraints, and Jacobian functions.

◆ Solver() [2/5]

template<typename Real>
Pipal::Solver< Real >::Solver ( std::string const & name,
ObjectiveFunc const & objective,
ObjectiveGradientFunc const & objective_gradient,
ConstraintsFunc const & constraints,
ConstraintsJacobianFunc const & constraints_jacobian,
LagrangianHessianFunc const & lagrangian_hessian,
BoundsFunc const & primal_lower_bounds,
BoundsFunc const & primal_upper_bounds,
BoundsFunc const & constraints_lower_bounds,
BoundsFunc const & constraints_upper_bounds )
inline

Initializes the solver with the provided objective, gradient, constraints, and Jacobian functions.

Parameters
[in]nameName of the optimization problem.
[in]objectiveObjective function handle.
[in]objective_gradientGradient of the objective function handle.
[in]constraintsConstraints function handle.
[in]constraints_jacobianJacobian of the constraints function handle.
[in]lagrangian_hessianHessian of the Lagrangian function handle.
[in]primal_lower_boundsLower bounds on the primal variables handle.
[in]primal_upper_boundsUpper bounds on the primal variables handle.
[in]constraints_lower_boundsLower bounds on the constraints handle.
[in]constraints_upper_boundsUpper bounds on the constraints handle.

◆ Solver() [3/5]

template<typename Real>
Pipal::Solver< Real >::Solver ( ProblemPtr && problem)
inline

Initializes the solver with the provided unique pointer to a Problem object.

Parameters
[in]problemThe unique pointer to the Problem object to use.
Warning
The pointer is moved into the solver, so it should not be used after this call.

◆ Solver() [4/5]

template<typename Real>
Pipal::Solver< Real >::Solver ( Solver< Real > const & )
delete
Note
This class is not copyable.

◆ Solver() [5/5]

template<typename Real>
Pipal::Solver< Real >::Solver ( Solver< Real > && )
delete
Note
This class is not movable.

◆ ~Solver()

template<typename Real>
Pipal::Solver< Real >::~Solver ( )
default

Cleans up resources used by the solver.

Member Function Documentation

◆ algorithm() [1/2]

template<typename Real>
Algorithm Pipal::Solver< Real >::algorithm ( ) const
inline
Returns
The algorithm mode.

◆ algorithm() [2/2]

template<typename Real>
void Pipal::Solver< Real >::algorithm ( Algorithm const t_algorithm)
inline

This method allows the user to specify the algorithm mode, which can be either CONSERVATIVE or ADAPTIVE.

Parameters
[in]t_algorithmThe algorithm mode.

◆ backtracking()

template<typename Real>
void Pipal::Solver< Real >::backtracking ( )
private

Performs a backtracking Armijo line search on the merit function. The routine updates the trial primal/dual variables using the candidate direction and the current acceptance object. On success the iterate is restored to the accepted trial point; otherwise the steplength is reduced until the Armijo condition or the fraction-to-boundary constraint prevents further reductions.

◆ bfgs() [1/2]

template<typename Real>
bool Pipal::Solver< Real >::bfgs ( ) const
inline
Returns
The BFGS mode.

◆ bfgs() [2/2]

template<typename Real>
void Pipal::Solver< Real >::bfgs ( bool const t_bfgs)
inline
Parameters
[in]t_bfgsThe BFGS mode.

◆ bfgsUpdate()

template<typename Real>
void Pipal::Solver< Real >::bfgsUpdate ( Vector< Real > const & s,
Vector< Real > const & y )
private

This method updates the Hessian approximation using the Browder-Broyden-Fletcher-Goldfarb-Shanno (BFGS) formula*

\[ \mathbf{B}_{k+1} = \mathbf{B}_{k} - \displaystyle\frac{(\mathbf{B}_{k}\mathbf{s}_{k})( \mathbf{B}_{k}\mathbf{s}_{k}^\top)}{\mathbf{s}_{k}^\top \mathbf{B}_{k}\mathbf{s}_{k}} + \displaystyle\frac{\mathbf{y}\mathbf{y}^\top)}{\mathbf{y}^\top\mathbf{s}_{k}} \]

where \(B\) is the current Hessian approximation, \(s\) is the step taken, and \(y\) is the gradient difference.

Note
The condition \(y^\top s > 0\) must be satisfied for the update to be valid.
Template Parameters
RealFloating-point type used by the algorithm.
Parameters
[in]sStep taken in primal variables.
[in]yDifference in gradients.
Returns
Updated Hessian approximation.

◆ buildInput()

template<typename Real>
void Pipal::Solver< Real >::buildInput ( std::string const & name,
Vector< Real > const & x0,
Vector< Real > const & bl,
Vector< Real > const & bu,
Vector< Real > const & cl,
Vector< Real > const & cu )
private
Parameters
[in]nameProblem name.
[in]x0Initial guess for the solution.
[in]blLower bounds for the variables.
[in]buUpper bounds for the variables.
[in]clLower bounds for the constraints.
[in]cuUpper bounds for the constraints.

◆ buildIterate()

template<typename Real>
void Pipal::Solver< Real >::buildIterate ( )
private
Template Parameters
RealFloating-point type used by the algorithm.

◆ buildParameter()

template<typename Real>
void Pipal::Solver< Real >::buildParameter ( Algorithm t_algorithm)
inlineprivate
Parameters
[in]t_algorithmAlgorithm selection enumerator.

◆ checkTermination()

template<typename Real>
Integer Pipal::Solver< Real >::checkTermination ( ) const
private

Evaluates optimality/feasibility/iteration-count/bounds error conditions and returns the termination code used by the solver.

Template Parameters
RealFloating-point type used by the algorithm.
Returns
An integer termination code (0 = continue, 1..5 = specific exits).

◆ evalDependent()

template<typename Real>
void Pipal::Solver< Real >::evalDependent ( )
inlineprivate

Runs slack, merit and KKT-error evaluations that are functions of the current penalty and interior-point parameters.

◆ evalFunctions()

template<typename Real>
void Pipal::Solver< Real >::evalFunctions ( )
private
Template Parameters
RealFloating-point type used by the algorithm.

◆ evalGradients()

template<typename Real>
void Pipal::Solver< Real >::evalGradients ( )
private

Calls the problem-provided gradient/jacobian functions in the original space, maps the results into the internal compressed representations and applies scaling. Increments gradient counters and handles exceptions.

Template Parameters
RealFloating-point type used by the algorithm.

◆ evalHessian()

template<typename Real>
void Pipal::Solver< Real >::evalHessian ( )
private

Calls the problem's Hessian-of-Lagrangian routine (with multipliers and primal variables in the original space), maps blocks into the internal sparse Hessian and rescales according to penalization and scaling factors.

Template Parameters
RealFloating-point type used by the algorithm.

◆ evalInfeasibility()

template<typename Real>
void Pipal::Solver< Real >::evalInfeasibility ( Iterate< Real > & z) const
inlineprivate
Template Parameters
RealFloating-point type used by the algorithm.
Parameters
[in]zCurrent iterate.

◆ evalKKTError()

template<typename Real>
Real Pipal::Solver< Real >::evalKKTError ( Real const rho,
Real const mu )
private
Template Parameters
RealFloating-point type used by the algorithm.
Parameters
[in]rhoCurrent penalty parameter.
[in]muCurrent interior-point parameter.
Returns
The infinity-norm of the KKT optimality vector.

◆ evalKKTErrors()

template<typename Real>
void Pipal::Solver< Real >::evalKKTErrors ( )
private
Template Parameters
RealFloating-point type used by the algorithm.

◆ evalLambdaOriginal()

template<typename Real>
void Pipal::Solver< Real >::evalLambdaOriginal ( Vector< Real > & l) const
private
Template Parameters
RealFloating-point type used by the algorithm.
Parameters
[out]lVector to store multipliers in original space.

◆ evalLinearCombination()

template<typename Real>
void Pipal::Solver< Real >::evalLinearCombination ( Direction< Real > const & d1,
Direction< Real > const & d2,
Direction< Real > const & d3,
Real const a1,
Real const a2,
Real const a3 )
private
Template Parameters
RealFloating-point type used by the algorithm.
Parameters
[in]d1First direction.
[in]d2Second direction.
[in]d3Third direction.
[in]a1Scalar multiplier for the first direction.
[in]a2Scalar multiplier for the second direction.
[in]a3Scalar multiplier for the third direction.

◆ evalMerit()

template<typename Real>
void Pipal::Solver< Real >::evalMerit ( )
private
Template Parameters
RealFloating-point type used by the algorithm.

◆ evalModels()

template<typename Real>
void Pipal::Solver< Real >::evalModels ( )
private
Template Parameters
RealFloating-point type used by the algorithm.

◆ evalNewtonMatrix()

template<typename Real>
void Pipal::Solver< Real >::evalNewtonMatrix ( )
private
Template Parameters
RealFloating-point type used by the algorithm.

◆ evalNewtonRhs()

template<typename Real>
void Pipal::Solver< Real >::evalNewtonRhs ( )
private
Template Parameters
RealFloating-point type used by the algorithm.

◆ evalNewtonStep()

template<typename Real>
void Pipal::Solver< Real >::evalNewtonStep ( )
private
Template Parameters
RealFloating-point type used by the algorithm.

◆ evalScalings()

template<typename Real>
void Pipal::Solver< Real >::evalScalings ( )
private
Template Parameters
RealFloating-point type used by the algorithm.

◆ evalSlacks()

template<typename Real>
void Pipal::Solver< Real >::evalSlacks ( )
private
Template Parameters
RealFloating-point type used by the algorithm.

◆ evalStep()

template<typename Real>
void Pipal::Solver< Real >::evalStep ( )
private
Template Parameters
RealFloating-point type used by the algorithm.

◆ evalTrialStep()

template<typename Real>
void Pipal::Solver< Real >::evalTrialStep ( Direction< Real > & v) const
private
Template Parameters
RealFloating-point type used by the algorithm.
Parameters
[out]vDestination direction that will contain the trial step.

◆ evalTrialStepCut()

template<typename Real>
void Pipal::Solver< Real >::evalTrialStepCut ( )
private
Template Parameters
RealFloating-point type used by the algorithm.

◆ evalTrialSteps()

template<typename Real>
void Pipal::Solver< Real >::evalTrialSteps ( Direction< Real > & d1,
Direction< Real > & d2,
Direction< Real > & d3 )
private
Template Parameters
RealFloating-point type used by the algorithm.
Parameters
[out]d1Direction for the first parameter combination.
[out]d2Direction for the second parameter combination.
[out]d3Direction for the third parameter combination.

◆ evalViolation()

template<typename Real>
Real Pipal::Solver< Real >::evalViolation ( Array< Real > const & cE,
Array< Real > const & cI ) const
private
Template Parameters
RealFloating-point type used by the algorithm.
Parameters
[in]cEEquality constraint values.
[in]cIInequality constraint values.
Returns
The 1-norm feasibility violation.

◆ evalXOriginal()

template<typename Real>
void Pipal::Solver< Real >::evalXOriginal ( Vector< Real > & x)
private
Template Parameters
RealFloating-point type used by the algorithm.
Parameters
[out]xVector to store primal variables in original space.

◆ fractionToBoundary()

template<typename Real>
void Pipal::Solver< Real >::fractionToBoundary ( )
private

Computes the maximum allowable primal and dual step fractions that keep interior-point slacks and multipliers within their prescribed bounds. The computed values are stored in the a.p0 (initial primal fraction), a.p (primal steplength) and a.d (dual steplength).

Template Parameters
RealFloating-point type used by the algorithm.

◆ fullStepCheck()

template<typename Real>
Integer Pipal::Solver< Real >::fullStepCheck ( )
private

Attempts full steps for a sequence of trial penalty parameters, verifying the Armijo condition on the merit. If a full step satisfies the acceptance condition the routine returns 1 and the iterate is left at the accepted trial point; otherwise the penalty parameter is decreased and the process repeats.

Template Parameters
RealFloating-point type used by the algorithm.
Returns
1 if a full step was accepted, 0 otherwise.

◆ getSolution()

template<typename Real>
void Pipal::Solver< Real >::getSolution ( Vector< Real > & x,
Vector< Real > & l )
inline
Template Parameters
RealFloating-point type used by the algorithm.
Parameters
[out]xVector to store primal variables in original space.
[out]lVector to store multipliers in original space.

◆ incrementFactorizationCount()

template<typename Real>
void Pipal::Solver< Real >::incrementFactorizationCount ( )
inlineprivate

◆ incrementFunctionCount()

template<typename Real>
void Pipal::Solver< Real >::incrementFunctionCount ( )
inlineprivate

◆ incrementGradientCount()

template<typename Real>
void Pipal::Solver< Real >::incrementGradientCount ( )
inlineprivate

◆ incrementHessianCount()

template<typename Real>
void Pipal::Solver< Real >::incrementHessianCount ( )
inlineprivate

◆ incrementIterationCount()

template<typename Real>
void Pipal::Solver< Real >::incrementIterationCount ( )
inlineprivate

◆ initNewtonMatrix()

template<typename Real>
void Pipal::Solver< Real >::initNewtonMatrix ( )
private
Template Parameters
RealFloating-point type used by the algorithm.

◆ lineSearch()

template<typename Real>
void Pipal::Solver< Real >::lineSearch ( )
private

Runs the fraction-to-boundary rule, full-step check, second-order correction and backtracking as needed to find an acceptable trial step. The acceptance object is updated with the final chosen step.

Template Parameters
RealFloating-point type used by the algorithm.

◆ max_iterations() [1/2]

template<typename Real>
Integer Pipal::Solver< Real >::max_iterations ( ) const
inline
Returns
The maximum number of iterations.

◆ max_iterations() [2/2]

template<typename Real>
void Pipal::Solver< Real >::max_iterations ( Integer const t_max_iterations)
inline

This method allows the user to specify the maximum number of iterations the solver will perform before stopping.

Parameters
[in]t_max_iterationsThe maximum number of iterations.

◆ operator=() [1/2]

template<typename Real>
Solver & Pipal::Solver< Real >::operator= ( Solver< Real > && )
delete
Note
This class is not movable.

◆ operator=() [2/2]

template<typename Real>
Solver & Pipal::Solver< Real >::operator= ( Solver< Real > const & )
delete
Note
This class is not assignable.

◆ optimize()

template<typename Real>
bool Pipal::Solver< Real >::optimize ( Vector< Real > const & x_guess,
Vector< Real > & x_sol )
inline

This method implements the interior-point algorithm to solve the optimization problem defined by the objective function, constraints, and their respective gradients and Jacobians.

Parameters
[in]x_guessInitial guess for the optimization variables.
[out]x_solSolution vector.
Returns
True if the optimization was successful, false otherwise.

◆ problem() [1/2]

template<typename Real>
Problem< Real > const & Pipal::Solver< Real >::problem ( ) const
inline
Returns
A reference to the problem.

◆ problem() [2/2]

template<typename Real>
void Pipal::Solver< Real >::problem ( ProblemPtr && problem)
inline

This method allows the user to specify the problem to be solved using a unique pointer.

Parameters
[in]problemThe unique pointer to the problem to set.

◆ resetCounter()

template<typename Real>
void Pipal::Solver< Real >::resetCounter ( )
inlineprivate

◆ resetDirection()

template<typename Real>
void Pipal::Solver< Real >::resetDirection ( Direction< Real > & d) const
private
Template Parameters
RealFloating-point type used by the algorithm.
Parameters
[in]dDirection object to reset.

◆ resetMuMaxExp()

template<typename Real>
void Pipal::Solver< Real >::resetMuMaxExp ( )
inlineprivate
Template Parameters
RealFloating-point type used by the algorithm.

◆ secondOrderCorrection()

template<typename Real>
Integer Pipal::Solver< Real >::secondOrderCorrection ( )
private

Attempts a second-order correction to improve feasibility when the trial step fails the Armijo condition (or other checks). The routine evaluates a corrected Newton step and tests acceptance similarly to the main line-search path.

Template Parameters
RealFloating-point type used by the algorithm.
Returns
0 if SOC not accepted, 1 if first acceptance criterion met, 2 if SOC accepted.

◆ setDirection()

template<typename Real>
void Pipal::Solver< Real >::setDirection ( Vector< Real > const & dx,
Vector< Real > const & dr1,
Vector< Real > const & dr2,
Vector< Real > const & ds1,
Vector< Real > const & ds2,
Vector< Real > const & dlE,
Vector< Real > const & dlI,
Real const dx_norm,
Real const dl_norm )
private
Template Parameters
RealFloating-point type used by the algorithm.
Parameters
[in]dxPrimal component of the direction.
[in]dr1Equality slack direction (first part).
[in]dr2Equality slack direction (second part).
[in]ds1Inequality slack direction (first part).
[in]ds2Inequality slack direction (second part).
[in]dlEEquality multipliers direction.
[in]dlIInequality multipliers direction.
[in]dx_normNorm of the primal direction (precomputed).
[in]dl_normNorm of the dual direction (precomputed).

◆ setMu()

template<typename Real>
void Pipal::Solver< Real >::setMu ( Real const mu)
inlineprivate
Template Parameters
RealFloating-point type used by the algorithm.
Parameters
[in]muNew interior-point parameter value.

◆ setMuMaxExpZero()

template<typename Real>
void Pipal::Solver< Real >::setMuMaxExpZero ( )
inlineprivate

◆ setPrimals()

template<typename Real>
void Pipal::Solver< Real >::setPrimals ( Vector< Real > const & x,
Array< Real > const & r1,
Array< Real > const & r2,
Array< Real > const & s1,
Array< Real > const & s2,
Array< Real > const & lE,
Array< Real > const & lI,
Real const f,
Array< Real > const & cE,
Array< Real > const & cI,
Real const phi )
private
Template Parameters
RealFloating-point type used by the algorithm.
Parameters
[in]xPrimal variable vector.
[in]r1Equality constraint slack variables (lower).
[in]r2Equality constraint slack variables (upper).
[in]s1Inequality constraint slack variables (lower).
[in]s2Inequality constraint slack variables (upper).
[in]lEEquality constraint multipliers.
[in]lIInequality constraint multipliers.
[in]fObjective function value.
[in]cEEquality constraint values.
[in]cIInequality constraint values.
[in]phiMerit function value.

◆ setRho()

template<typename Real>
void Pipal::Solver< Real >::setRho ( Real const rho)
inlineprivate
Template Parameters
RealFloating-point type used by the algorithm.
Parameters
[in]rhoNew penalty parameter value.

◆ setRhoLast()

template<typename Real>
void Pipal::Solver< Real >::setRhoLast ( Real const rho)
inlineprivate
Template Parameters
RealFloating-point type used by the algorithm.
Parameters
[in]rhoNew last penalty parameter value.

◆ tolerance() [1/2]

template<typename Real>
Real Pipal::Solver< Real >::tolerance ( ) const
inline
Returns
The tolerance for convergence.

◆ tolerance() [2/2]

template<typename Real>
void Pipal::Solver< Real >::tolerance ( Real const t_tolerance)
inline

This method allows the user to specify the tolerance for convergence. The solver will stop when the residuals are below this tolerance.

Parameters
[in]t_toleranceThe convergence tolerance.

◆ updateIterate()

template<typename Real>
void Pipal::Solver< Real >::updateIterate ( )
private

Applies the accepted step to the iterate, recomputes infeasibility and gradients and updates parameter memory used for adaptive strategies.

Template Parameters
RealFloating-point type used by the algorithm.

◆ updateParameters()

template<typename Real>
void Pipal::Solver< Real >::updateParameters ( )
private

Adjusts rho and mu using the solver's adaptive rules to drive optimality and feasibility towards the desired tolerances.

Template Parameters
RealFloating-point type used by the algorithm.

◆ updatePoint()

template<typename Real>
void Pipal::Solver< Real >::updatePoint ( )
private
Template Parameters
RealFloating-point type used by the algorithm.

◆ verbose_mode() [1/2]

template<typename Real>
bool Pipal::Solver< Real >::verbose_mode ( ) const
inline
Returns
The verbose mode.

◆ verbose_mode() [2/2]

template<typename Real>
void Pipal::Solver< Real >::verbose_mode ( bool const t_verbose)
inline
Parameters
[in]t_verboseThe verbose mode.

Member Data Documentation

◆ m_acceptance

template<typename Real>
Acceptance<Real> Pipal::Solver< Real >::m_acceptance
private

Acceptance criteria for trial points.

◆ m_bfgs

template<typename Real>
bool Pipal::Solver< Real >::m_bfgs {false}
private

BFGS update flag.

◆ m_counter

template<typename Real>
Counter Pipal::Solver< Real >::m_counter
private

Internal counters for solver statistics.

◆ m_direction

template<typename Real>
Direction<Real> Pipal::Solver< Real >::m_direction
private

Current search direction of the solver.

◆ m_input

template<typename Real>
Input<Real> Pipal::Solver< Real >::m_input
private

Input structure for the solver.

◆ m_iterate

template<typename Real>
Iterate<Real> Pipal::Solver< Real >::m_iterate
private

Current iterate of the solver.

◆ m_output

template<typename Real>
Output<Real> Pipal::Solver< Real >::m_output
private

Output class for managing solver output.

◆ m_parameter

template<typename Real>
Parameter<Real> Pipal::Solver< Real >::m_parameter
private

Internal parameters for the solver algorithm.

◆ m_problem

template<typename Real>
ProblemPtr Pipal::Solver< Real >::m_problem
private

Problem object pointer.

◆ m_verbose

template<typename Real>
bool Pipal::Solver< Real >::m_verbose {false}
private

Verbosity flag.


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