alpaqa 0.0.1
Nonconvex constrained optimization
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Public Types | Public Member Functions | Public Attributes | List of all members
Problem Class Reference

#include <alpaqa/util/problem.hpp>

Detailed Description

Problem description for minimization problems.

minimizexf(x)f:RnRsubject toxxxzg(x)zg:RnRm

Examples
CUTEst/Rosenbrock/main.cpp, and CasADi/Rosenbrock/main.cpp.

Definition at line 26 of file include/alpaqa/util/problem.hpp.

+ Inheritance diagram for Problem:
+ Collaboration diagram for Problem:

Public Types

using f_sig = real_t(crvec x)
 Signature of the function that evaluates the cost f(x). More...
 
using grad_f_sig = void(crvec x, rvec grad_fx)
 Signature of the function that evaluates the gradient of the cost function f(x). More...
 
using g_sig = void(crvec x, rvec gx)
 Signature of the function that evaluates the constraints g(x). More...
 
using grad_g_prod_sig = void(crvec x, crvec y, rvec grad_gxy)
 Signature of the function that evaluates the gradient of the constraints times a vector g(x) y. More...
 
using grad_gi_sig = void(crvec x, unsigned i, rvec grad_gi)
 Signature of the function that evaluates the gradient of one specific constraints gi(x). More...
 
using hess_L_prod_sig = void(crvec x, crvec y, crvec v, rvec Hv)
 Signature of the function that evaluates the Hessian of the Lagrangian multiplied by a vector xx2L(x,y) v. More...
 
using hess_L_sig = void(crvec x, crvec y, rmat H)
 Signature of the function that evaluates the Hessian of the Lagrangian xx2L(x,y). More...
 

Public Member Functions

 Problem ()=default
 
 Problem (unsigned int n, unsigned int m)
 
 Problem (unsigned n, unsigned int m, Box C, Box D, std::function< f_sig > f, std::function< grad_f_sig > grad_f, std::function< g_sig > g, std::function< grad_g_prod_sig > grad_g_prod, std::function< grad_gi_sig > grad_gi, std::function< hess_L_prod_sig > hess_L_prod, std::function< hess_L_sig > hess_L)
 

Public Attributes

unsigned int n
 Number of decision variables, dimension of x. More...
 
unsigned int m
 Number of constraints, dimension of g(x) and z. More...
 
Box C
 Constraints of the decision variables, xC. More...
 
Box D
 Other constraints, g(x)D. More...
 
std::function< f_sigf
 Cost function f(x). More...
 
std::function< grad_f_siggrad_f
 Gradient of the cost function f(x). More...
 
std::function< g_sigg
 Constraint function g(x). More...
 
std::function< grad_g_prod_siggrad_g_prod
 Gradient of the constraint function times vector g(x) y. More...
 
std::function< grad_gi_siggrad_gi
 Gradient of a specific constraint gi(x). More...
 
std::function< hess_L_prod_sighess_L_prod
 Hessian of the Lagrangian function times vector xx2L(x,y) v. More...
 
std::function< hess_L_sighess_L
 Hessian of the Lagrangian function xx2L(x,y). More...
 

Member Typedef Documentation

◆ f_sig

using f_sig = real_t(crvec x)

Signature of the function that evaluates the cost f(x).

Parameters
[in]xDecision variable xRn

Definition at line 35 of file include/alpaqa/util/problem.hpp.

◆ grad_f_sig

using grad_f_sig = void(crvec x, rvec grad_fx)

Signature of the function that evaluates the gradient of the cost function f(x).

Parameters
[in]xDecision variable xRn
[out]grad_fxGradient of cost function f(x)Rn

Definition at line 42 of file include/alpaqa/util/problem.hpp.

◆ g_sig

using g_sig = void(crvec x, rvec gx)

Signature of the function that evaluates the constraints g(x).

Parameters
[in]xDecision variable xRn
[out]gxValue of the constraints g(x)Rm

Definition at line 48 of file include/alpaqa/util/problem.hpp.

◆ grad_g_prod_sig

using grad_g_prod_sig = void(crvec x, crvec y, rvec grad_gxy)

Signature of the function that evaluates the gradient of the constraints times a vector g(x) y.

Parameters
[in]xDecision variable xRn
[in]yVector yRm to multiply the gradient by
[out]grad_gxyGradient of the constraints g(x) yRn

Definition at line 59 of file include/alpaqa/util/problem.hpp.

◆ grad_gi_sig

using grad_gi_sig = void(crvec x, unsigned i, rvec grad_gi)

Signature of the function that evaluates the gradient of one specific constraints gi(x).

Parameters
[in]xDecision variable xRn
[in]iWhich constraint 0i<m
[out]grad_giGradient of the constraint gi(x)Rn

Definition at line 70 of file include/alpaqa/util/problem.hpp.

◆ hess_L_prod_sig

using hess_L_prod_sig = void(crvec x, crvec y, crvec v, rvec Hv)

Signature of the function that evaluates the Hessian of the Lagrangian multiplied by a vector xx2L(x,y) v.

Parameters
[in]xDecision variable xRn
[in]yLagrange multipliers yRm
[in]vVector to multiply by vRn
[out]HvHessian-vector product xx2L(x,y) vRn

Definition at line 83 of file include/alpaqa/util/problem.hpp.

◆ hess_L_sig

using hess_L_sig = void(crvec x, crvec y, rmat H)

Signature of the function that evaluates the Hessian of the Lagrangian xx2L(x,y).

Parameters
[in]xDecision variable xRn
[in]yLagrange multipliers yRm
[out]HHessian xx2L(x,y)Rn×n

Definition at line 92 of file include/alpaqa/util/problem.hpp.

Constructor & Destructor Documentation

◆ Problem() [1/3]

Problem ( )
default

◆ Problem() [2/3]

Problem ( unsigned int  n,
unsigned int  m 
)
inline

Definition at line 111 of file include/alpaqa/util/problem.hpp.

◆ Problem() [3/3]

Problem ( unsigned  n,
unsigned int  m,
Box  C,
Box  D,
std::function< f_sig f,
std::function< grad_f_sig grad_f,
std::function< g_sig g,
std::function< grad_g_prod_sig grad_g_prod,
std::function< grad_gi_sig grad_gi,
std::function< hess_L_prod_sig hess_L_prod,
std::function< hess_L_sig hess_L 
)
inline

Definition at line 114 of file include/alpaqa/util/problem.hpp.

Member Data Documentation

◆ n

unsigned int n

Number of decision variables, dimension of x.

Definition at line 27 of file include/alpaqa/util/problem.hpp.

◆ m

unsigned int m

Number of constraints, dimension of g(x) and z.

Definition at line 28 of file include/alpaqa/util/problem.hpp.

◆ C

Box C

Constraints of the decision variables, xC.

Definition at line 29 of file include/alpaqa/util/problem.hpp.

◆ D

Box D

Other constraints, g(x)D.

Definition at line 30 of file include/alpaqa/util/problem.hpp.

◆ f

std::function<f_sig> f

Cost function f(x).

Definition at line 95 of file include/alpaqa/util/problem.hpp.

◆ grad_f

std::function<grad_f_sig> grad_f

Gradient of the cost function f(x).

Definition at line 97 of file include/alpaqa/util/problem.hpp.

◆ g

std::function<g_sig> g

Constraint function g(x).

Definition at line 99 of file include/alpaqa/util/problem.hpp.

◆ grad_g_prod

std::function<grad_g_prod_sig> grad_g_prod

Gradient of the constraint function times vector g(x) y.

Definition at line 101 of file include/alpaqa/util/problem.hpp.

◆ grad_gi

std::function<grad_gi_sig> grad_gi

Gradient of a specific constraint gi(x).

Definition at line 103 of file include/alpaqa/util/problem.hpp.

◆ hess_L_prod

std::function<hess_L_prod_sig> hess_L_prod

Hessian of the Lagrangian function times vector xx2L(x,y) v.

Definition at line 106 of file include/alpaqa/util/problem.hpp.

◆ hess_L

std::function<hess_L_sig> hess_L

Hessian of the Lagrangian function xx2L(x,y).

Definition at line 108 of file include/alpaqa/util/problem.hpp.


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