Closed driftingsn0w closed 1 year ago
Hi, thanks for trying out HPIPM.
There seem to be a number of issues in your code:
nb=0
and ng=3
. Consequently, the bounds should be passed in d_lg
and d_ug
instead of d_lb
and d_ub
; additionally, no idxb
should be passed.{1.0, -1.0, 2.0, 1.0, 2.0, 1.0}
.{-1e6, -1e6, -1e6}
as lower bound (i.e. l_ug
).ROBUST
mode and overwrite standard arguments). Actually with the arguments you choose, the IPM returns status 1 as the exit tolerances set to 1e-12
are too tight. Standard ones or e.g. 1e-8
would make the job.blasfeo_print_dvec
https://github.com/giaf/blasfeo/blob/master/include/blasfeo_d_aux_ext_dep.h#L121Dense qp solver return 0
solution
v
0.66667 1.33333
Hpipm successful.
Thanks for your help :) My understanding of how to use HPIPM is not accurate enough. According to your suggestion, I have successfully solved the problem.
Hello, I intend to use HPIPM to solve an the first example from https://www.mathworks.com/help/optim/ug/quadprog.html . The form is H = [1 -1; -1 2]; f = [-2; -6]; A = [1 1; -1 2; 2 1]; b = [2; 2; 3]; There is no equality constraints and only box constraints. My code is as follows, I can't get correct solution and get return code 2. By the way, I can get correct solution using cvxopt with python. Where could the problem be ? Thanks in advance.
`#include
include
include
include "hpipm_d_dense_qp_dim.h"
include "hpipm_d_dense_qp.h"
include "hpipm_d_dense_qp_ipm.h"
/ prints a matrix in column-major format / void d_print_mat(int m, int n, double A, int lda) { int i, j; for(i=0; i<m; i++) { for(j=0; j<n; j++) { printf("%9.5f ", A[i+ldaj]); } printf("\n"); } printf("\n"); }
int main() {
// free memory
`
Output is: Dense qp solver return 2 solution v -0.77934 0.52175