alpaqa 1.0.0a19
Nonconvex constrained optimization
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Function Class Reference

#include <alpaqa/casadi/casadi-external-function.hpp>

Detailed Description

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 21 of file casadi-external-function.hpp.

+ Collaboration diagram for Function:

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_intsize_in (casadi_int) const
 
std::pair< casadi_int, casadi_intsize_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< voidso_handle
 
struct alpaqa::casadi::Function::Functions functions
 
std::optional< Workwork
 
voidmem = nullptr
 

Class Documentation

◆ alpaqa::casadi::Function::Functions

struct alpaqa::casadi::Function::Functions
+ Collaboration diagram for 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

◆ alpaqa::casadi::Function::Work

struct alpaqa::casadi::Function::Work
+ Collaboration diagram for Function::Work:
Class Members
vector< const casadi_real * > arg
vector< casadi_real * > res
vector< casadi_int > iw
vector< casadi_real > w

Constructor & Destructor Documentation

◆ Function() [1/3]

Function ( std::shared_ptr< void so_handle,
const std::string &  func_name 
)

Definition at line 42 of file casadi-external-function.cpp.

+ Here is the call graph for this function:

◆ Function() [2/3]

Definition at line 47 of file casadi-external-function.cpp.

◆ Function() [3/3]

Function ( Function &&  o)
noexcept

Definition at line 51 of file casadi-external-function.cpp.

◆ ~Function()

~Function ( )

Definition at line 54 of file casadi-external-function.cpp.

Member Function Documentation

◆ n_in()

casadi_int n_in ( ) const

Definition at line 62 of file casadi-external-function.cpp.

+ Here is the caller graph for this function:

◆ n_out()

casadi_int n_out ( ) const

Definition at line 63 of file casadi-external-function.cpp.

+ Here is the caller graph for this function:

◆ size_in()

std::pair< casadi_int, casadi_int > size_in ( casadi_int  n) const

Definition at line 64 of file casadi-external-function.cpp.

+ Here is the call graph for this function:

◆ size_out()

std::pair< casadi_int, casadi_int > size_out ( casadi_int  n) const

Definition at line 67 of file casadi-external-function.cpp.

+ Here is the call graph for this function:

◆ size1_in()

casadi_int size1_in ( casadi_int  n) const

Definition at line 70 of file casadi-external-function.cpp.

+ Here is the call graph for this function:

◆ size1_out()

casadi_int size1_out ( casadi_int  n) const

Definition at line 73 of file casadi-external-function.cpp.

+ Here is the call graph for this function:

◆ size2_in()

casadi_int size2_in ( casadi_int  n) const

Definition at line 76 of file casadi-external-function.cpp.

+ Here is the call graph for this function:

◆ size2_out()

casadi_int size2_out ( casadi_int  n) const

Definition at line 79 of file casadi-external-function.cpp.

+ Here is the call graph for this function:

◆ sparsity_in()

Function::Sparsity sparsity_in ( casadi_int  n) const

Definition at line 82 of file casadi-external-function.cpp.

+ Here is the caller graph for this function:

◆ sparsity_out()

Function::Sparsity sparsity_out ( casadi_int  n) const

Definition at line 85 of file casadi-external-function.cpp.

+ Here is the caller graph for this function:

◆ operator()()

void operator() ( std::span< const double *const arg,
std::span< double *const res 
)
inline

Definition at line 56 of file casadi-external-function.hpp.

◆ load()

void load ( void so_handle,
const std::string &  func_name 
)
private

Definition at line 9 of file casadi-external-function.cpp.

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

◆ init_work()

void init_work ( )
private

Definition at line 28 of file casadi-external-function.cpp.

Member Data Documentation

◆ so_handle

std::shared_ptr<void> so_handle
private

Definition at line 78 of file casadi-external-function.hpp.

◆ functions

◆ work

std::optional<Work> work
private

Definition at line 100 of file casadi-external-function.hpp.

◆ mem

void* mem = nullptr
private

Definition at line 101 of file casadi-external-function.hpp.


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