alpaqa 0.0.1
Nonconvex constrained optimization
Classes | Functions
External problem loaders

Detailed Description

Utilities for loading external problems, such as problems from the CUTEst test problems or functions exported by CasADi.

Classes

class  CasADiFunctionEvaluator< N_in, N_out >
 Class for evaluating CasADi functions, allocating the necessary workspace storage in advance for allocation-free evaluations. More...
 
class  CasADiFun_1Vi1So
 Wrapper for CasADiFunctionEvaluator with 1 vector input, scalar output. More...
 
class  CasADiFun_2Vi1So
 Wrapper for CasADiFunctionEvaluator with 2 vector inputs, scalar output. More...
 
class  CasADiFun_1Vi1Vo
 Wrapper for CasADiFunctionEvaluator with 1 vector input, 1 vector output. More...
 
class  CasADiFun_2Vi1Vo
 Wrapper for CasADiFunctionEvaluator with 2 vector inputs, 1 vector output. More...
 
class  CasADiFun_2Vi1Mo
 Wrapper for CasADiFunctionEvaluator with 2 vector inputs, 1 matrix output. More...
 
class  CasADiFun_3Vi1Mo
 Wrapper for CasADiFunctionEvaluator with 3 vector inputs, 1 matrix output. More...
 
class  CasADiFun_3Vi1Vo
 Wrapper for CasADiFunctionEvaluator with 3 vector inputs, 1 vector output. More...
 
class  CasADiFun_4Vi1Vo
 Wrapper for CasADiFunctionEvaluator with 4 vector inputs, 1 vector output. More...
 
class  CUTEstProblem
 Wrapper for CUTEst problems loaded from an external shared library. More...
 

Functions

alpaqa::Problem load_CasADi_problem (const std::string &filename, unsigned n=0, unsigned m=0, bool second_order=false)
 Load a problem generated by CasADi (without parameters). More...
 
ProblemWithParam load_CasADi_problem_with_param (const std::string &filename, unsigned n=0, unsigned m=0, unsigned p=0, bool second_order=false)
 Load a problem generated by CasADi (with parameters). More...
 

Function Documentation

◆ load_CasADi_problem()

alpaqa::Problem load_CasADi_problem ( const std::string &  filename,
unsigned  n = 0,
unsigned  m = 0,
bool  second_order = false 
)

Load a problem generated by CasADi (without parameters).

Parameters
filenameFilename of the shared library to load the functions from.
nNumber of decision variables ( \( x \in \mathbb{R}^n \)).
mNumber of general constraints ( \( g(x) \in \mathbb{R}^m \)).
second_orderLoad the additional functions required for second-order PANOC.

The file should contain functions with the names f, grad_f, g and grad_g. These functions evaluate the objective function, its gradient, the constraints, and the constraint gradient times a vector respecitvely. If second_order is true, additional functions hess_L and hess_L_prod should be provided to evaluate the Hessian of the Lagrangian and Hessian-vector products.

If any of the dimensions are zero, they are determined from the g function in the given file.

Exceptions
std::invalid_argumentThe dimensions of the loaded functions do not match.
Examples
CasADi/Rosenbrock/main.cpp.

Definition at line 88 of file CasADiLoader.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load_CasADi_problem_with_param()

ProblemWithParam load_CasADi_problem_with_param ( const std::string &  filename,
unsigned  n = 0,
unsigned  m = 0,
unsigned  p = 0,
bool  second_order = false 
)

Load a problem generated by CasADi (with parameters).

Parameters
filenameFilename of the shared library to load the functions from.
nNumber of decision variables ( \( x \in \mathbb{R}^n \)).
mNumber of general constraints ( \( g(x) \in \mathbb{R}^m \)).
pThe number of parameters of the problem (second argument to all CasADi functions).
second_orderLoad the additional functions required for second-order PANOC.

The file should contain functions with the names f, grad_f, g and grad_g. These functions evaluate the objective function, its gradient, the constraints, and the constraint gradient times a vector respecitvely. If second_order is true, additional functions hess_L and hess_L_prod should be provided to evaluate the Hessian of the Lagrangian and Hessian-vector products.

If any of the dimensions are zero, they are determined from the g function in the given file.

Exceptions
std::invalid_argumentThe dimensions of the loaded functions do not match.

Definition at line 212 of file CasADiLoader.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: