alpaqa no-casadi-dep
Nonconvex constrained optimization
Loading...
Searching...
No Matches
casadi-types.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <algorithm>
4#include <array>
5#include <string>
6
8
10
11#ifndef casadi_int
12using casadi_int = long long int;
13#endif
14#ifndef casadi_real
16#endif
17
18namespace casadi {
19
20/// Compile-time string for CasADi function names.
21template <size_t N>
22struct Name {
23 constexpr Name(const char (&str)[N]) { // NOLINT(*-c-arrays)
24 std::copy_n(str, N, value.data());
25 }
26 std::array<char, N> value;
27};
28
29/// Reference to CasADi function.
30template <Name Nm, class Sgn>
32 using signature_t = Sgn;
33 static constexpr Name name = Nm;
34 [[nodiscard]] static signature_t *load(void *handle, std::string fname);
35};
36
37} // namespace casadi
38
39} // namespace alpaqa::inline ALPAQA_CASADI_LOADER_NAMESPACE
#define ALPAQA_CASADI_LOADER_NAMESPACE
constexpr const auto inf
Definition config.hpp:112
ExternalFunction<"", int(const casadi_real **arg, casadi_real **res, casadi_int *iw, casadi_real *w, void *mem)> fname
double casadi_real
long long int casadi_int
Reference to CasADi function.
Compile-time string for CasADi function names.
std::array< char, N > value
constexpr Name(const char(&str)[N])