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

Problem class for the Pipal library. More...

#include <Problem.hxx>

Inherited by Pipal::ProblemWrapper< Real >.

Public Types

using UniquePtr = std::unique_ptr<Problem>

Public Member Functions

 Problem ()=default
 Default constructor.
 Problem (std::string t_name)
 Problem constructor.
 Problem (Problem const &)=delete
 Deleted copy constructor.
Problemoperator= (Problem const &)=delete
 Deleted assignment operator.
 Problem (Problem &&)=delete
 Deleted move constructor.
Problemoperator= (Problem &&)=delete
 Deleted move assignment operator.
virtual ~Problem ()=default
 Default destructor.
std::string const & name () const
 Get the name of the optimization problem.
void name (std::string const &t_name)
 Set the name of the optimization problem.
virtual bool objective (Vector< Real > const &x, Real &out) const =0
 Evaluate the objective function.
virtual bool objective_gradient (Vector< Real > const &x, Vector< Real > &out) const =0
 Evaluate the gradient of the objective function.
virtual bool constraints (Vector< Real > const &x, Vector< Real > &out) const =0
 Evaluate the constraints function.
virtual bool constraints_jacobian (Vector< Real > const &x, SparseMatrix< Real > &out) const =0
 Evaluate the Jacobian of the constraints function with respect to the primal variables.
virtual bool lagrangian_hessian (Vector< Real > const &x, Vector< Real > const &l, SparseMatrix< Real > &out) const =0
 Evaluate the Hessian of the Lagrangian function with respect to the primal variables.
virtual bool primal_lower_bounds (Vector< Real > &out) const =0
 Lower bounds on the primal variables.
virtual bool primal_upper_bounds (Vector< Real > &out) const =0
 Upper bounds on the primal variables.
virtual bool constraints_lower_bounds (Vector< Real > &out) const =0
 Lower bounds on the constraints.
virtual bool constraints_upper_bounds (Vector< Real > &out) const =0
 Upper bounds on the constraints.

Private Attributes

std::string m_name {"(Unnamed Pipal Problem)"}

Detailed Description

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

The Problem class serves as a base class for defining optimization problems in the Pipal library. It provides a structure for encapsulating the problem's objective function, constraints, and other necessary components.

Template Parameters
RealThe real number type.

Member Typedef Documentation

◆ UniquePtr

template<typename Real>
using Pipal::Problem< Real >::UniquePtr = std::unique_ptr<Problem>

Constructor & Destructor Documentation

◆ Problem() [1/4]

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

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

◆ Problem() [2/4]

template<typename Real>
Pipal::Problem< Real >::Problem ( std::string t_name)
inline
Parameters
[in]t_nameName of the optimization problem.

◆ Problem() [3/4]

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

◆ Problem() [4/4]

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

◆ ~Problem()

template<typename Real>
virtual Pipal::Problem< Real >::~Problem ( )
virtualdefault

Member Function Documentation

◆ constraints()

template<typename Real>
virtual bool Pipal::Problem< Real >::constraints ( Vector< Real > const & x,
Vector< Real > & out ) const
pure virtual
Parameters
[in]xPrimal variables.
[out]outThe value of the constraints function.
Returns
True if the evaluation was successful, false otherwise.

Implemented in Pipal::ProblemWrapper< Real >.

◆ constraints_jacobian()

template<typename Real>
virtual bool Pipal::Problem< Real >::constraints_jacobian ( Vector< Real > const & x,
SparseMatrix< Real > & out ) const
pure virtual
Parameters
[in]xPrimal variables.
[out]outThe Jacobian matrix of the constraints function.
Returns
True if the evaluation was successful, false otherwise.

Implemented in Pipal::ProblemWrapper< Real >.

◆ constraints_lower_bounds()

template<typename Real>
virtual bool Pipal::Problem< Real >::constraints_lower_bounds ( Vector< Real > & out) const
pure virtual
Parameters
[out]outThe lower bounds on the constraints.
Returns
True if the evaluation was successful, false otherwise.

Implemented in Pipal::ProblemWrapper< Real >.

◆ constraints_upper_bounds()

template<typename Real>
virtual bool Pipal::Problem< Real >::constraints_upper_bounds ( Vector< Real > & out) const
pure virtual
Parameters
[out]outThe upper bounds on the constraints.
Returns
True if the evaluation was successful, false otherwise.

Implemented in Pipal::ProblemWrapper< Real >.

◆ lagrangian_hessian()

template<typename Real>
virtual bool Pipal::Problem< Real >::lagrangian_hessian ( Vector< Real > const & x,
Vector< Real > const & l,
SparseMatrix< Real > & out ) const
pure virtual
Parameters
[in]xPrimal variables.
[in]lDual variables.
[out]outThe Hessian matrix of the Lagrangian function.
Returns
True if the evaluation was successful, false otherwise.

Implemented in Pipal::ProblemWrapper< Real >.

◆ name() [1/2]

template<typename Real>
std::string const & Pipal::Problem< Real >::name ( ) const
inline
Returns
The name of the optimization problem.

◆ name() [2/2]

template<typename Real>
void Pipal::Problem< Real >::name ( std::string const & t_name)
inline
Parameters
[in]t_nameThe name of the optimization problem.

◆ objective()

template<typename Real>
virtual bool Pipal::Problem< Real >::objective ( Vector< Real > const & x,
Real & out ) const
pure virtual
Parameters
[in]xPrimal variables.
[out]outThe objective function.
Returns
True if the evaluation was successful, false otherwise.

Implemented in Pipal::ProblemWrapper< Real >.

◆ objective_gradient()

template<typename Real>
virtual bool Pipal::Problem< Real >::objective_gradient ( Vector< Real > const & x,
Vector< Real > & out ) const
pure virtual
Parameters
[in]xPrimal variables.
[out]outThe gradient of the objective function.
Returns
True if the evaluation was successful, false otherwise.

Implemented in Pipal::ProblemWrapper< Real >.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ primal_lower_bounds()

template<typename Real>
virtual bool Pipal::Problem< Real >::primal_lower_bounds ( Vector< Real > & out) const
pure virtual
Parameters
[out]outThe lower bounds on the primal variables.
Returns
True if the evaluation was successful, false otherwise.

Implemented in Pipal::ProblemWrapper< Real >.

◆ primal_upper_bounds()

template<typename Real>
virtual bool Pipal::Problem< Real >::primal_upper_bounds ( Vector< Real > & out) const
pure virtual
Parameters
[out]outThe upper bounds on the primal variables.
Returns
True if the evaluation was successful, false otherwise.

Implemented in Pipal::ProblemWrapper< Real >.

Member Data Documentation

◆ m_name

template<typename Real>
std::string Pipal::Problem< Real >::m_name {"(Unnamed Pipal Problem)"}
private

Name of the optimization problem.


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