Loading...
Searching...
No Matches
OptCholesky.hh
Go to the documentation of this file.
1/*
2 * Copyright 2009, 2010,
3 *
4 * Andrei Herdt
5 * Francois Keith
6 * Olivier Stasse
7 *
8 * JRL, CNRS/AIST
9 *
10 * This file is part of walkGenJrl.
11 * walkGenJrl is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * walkGenJrl is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Lesser Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with walkGenJrl. If not, see <http://www.gnu.org/licenses/>.
22 *
23 * Research carried out within the scope of the
24 * Joint Japanese-French Robotics Laboratory (JRL)
25 */
26/* \file Cholesky.h
27 \brief This object provides the Cholesky decomposition
28 of a symmetric positive-definite matrix.
29 This one is especially designed for QP resolution and handle constraints.
30*/
31
32#ifndef _CHOLESKY_DEC_H_
33#define _CHOLESKY_DEC_H_
34
35#include <vector>
36
37using namespace ::std;
38
39namespace PatternGeneratorJRL {
47class OptCholesky {
48
49public:
56 OptCholesky(unsigned int lNbMaxOfConstraints, unsigned int lCardU,
57 unsigned int mode);
58
60 ~OptCholesky();
61
63 void SetA(double *aA, unsigned int lNbOfConstraints);
64
70 int AddActiveConstraints(vector<unsigned int> &lConstraints);
71
76 int AddActiveConstraint(unsigned int aConstraint);
77
80 std::size_t CurrentNumberOfRows();
81
83 int ComputeNormalCholeskyOnANormal();
84
86 int ComputeInverseCholeskyNormal(int mode);
87
89 void SetL(double *aL);
90
92 void SetiL(double *aiL);
93
95 void SetToZero();
96
98 void SetMode(unsigned int mode);
99
101 static const unsigned int MODE_NORMAL = 0;
102 static const unsigned int MODE_FORTRAN = 1;
103
104private:
107 unsigned int m_NbMaxOfConstraints;
108
111 unsigned int m_CardU;
112
115 double *m_A;
116
119 double *m_L;
120
123 double *m_iL;
124
126 unsigned int m_UpdateMode;
127
129 unsigned int m_NbOfConstraints;
130
133 vector<unsigned int> m_SetActiveConstraints;
134
136 int UpdateCholeskyMatrixFortran();
137
139 int UpdateCholeskyMatrixNormal();
140
142 void FreeMemory();
143
145 void InitializeInternalVariables();
146};
147} // namespace PatternGeneratorJRL
148
149#endif /* _CHOLESKY_DEC_H_ */
\doc Simulate a rigid body
Definition: patterngeneratorinterface.hh:41