Directory: | ./ |
---|---|
File: | include/tsid/solvers/solver-HQP-output.hpp |
Date: | 2024-11-10 01:12:44 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 6 | 8 | 75.0% |
Branches: | 2 | 10 | 20.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | // | ||
2 | // Copyright (c) 2017 CNRS | ||
3 | // | ||
4 | // This file is part of tsid | ||
5 | // tsid is free software: you can redistribute it | ||
6 | // and/or modify it under the terms of the GNU Lesser General Public | ||
7 | // License as published by the Free Software Foundation, either version | ||
8 | // 3 of the License, or (at your option) any later version. | ||
9 | // tsid is distributed in the hope that it will be | ||
10 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty | ||
11 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | // General Lesser Public License for more details. You should have | ||
13 | // received a copy of the GNU Lesser General Public License along with | ||
14 | // tsid If not, see | ||
15 | // <http://www.gnu.org/licenses/>. | ||
16 | // | ||
17 | |||
18 | #ifndef __invdyn_solvers_hqp_output_hpp__ | ||
19 | #define __invdyn_solvers_hqp_output_hpp__ | ||
20 | |||
21 | #include "tsid/solvers/fwd.hpp" | ||
22 | #include "tsid/math/fwd.hpp" | ||
23 | |||
24 | #include <vector> | ||
25 | |||
26 | namespace tsid { | ||
27 | namespace solvers { | ||
28 | |||
29 | class HQPOutput { | ||
30 | public: | ||
31 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW | ||
32 | |||
33 | typedef math::Vector Vector; | ||
34 | typedef math::VectorXi VectorXi; | ||
35 | |||
36 | HQPStatus status; /// solver status | ||
37 | Vector x; /// solution | ||
38 | Vector lambda; /// Lagrange multipliers | ||
39 | VectorXi activeSet; /// indexes of active inequalities | ||
40 | int iterations; /// number of iterations performed by the solver | ||
41 | |||
42 |
2/4✓ Branch 2 taken 1102 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1102 times.
✗ Branch 6 not taken.
|
1102 | HQPOutput() {} |
43 | |||
44 | ✗ | HQPOutput(unsigned int nVars, unsigned int nEqCon, unsigned int nInCon) { | |
45 | ✗ | resize(nVars, nEqCon, nInCon); | |
46 | } | ||
47 | |||
48 | 4 | void resize(unsigned int nVars, unsigned int nEqCon, unsigned int nInCon) { | |
49 | 4 | x.resize(nVars); | |
50 | 4 | lambda.resize(nEqCon + nInCon); | |
51 | 4 | activeSet.resize(nInCon); | |
52 | 4 | } | |
53 | }; | ||
54 | } // namespace solvers | ||
55 | } // namespace tsid | ||
56 | |||
57 | #endif // ifndef __invdyn_solvers_hqp_output_hpp__ | ||
58 |