soc-2008-mxcurioni: merged changes to revision 23516
[blender.git] / intern / itasc / Solver.hpp
1 /* $Id: Solver.hpp 20622 2009-06-04 12:47:59Z ben2610 $
2  * Solver.hpp
3  *
4  *  Created on: Jan 8, 2009
5  *      Author: rubensmits
6  */
7
8 #ifndef SOLVER_HPP_
9 #define SOLVER_HPP_
10
11 #include <vector>
12 #include "eigen_types.hpp"
13
14 namespace iTaSC{
15
16 class Solver{
17 public:
18         enum SolverParam {
19                 DLS_QMAX = 0,
20                 DLS_LAMBDA_MAX,
21                 DLS_EPSILON
22         };
23     virtual ~Solver(){};
24
25         // gc = grouping of constraint output , 
26         //      size of vector = nc, alternance of true / false to indicate the grouping of output
27         virtual bool init(unsigned int nq, unsigned int nc, const std::vector<bool>& gc)=0;
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)=0;
29         virtual void setParam(SolverParam param, double value)=0;
30 };
31
32 }
33 #endif /* SOLVER_HPP_ */