alpaqa 1.0.0a18
Nonconvex constrained optimization
Loading...
Searching...
No Matches
casadi-functions.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "casadi-types.hpp"
4
5#include <alpaqa/util/dl.hpp>
6#include <cassert>
7
9
10// clang-format off
11using fname_incref = ExternalFunction<"_incref", void(void)>;
12using fname_decref = ExternalFunction<"_decref", void(void)>;
13using fname_n_in = ExternalFunction<"_n_in", casadi_int(void)>;
14using fname_n_out = ExternalFunction<"_n_out", casadi_int(void)>;
15using fname_name_in = ExternalFunction<"_name_in", const char *(casadi_int ind)>;
16using fname_name_out = ExternalFunction<"_name_out", const char *(casadi_int ind)>;
17using fname_sparsity_in = ExternalFunction<"_sparsity_in", const casadi_int *(casadi_int ind)>;
18using fname_sparsity_out = ExternalFunction<"_sparsity_out", const casadi_int *(casadi_int ind)>;
19using fname_alloc_mem = ExternalFunction<"_alloc_mem", void *(void)>;
20using fname_init_mem = ExternalFunction<"_init_mem", int(void *mem)>;
21using fname_free_mem = ExternalFunction<"_free_mem", int(void *mem)>;
22using fname_work = ExternalFunction<"_work", int(casadi_int *sz_arg, casadi_int *sz_res, casadi_int *sz_iw, casadi_int *sz_w)>;
23using fname = ExternalFunction<"", int(const casadi_real **arg, casadi_real **res, casadi_int *iw, casadi_real *w, void *mem)>;
24// clang-format on
25
26template <Name Nm, class Sgn>
27auto ExternalFunction<Nm, Sgn>::load(void *handle, std::string fname)
28 -> signature_t * {
29 static_assert(name.value.back() == '\0');
30 fname += name.value.data();
31 auto func = reinterpret_cast<signature_t *>(util::load_func(handle, fname));
32 assert(func);
33 return func;
34}
35
36} // namespace alpaqa::inline ALPAQA_CASADI_LOADER_NAMESPACE::casadi
#define ALPAQA_CASADI_LOADER_NAMESPACE
void * load_func(void *handle, const std::string &name)
Definition dl.cpp:64
constexpr const auto inf
Definition config.hpp:112
ExternalFunction<"_name_out", const char *(casadi_int ind)> fname_name_out
ExternalFunction<"_init_mem", int(void *mem)> fname_init_mem
ExternalFunction<"", int(const casadi_real **arg, casadi_real **res, casadi_int *iw, casadi_real *w, void *mem)> fname
ExternalFunction<"_sparsity_out", const casadi_int *(casadi_int ind)> fname_sparsity_out
ExternalFunction<"_n_in", casadi_int(void)> fname_n_in
double casadi_real
ExternalFunction<"_free_mem", int(void *mem)> fname_free_mem
ExternalFunction<"_decref", void(void)> fname_decref
ExternalFunction<"_incref", void(void)> fname_incref
ExternalFunction<"_alloc_mem", void *(void)> fname_alloc_mem
ExternalFunction<"_sparsity_in", const casadi_int *(casadi_int ind)> fname_sparsity_in
ExternalFunction<"_n_out", casadi_int(void)> fname_n_out
long long int casadi_int
ExternalFunction<"_work", int(casadi_int *sz_arg, casadi_int *sz_res, casadi_int *sz_iw, casadi_int *sz_w)> fname_work
ExternalFunction<"_name_in", const char *(casadi_int ind)> fname_name_in
Reference to CasADi function.