alpaqa 1.0.0a8
Nonconvex constrained optimization
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
CasADiFunctionEvaluator< Conf, N_in, N_out > Class Template Reference

#include <interop/casadi/include/alpaqa/casadi/CasADiFunctionWrapper.hpp>

Detailed Description

template<Config Conf, size_t N_in, size_t N_out>
class alpaqa::casadi_loader::CasADiFunctionEvaluator< Conf, N_in, N_out >

Class for evaluating CasADi functions, allocating the necessary workspace storage in advance for allocation-free evaluations.

Definition at line 17 of file CasADiFunctionWrapper.hpp.

+ Collaboration diagram for CasADiFunctionEvaluator< Conf, N_in, N_out >:

Public Types

using casadi_dim = std::pair< casadi_int, casadi_int >
 

Public Member Functions

 CasADiFunctionEvaluator (casadi::Function &&f)
 
 CasADiFunctionEvaluator (casadi::Function &&f, const std::array< casadi_dim, N_in > &dim_in, const std::array< casadi_dim, N_out > &dim_out)
 
void validate_dimensions (const std::array< casadi_dim, N_in > &dim_in={}, const std::array< casadi_dim, N_out > &dim_out={})
 
void operator() (const double *const (&in)[N_in], double *const (&out)[N_out]) const
 

Public Attributes

casadi::Function fun
 

Protected Member Functions

void operator() (const double *const *in, double *const *out) const
 

Private Attributes

std::vector< casadi_int > iwork
 
std::vector< double > dwork
 
std::vector< const double * > arg_work
 
std::vector< double * > res_work
 

Member Typedef Documentation

◆ casadi_dim

using casadi_dim = std::pair<casadi_int, casadi_int>

Definition at line 22 of file CasADiFunctionWrapper.hpp.

Constructor & Destructor Documentation

◆ CasADiFunctionEvaluator() [1/2]

CasADiFunctionEvaluator ( casadi::Function &&  f)
inline
Exceptions
std::invalid_argument

Definition at line 25 of file CasADiFunctionWrapper.hpp.

◆ CasADiFunctionEvaluator() [2/2]

CasADiFunctionEvaluator ( casadi::Function &&  f,
const std::array< casadi_dim, N_in > &  dim_in,
const std::array< casadi_dim, N_out > &  dim_out 
)
inline
Exceptions
std::invalid_argument

Definition at line 42 of file CasADiFunctionWrapper.hpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ validate_dimensions()

void validate_dimensions ( const std::array< casadi_dim, N_in > &  dim_in = {},
const std::array< casadi_dim, N_out > &  dim_out = {} 
)
inline
Exceptions
std::invalid_argument

Definition at line 51 of file CasADiFunctionWrapper.hpp.

+ Here is the caller graph for this function:

◆ operator()() [1/2]

void operator() ( const double *const *  in,
double *const *  out 
) const
inlineprotected

Definition at line 82 of file CasADiFunctionWrapper.hpp.

+ Here is the caller graph for this function:

◆ operator()() [2/2]

void operator() ( const double *const (&)  in[N_in],
double *const (&)  out[N_out] 
) const
inline

Definition at line 89 of file CasADiFunctionWrapper.hpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ fun

casadi::Function fun

Definition at line 95 of file CasADiFunctionWrapper.hpp.

◆ iwork

std::vector<casadi_int> iwork
mutableprivate

Definition at line 98 of file CasADiFunctionWrapper.hpp.

◆ dwork

std::vector<double> dwork
mutableprivate

Definition at line 99 of file CasADiFunctionWrapper.hpp.

◆ arg_work

std::vector<const double *> arg_work
mutableprivate

Definition at line 100 of file CasADiFunctionWrapper.hpp.

◆ res_work

std::vector<double *> res_work
mutableprivate

Definition at line 101 of file CasADiFunctionWrapper.hpp.


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