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

#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 21 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
 

Static Public Member Functions

static void validate_num_args (const casadi::Function &fun)
 
static void validate_dimensions (const casadi::Function &fun, const std::array< casadi_dim, N_in > &dim_in={}, const std::array< casadi_dim, N_out > &dim_out={})
 

Public Attributes

casadi::Function fun
 

Protected Member Functions

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

Private Attributes

std::vector< casadi_intiwork
 
std::vector< doubledwork
 
std::vector< const double * > arg_work
 
std::vector< double * > res_work
 

Member Typedef Documentation

◆ casadi_dim

template<Config Conf, size_t N_in, size_t N_out>
using casadi_dim = std::pair<casadi_int, casadi_int>

Definition at line 26 of file CasADiFunctionWrapper.hpp.

Constructor & Destructor Documentation

◆ CasADiFunctionEvaluator() [1/2]

template<Config Conf, size_t N_in, size_t N_out>
CasADiFunctionEvaluator ( casadi::Function &&  f)
inline
Exceptions
invalid_argument_dimensions

Definition at line 29 of file CasADiFunctionWrapper.hpp.

+ Here is the call graph for this function:

◆ CasADiFunctionEvaluator() [2/2]

template<Config Conf, size_t N_in, size_t N_out>
CasADiFunctionEvaluator ( casadi::Function &&  f,
const std::array< casadi_dim, N_in > &  dim_in,
const std::array< casadi_dim, N_out > &  dim_out 
)
inline
Exceptions
invalid_argument_dimensions

Definition at line 36 of file CasADiFunctionWrapper.hpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ validate_num_args()

template<Config Conf, size_t N_in, size_t N_out>
static void validate_num_args ( const casadi::Function &  fun)
inlinestatic
Exceptions
invalid_argument_dimensions

Definition at line 44 of file CasADiFunctionWrapper.hpp.

+ Here is the caller graph for this function:

◆ validate_dimensions() [1/2]

template<Config Conf, size_t N_in, size_t N_out>
static void validate_dimensions ( const casadi::Function &  fun,
const std::array< casadi_dim, N_in > &  dim_in = {},
const std::array< casadi_dim, N_out > &  dim_out = {} 
)
inlinestatic
Exceptions
invalid_argument_dimensions

Definition at line 60 of file CasADiFunctionWrapper.hpp.

+ Here is the caller graph for this function:

◆ validate_dimensions() [2/2]

template<Config Conf, size_t N_in, size_t N_out>
void validate_dimensions ( const std::array< casadi_dim, N_in > &  dim_in = {},
const std::array< casadi_dim, N_out > &  dim_out = {} 
)
inline
Exceptions
invalid_argument_dimensions

Definition at line 93 of file CasADiFunctionWrapper.hpp.

◆ operator()() [1/2]

template<Config Conf, size_t N_in, size_t N_out>
void operator() ( const double *const in,
double *const out 
) const
inlineprotected

Definition at line 99 of file CasADiFunctionWrapper.hpp.

+ Here is the caller graph for this function:

◆ operator()() [2/2]

template<Config Conf, size_t N_in, size_t N_out>
void operator() ( const double *const (&)  in[N_in],
double *const (&)  out[N_out] 
) const
inline

Definition at line 106 of file CasADiFunctionWrapper.hpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ fun

template<Config Conf, size_t N_in, size_t N_out>
casadi::Function fun

Definition at line 112 of file CasADiFunctionWrapper.hpp.

◆ iwork

template<Config Conf, size_t N_in, size_t N_out>
std::vector<casadi_int> iwork
mutableprivate

Definition at line 115 of file CasADiFunctionWrapper.hpp.

◆ dwork

template<Config Conf, size_t N_in, size_t N_out>
std::vector<double> dwork
mutableprivate

Definition at line 116 of file CasADiFunctionWrapper.hpp.

◆ arg_work

template<Config Conf, size_t N_in, size_t N_out>
std::vector<const double *> arg_work
mutableprivate

Definition at line 117 of file CasADiFunctionWrapper.hpp.

◆ res_work

template<Config Conf, size_t N_in, size_t N_out>
std::vector<double *> res_work
mutableprivate

Definition at line 118 of file CasADiFunctionWrapper.hpp.


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