public API
(
switch to internal
)
-
revision 3.6.7
casadi
core
runtime
casadi_qp.hpp
1
//
2
// MIT No Attribution
3
//
4
// Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl, KU Leuven.
5
//
6
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
7
// software and associated documentation files (the "Software"), to deal in the Software
8
// without restriction, including without limitation the rights to use, copy, modify,
9
// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
10
// permit persons to whom the Software is furnished to do so.
11
//
12
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
14
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
15
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
16
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
17
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
//
19
20
21
// C-REPLACE "fmin" "casadi_fmin"
22
// C-REPLACE "fmax" "casadi_fmax"
23
// C-REPLACE "std::numeric_limits<T1>::min()" "casadi_real_min"
24
// C-REPLACE "std::numeric_limits<T1>::infinity()" "casadi_inf"
25
// C-REPLACE "static_cast<int>" "(int) "
26
27
// SYMBOL "qp_prob"
28
template
<
typename
T1>
29
struct
casadi_qp_prob
{
30
// Sparsity patterns
31
const
casadi_int *
sp_a
, *
sp_h
;
32
// Dimensions
33
casadi_int
nx
,
na
,
nz
;
34
casadi_int
nnz_a
,
nnz_h
;
35
};
36
// C-REPLACE "casadi_qp_prob<T1>" "struct casadi_qp_prob"
37
38
// SYMBOL "qp_setup"
39
template
<
typename
T1>
40
void
casadi_qp_setup(
casadi_qp_prob<T1>
* p) {
41
p->
na
= p->
sp_a
[0];
42
p->
nx
= p->
sp_a
[1];
43
p->
nz
= p->
na
+p->
nx
;
44
p->
nnz_a
= p->
sp_a
[2+p->
sp_a
[1]];
45
p->
nnz_h
= p->
sp_h
[2+p->
sp_h
[1]];
46
}
47
48
// C-REPLACE "UnifiedReturnStatus" "int"
49
// C-REPLACE "bool" "int"
50
51
// SYMBOL "qp_data"
52
template
<
typename
T1>
53
struct
casadi_qp_data
{
54
// Problem structure
55
const
casadi_qp_prob<T1>
*
prob
;
56
57
UnifiedReturnStatus
unified_return_status
;
58
bool
success
;
59
60
// Number of iterations performed
61
casadi_int
iter_count
;
62
63
// QP data, pointers to arg (no allocations needed)
64
const
T1 *
a
, *
h
, *
g
, *
lbx
, *
ubx
, *
lba
, *
uba
, *
x0
, *
lam_x0
, *
lam_a0
;
65
// QP results, pointers to res (no allocations needed)
66
T1 *
f
, *
x
, *
lam_x
, *
lam_a
;
67
68
};
69
// C-REPLACE "casadi_qp_data<T1>" "struct casadi_qp_data"
70
71
// SYMBOL "qp_init"
72
template
<
typename
T1>
73
void
casadi_qp_init(
casadi_qp_data<T1>
* d, casadi_int** iw, T1** w) {
74
// Local variables
75
//const casadi_qp_prob<T1>* p = d->prob;
76
}
77
78
// SYMBOL "qp_work"
79
template
<
typename
T1>
80
void
casadi_qp_work(
const
casadi_qp_prob<T1>
* p, casadi_int* sz_arg, casadi_int* sz_res,
81
casadi_int* sz_iw, casadi_int* sz_w) {
82
// Reset sz_arg, sz_res
83
*sz_arg = *sz_res = 0;
84
// Reset sz_w, sz_iw
85
*sz_w = *sz_iw = 0;
86
}
casadi_qp_data
Definition:
casadi_qp.hpp:53
casadi_qp_data::h
const T1 * h
Definition:
casadi_qp.hpp:64
casadi_qp_data::lba
const T1 * lba
Definition:
casadi_qp.hpp:64
casadi_qp_data::success
bool success
Definition:
casadi_qp.hpp:58
casadi_qp_data::prob
const casadi_qp_prob< T1 > * prob
Definition:
casadi_qp.hpp:55
casadi_qp_data::iter_count
casadi_int iter_count
Definition:
casadi_qp.hpp:61
casadi_qp_data::lbx
const T1 * lbx
Definition:
casadi_qp.hpp:64
casadi_qp_data::uba
const T1 * uba
Definition:
casadi_qp.hpp:64
casadi_qp_data::f
T1 * f
Definition:
casadi_qp.hpp:66
casadi_qp_data::ubx
const T1 * ubx
Definition:
casadi_qp.hpp:64
casadi_qp_data::lam_x0
const T1 * lam_x0
Definition:
casadi_qp.hpp:64
casadi_qp_data::x0
const T1 * x0
Definition:
casadi_qp.hpp:64
casadi_qp_data::unified_return_status
UnifiedReturnStatus unified_return_status
Definition:
casadi_qp.hpp:57
casadi_qp_data::lam_x
T1 * lam_x
Definition:
casadi_qp.hpp:66
casadi_qp_data::g
const T1 * g
Definition:
casadi_qp.hpp:64
casadi_qp_data::lam_a0
const T1 * lam_a0
Definition:
casadi_qp.hpp:64
casadi_qp_data::lam_a
T1 * lam_a
Definition:
casadi_qp.hpp:66
casadi_qp_data::x
T1 * x
Definition:
casadi_qp.hpp:66
casadi_qp_data::a
const T1 * a
Definition:
casadi_qp.hpp:64
casadi_qp_prob
Definition:
casadi_qp.hpp:29
casadi_qp_prob::sp_h
const casadi_int * sp_h
Definition:
casadi_qp.hpp:31
casadi_qp_prob::nx
casadi_int nx
Definition:
casadi_qp.hpp:33
casadi_qp_prob::nz
casadi_int nz
Definition:
casadi_qp.hpp:33
casadi_qp_prob::sp_a
const casadi_int * sp_a
Definition:
casadi_qp.hpp:31
casadi_qp_prob::na
casadi_int na
Definition:
casadi_qp.hpp:33
casadi_qp_prob::nnz_a
casadi_int nnz_a
Definition:
casadi_qp.hpp:34
casadi_qp_prob::nnz_h
casadi_int nnz_h
Definition:
casadi_qp.hpp:34