38 #include <qpOASES.hpp> 51 real_t errP1, errP2, errP3, errD1, errD2, errD3,
tic,
toc;
80 fprintf(
stdFile,
"Solved dense problem in %d iterations, %.3f seconds.\n", (
int)nWSR, toc-tic);
91 fprintf(
stdFile,
"Solved sparse problem in %d iterations, %.3f seconds.\n", (
int)nWSR, toc-tic);
103 fprintf(
stdFile,
"Solved sparse problem (Schur complement approach) in %d iterations, %.3f seconds.\n", (
int)nWSR, toc-tic);
111 for (i = 0; i < 180; i++)
112 if (
getAbs(x1[i] - x2[i]) > errP1)
113 errP1 =
getAbs(x1[i] - x2[i]);
114 for (i = 0; i < 180; i++)
115 if (
getAbs(x1[i] - x3[i]) > errP2)
116 errP2 =
getAbs(x1[i] - x3[i]);
117 for (i = 0; i < 180; i++)
118 if (
getAbs(x2[i] - x3[i]) > errP3)
119 errP3 =
getAbs(x2[i] - x3[i]);
121 fprintf(
stdFile,
"Primal error (dense and sparse): %9.2e\n", errP1);
122 fprintf(
stdFile,
"Primal error (dense and Schur): %9.2e\n", errP2);
123 fprintf(
stdFile,
"Primal error (sparse and Schur): %9.2e\n", errP3);
128 for (i = 0; i < 271; i++)
129 if (
getAbs(y1[i] - y2[i]) > errD1)
130 errD1 =
getAbs(y1[i] - y2[i]);
132 for (i = 0; i < 271; i++)
133 if (
getAbs(y1[i] - y3[i]) > errD2)
134 errD2 =
getAbs(y1[i] - y3[i]);
135 for (i = 0; i < 271; i++)
136 if (
getAbs(y2[i] - y3[i]) > errD3)
137 errD3 =
getAbs(y2[i] - y3[i]);
139 fprintf(
stdFile,
"Dual error (dense and sparse): %9.2e (might not be unique)\n", errD1);
140 fprintf(
stdFile,
"Dual error (dense and Schur): %9.2e (might not be unique)\n", errD2);
141 fprintf(
stdFile,
"Dual error (sparse and Schur): %9.2e (might not be unique)\n", errD3);
returnValue getPrimalSolution(real_t *const xOpt) const
#define USING_NAMESPACE_QPOASES
Interfaces matrix-vector operations tailored to symmetric sparse matrices.
returnValue init(const real_t *const _H, const real_t *const _g, const real_t *const _A, const real_t *const _lb, const real_t *const _ub, const real_t *const _lbA, const real_t *const _ubA, int &nWSR, const real_t *const yOpt=0, real_t *const cputime=0)
Interfaces matrix-vector operations tailored to symmetric dense matrices.
Interfaces matrix-vector operations tailored to general dense matrices.
Interfaces matrix-vector operations tailored to general sparse matrices.
#define QPOASES_TEST_FOR_TOL(x, tol)
Implements the online active set strategy for QPs with varying, sparse matrices.
Implements the online active set strategy for QPs with general constraints.
returnValue getDualSolution(real_t *const yOpt) const