38 #include <qpOASES.hpp> 50 real_t errP1, errP2, errP3, errD1, errD2, errD3,
tic,
toc;
79 fprintf(
stdFile,
"Solved dense problem in %d iterations, %.3f seconds.\n", (
int)nWSR, toc-tic);
90 fprintf(
stdFile,
"Solved sparse problem in %d iterations, %.3f seconds.\n", (
int)nWSR, toc-tic);
101 fprintf(
stdFile,
"Solved sparse problem (Schur complement approach) in %d iterations, %.3f seconds.\n", (
int)nWSR, toc-tic);
108 for (i = 0; i < 180; i++)
109 if (
getAbs(x1[i] - x2[i]) > errP1)
110 errP1 =
getAbs(x1[i] - x2[i]);
111 for (i = 0; i < 180; i++)
112 if (
getAbs(x1[i] - x3[i]) > errP2)
113 errP2 =
getAbs(x1[i] - x3[i]);
114 for (i = 0; i < 180; i++)
115 if (
getAbs(x2[i] - x3[i]) > errP3)
116 errP3 =
getAbs(x2[i] - x3[i]);
118 fprintf(
stdFile,
"Primal error (dense and sparse): %9.2e\n", errP1);
119 fprintf(
stdFile,
"Primal error (dense and Schur): %9.2e\n", errP2);
120 fprintf(
stdFile,
"Primal error (sparse and Schur): %9.2e\n", errP3);
125 for (i = 0; i < 271; i++)
126 if (
getAbs(y1[i] - y2[i]) > errD1)
127 errD1 =
getAbs(y1[i] - y2[i]);
129 for (i = 0; i < 271; i++)
130 if (
getAbs(y1[i] - y3[i]) > errD2)
131 errD2 =
getAbs(y1[i] - y3[i]);
132 for (i = 0; i < 271; i++)
133 if (
getAbs(y2[i] - y3[i]) > errD3)
134 errD3 =
getAbs(y2[i] - y3[i]);
136 fprintf(
stdFile,
"Dual error (dense and sparse): %9.2e (might not be unique)\n", errD1);
137 fprintf(
stdFile,
"Dual error (dense and Schur): %9.2e (might not be unique)\n", errD2);
138 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.
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