diff --git a/example/math/quadprog.cpp b/example/math/quadprog.cpp index 58c96eb47b..cb6af9ef59 100644 --- a/example/math/quadprog.cpp +++ b/example/math/quadprog.cpp @@ -105,8 +105,10 @@ int main(int argc, char **argv) r = randV(o) * 5; C = randM(p, n) * 5; - // make sure Cx <= d has a solution within Ax = b + std::cout << "DEBUG 1 before solveBySVD()" << std::endl; + // make sure Cx <= d has a solution within Ax = b vpColVector x = A.solveBySVD(b); + std::cout << "DEBUG 2 after solveBySVD()" << std::endl; d = C * x; for (int i = 0; i < p; ++i) d[i] += (5. * rand()) / RAND_MAX; @@ -114,6 +116,8 @@ int main(int argc, char **argv) // solver with warm start vpQuadProg qp_WS; + std::cout << "DEBUG 3 after vpQuadProg()" << std::endl; + // timing int total = 100; double t_WS(0), t_noWS(0); @@ -142,7 +146,9 @@ int main(int argc, char **argv) vpQuadProg qp; x = 0; double t = vpTime::measureTimeMs(); + std::cout << "DEBUG 4 before solveQP()" << std::endl; qp.solveQP(Q, r, A, b, C, d, x); + std::cout << "DEBUG 4 after solveQP()" << std::endl; t_noWS += vpTime::measureTimeMs() - t; #ifdef VISP_HAVE_DISPLAY @@ -153,7 +159,9 @@ int main(int argc, char **argv) // with warm start x = 0; t = vpTime::measureTimeMs(); + std::cout << "DEBUG 5 before solveQP()" << std::endl; qp_WS.solveQP(Q, r, A, b, C, d, x); + std::cout << "DEBUG 5 after solveQP()" << std::endl; t_WS += vpTime::measureTimeMs() - t; #ifdef VISP_HAVE_DISPLAY diff --git a/example/math/quadprog_eq.cpp b/example/math/quadprog_eq.cpp index 0605f4e7c6..7c90d93579 100644 --- a/example/math/quadprog_eq.cpp +++ b/example/math/quadprog_eq.cpp @@ -105,17 +105,23 @@ int main(int argc, char **argv) C = randM(p, n) * 5; // make sure Cx <= d has a solution within Ax = b + + std::cout << "DEBUG 1 before solveBySVD()" << std::endl; vpColVector x = A.solveBySVD(b); + std::cout << "DEBUG 1 after solveBySVD()" << std::endl; d = C * x; for (int i = 0; i < p; ++i) d[i] += (5. * rand()) / RAND_MAX; // solver with stored equality and warm start vpQuadProg qp_WS; + std::cout << "DEBUG 2 before setEqualityConstraint()" << std::endl; qp_WS.setEqualityConstraint(A, b); + std::cout << "DEBUG 2 after setEqualityConstraint()" << std::endl; vpQuadProg qp_ineq_WS; qp_ineq_WS.setEqualityConstraint(A, b); + std::cout << "DEBUG 3 after setEqualityConstraint()" << std::endl; // timing int total = 100; @@ -140,7 +146,9 @@ int main(int argc, char **argv) // without warm start x = 0; double t = vpTime::measureTimeMs(); + std::cout << "DEBUG 4 before solveQPe()" << std::endl; vpQuadProg::solveQPe(Q, r, A, b, x); + std::cout << "DEBUG 4 after solveQPe()" << std::endl; t_noWS += vpTime::measureTimeMs() - t; #ifdef VISP_HAVE_DISPLAY @@ -151,7 +159,9 @@ int main(int argc, char **argv) // with pre-solved Ax = b x = 0; t = vpTime::measureTimeMs(); + std::cout << "DEBUG 5 before solveQPe()" << std::endl; qp_WS.solveQPe(Q, r, x); + std::cout << "DEBUG 5 after solveQPe()" << std::endl; t_WS += vpTime::measureTimeMs() - t; #ifdef VISP_HAVE_DISPLAY @@ -164,7 +174,9 @@ int main(int argc, char **argv) x = 0; vpQuadProg qp; t = vpTime::measureTimeMs(); + std::cout << "DEBUG 6 before solveQP()" << std::endl; qp.solveQP(Q, r, A, b, C, d, x); + std::cout << "DEBUG 6 after solveQP()" << std::endl; t_ineq_noWS += vpTime::measureTimeMs() - t; #ifdef VISP_HAVE_DISPLAY @@ -175,7 +187,9 @@ int main(int argc, char **argv) // with warm start + pre-solving x = 0; t = vpTime::measureTimeMs(); + std::cout << "DEBUG 7 before solveQPi()" << std::endl; qp_ineq_WS.solveQPi(Q, r, C, d, x, true); + std::cout << "DEBUG 7 after solveQPi()" << std::endl; t_ineq_WS += vpTime::measureTimeMs() - t; #ifdef VISP_HAVE_DISPLAY