alpaqa
1.0.0a18
Nonconvex constrained optimization
Loading...
Searching...
No Matches
src
interop
casadi
include
alpaqa
casadi
casadi-types.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <algorithm>
4
#include <array>
5
#include <string>
6
7
#include "
casadi-namespace.hpp
"
8
9
namespace
alpaqa::inline
ALPAQA_CASADI_LOADER_NAMESPACE
{
10
11
#ifndef casadi_int
12
using
casadi_int
=
long
long
int
;
13
#endif
14
#ifndef casadi_real
15
using
casadi_real
=
double
;
16
#endif
17
18
namespace
casadi {
19
20
/// Compile-time string for CasADi function names.
21
template
<
size_t
N>
22
struct
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.
30
template
<Name Nm,
class
Sgn>
31
struct
ExternalFunction
{
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
casadi-namespace.hpp
ALPAQA_CASADI_LOADER_NAMESPACE
#define ALPAQA_CASADI_LOADER_NAMESPACE
Definition
casadi-namespace.hpp:6
alpaqa::inf
constexpr const auto inf
Definition
config.hpp:112
builtin::fname
ExternalFunction<"", int(const casadi_real **arg, casadi_real **res, casadi_int *iw, casadi_real *w, void *mem)> fname
Definition
casadi-functions.hpp:23
builtin::casadi_real
double casadi_real
Definition
casadi-types.hpp:15
builtin::casadi_int
long long int casadi_int
Definition
casadi-types.hpp:12
builtin::casadi::ExternalFunction
Reference to CasADi function.
Definition
casadi-types.hpp:31
builtin::casadi::ExternalFunction::signature_t
Sgn signature_t
Definition
casadi-types.hpp:32
builtin::casadi::Name
Compile-time string for CasADi function names.
Definition
casadi-types.hpp:22
builtin::casadi::Name::value
std::array< char, N > value
Definition
casadi-types.hpp:26
builtin::casadi::Name::Name
constexpr Name(const char(&str)[N])
Definition
casadi-types.hpp:23
Generated on Wed Mar 27 2024 for alpaqa by
1.9.8