#include <alpaqa/casadi/casadi-external-function.hpp>
Class that loads and calls pre-compiled CasADi functions in a DLL/SO file.
Designed to match (part of) the casadi::Function
API.
Definition at line 22 of file casadi-external-function.hpp.
Classes | |
struct | Functions |
class | Sparsity |
struct | Work |
Public Member Functions | |
Function (std::shared_ptr< void > so_handle, const std::string &func_name) | |
Function (const Function &) | |
Function (Function &&) noexcept | |
~Function () | |
casadi_int | n_in () const |
casadi_int | n_out () const |
std::pair< casadi_int, casadi_int > | size_in (casadi_int) const |
std::pair< casadi_int, casadi_int > | size_out (casadi_int) const |
casadi_int | size1_in (casadi_int) const |
casadi_int | size1_out (casadi_int) const |
casadi_int | size2_in (casadi_int) const |
casadi_int | size2_out (casadi_int) const |
Sparsity | sparsity_in (casadi_int) const |
Sparsity | sparsity_out (casadi_int) const |
void | operator() (std::span< const double *const > arg, std::span< double *const > res) |
Private Member Functions | |
void | load (void *so_handle, const std::string &func_name) |
void | init_work () |
Private Attributes | |
std::shared_ptr< void > | so_handle |
struct alpaqa::casadi::Function::Functions | functions |
std::optional< Work > | work |
void * | mem = nullptr |
struct alpaqa::casadi::Function::Functions |
Class Members | ||
---|---|---|
signature_t * | incref = nullptr | |
signature_t * | decref = nullptr | |
signature_t * | n_in = nullptr | |
signature_t * | n_out = nullptr | |
signature_t * | name_in = nullptr | |
signature_t * | name_out = nullptr | |
signature_t * | sparsity_in = nullptr | |
signature_t * | sparsity_out = nullptr | |
signature_t * | alloc_mem = nullptr | |
signature_t * | init_mem = nullptr | |
signature_t * | free_mem = nullptr | |
signature_t * | work = nullptr | |
signature_t * | call = nullptr |
struct alpaqa::casadi::Function::Work |
Class Members | ||
---|---|---|
vector< const casadi_real * > | arg | |
vector< casadi_real * > | res | |
vector< casadi_int > | iw | |
vector< casadi_real > | w |
Definition at line 42 of file casadi-external-function.cpp.
Definition at line 47 of file casadi-external-function.cpp.
Definition at line 51 of file casadi-external-function.cpp.
~Function | ( | ) |
Definition at line 54 of file casadi-external-function.cpp.
casadi_int n_in | ( | ) | const |
Definition at line 62 of file casadi-external-function.cpp.
casadi_int n_out | ( | ) | const |
Definition at line 63 of file casadi-external-function.cpp.
std::pair< casadi_int, casadi_int > size_in | ( | casadi_int | n | ) | const |
Definition at line 64 of file casadi-external-function.cpp.
std::pair< casadi_int, casadi_int > size_out | ( | casadi_int | n | ) | const |
Definition at line 67 of file casadi-external-function.cpp.
casadi_int size1_in | ( | casadi_int | n | ) | const |
Definition at line 70 of file casadi-external-function.cpp.
casadi_int size1_out | ( | casadi_int | n | ) | const |
Definition at line 73 of file casadi-external-function.cpp.
casadi_int size2_in | ( | casadi_int | n | ) | const |
Definition at line 76 of file casadi-external-function.cpp.
casadi_int size2_out | ( | casadi_int | n | ) | const |
Definition at line 79 of file casadi-external-function.cpp.
Function::Sparsity sparsity_in | ( | casadi_int | n | ) | const |
Definition at line 82 of file casadi-external-function.cpp.
Function::Sparsity sparsity_out | ( | casadi_int | n | ) | const |
Definition at line 85 of file casadi-external-function.cpp.
Definition at line 57 of file casadi-external-function.hpp.
Definition at line 9 of file casadi-external-function.cpp.
|
private |
Definition at line 28 of file casadi-external-function.cpp.
|
private |
Definition at line 79 of file casadi-external-function.hpp.
|
private |
|
private |
Definition at line 101 of file casadi-external-function.hpp.
Definition at line 102 of file casadi-external-function.hpp.