To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit c2696646 authored by roangel's avatar roangel
Browse files

added template of the final part of the solve_QP_ADP function. Need to fill it

parent d7a3176f
......@@ -731,6 +731,21 @@ VectorXd solve_QP_ADP(Eigen::MatrixXd H, Eigen::MatrixXd F, Eigen::MatrixXd A, E
if (error) goto QUIT;
}
// ADD QUADRATIC CONSTRAINTS FROM ADP HERE!. 2 nested for loops. One over 9 value functions, and the other one to create q_quad_row and q_quad_col, l_ind, l_val,...
for(int i = 0; i < N_V_fun; i++)
{
for(int j = 0; j < Qs_adp[i].rows(); j++)
{
for(int k = 0; k < Qs_adp[i].cols(); k++)
{
// here create q_row, q_col, q_val if the element of Qs_adp[i](j,k) != 0
}
// here create l_ind, l_val if the elemt qs_adp[i](j) != 0
}
// here add the constraint using the arrays crated before
}
// Optimize model
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment