svn merge ^/trunk/blender -r41226:41227 .
[blender.git] / intern / itasc / WDLSSolver.hpp
1  * WDLSSolver.hpp
2  *
3  *  Created on: Jan 8, 2009
4  *      Author: rubensmits
5  */
6
7 #ifndef WDLSSOLVER_HPP_
8 #define WDLSSOLVER_HPP_
9
10 #include "Solver.hpp"
11
12 namespace iTaSC {
13
14 class WDLSSolver: public iTaSC::Solver {
15 private:
16     e_matrix m_AWq,m_WyAWq,m_WyAWqt,m_U,m_V,m_WqV;
17     e_vector m_S,m_temp,m_Wy_ydot;
18     double m_lambda;
19     double m_epsilon;
20         double m_qmax;
21         int m_ns;
22         bool m_transpose;
23 public:
24     WDLSSolver();
25     virtual ~WDLSSolver();
26
27     virtual bool init(unsigned int nq, unsigned int nc, const std::vector<bool>& gc);
28     virtual bool solve(const e_matrix& A, const e_vector& Wy, const e_vector& ydot, const e_matrix& Wq, e_vector& qdot, e_scalar& nlcoef);
29         virtual void setParam(SolverParam param, double value)
30         {
31                 switch (param) {
32                 case DLS_QMAX:
33                         m_qmax = value;
34                         break;
35                 case DLS_LAMBDA_MAX:
36                         m_lambda = value;
37                         break;
38                 case DLS_EPSILON:
39                         m_epsilon = value;
40                         break;
41                 }       
42         }
43 };
44
45 }
46
47 #endif /* WDLSSOLVER_HPP_ */