27 } casadi_convexify_strategy_t;
31 CVX_SYMM, CVX_TRIL, CVX_TRIU
32 } casadi_convexify_type_in_t;
40 const casadi_int *
Hsp;
62 casadi_int i, j, k, kk, block_size, offset;
67 casadi_int Hrsp_nnz = c->
Hrsp[2+c->
Hrsp[1]];
68 casadi_int nnz = c->
Hsp[2+c->
Hsp[1]];
72 casadi_copy(Hin, Hrsp_nnz, w);
73 casadi_project(w, c->
Hrsp, Hout, c->
Hsp, w+Hrsp_nnz);
75 casadi_project(Hin, c->
Hrsp, Hout, c->
Hsp, w);
78 if (Hin!=Hout) casadi_copy(Hin, nnz, Hout);
83 reg = c->
margin-casadi_lb_eig(c->
Hsp, Hout);
84 if (reg > 0) casadi_regularize(c->
Hsp, Hout, reg);
100 for (i=0;i<block_size;++i) {
102 for (j=0;j<block_size;++j, ++kk) {
106 }
else if (c->
type_in==CVX_TRIU) {
108 for (i=0;i<block_size;++i) {
110 for (j=0;j<i+1;++j, ++kk) {
112 H_block[i*block_size+j] = e;
113 H_block[i+block_size*j] = e;
118 for (i=0;i<block_size;++i) {
119 for (j=i;j<block_size;++j, ++kk) {
121 H_block[i*block_size+j] = e;
122 H_block[i+block_size*j] = e;
126 w_cvx += block_size*block_size;
128 H_block = Hout+offset;
132 ret = casadi_cvx(block_size, H_block, c->
margin, 1e-10,
137 for (i=0;i<block_size;++i) {
138 for (j=0;j<i+1;++j) {
139 H_block[block_size*i+j] = H_block[block_size*j+i];
148 for (i=0;i<block_size;++i) {
150 for (j=0;j<block_size;++j, ++kk) {
154 }
else if (c->
type_in==CVX_TRIU) {
156 for (i=0;i<block_size;++i) {
158 for (j=0;j<i+1;++j, ++kk) {
159 Hout[c->
scc_mapping[offset+kk]] = H_block[block_size*i+j];
164 for (i=0;i<block_size;++i) {
166 for (j=i;j<block_size;++j, ++kk) {
167 Hout[c->
scc_mapping[offset+kk]] = H_block[block_size*i+j];
174 offset += block_size*block_size;
176 offset += block_size*(block_size+1)/2;
casadi_int max_iter_eig
For eigen-* convexification strategies: maximum iterations for symmetric Schur decomposition.
casadi_convexify_strategy_t strategy
casadi_int scc_offset_size
casadi_convexify_type_in_t type_in
const casadi_int * scc_offset
Block structure of Hessian for certain convexification methods.
const casadi_int * scc_mapping