Welcome to mirror list, hosted at ThFree Co, Russian Federation.

WDLSSolver.hpp « itasc « intern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4e72490cf1b8bf5a8127c3052e3c76dd88c43018 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
 * WDLSSolver.hpp
 *
 *  Created on: Jan 8, 2009
 *      Author: rubensmits
 */

#ifndef WDLSSOLVER_HPP_
#define WDLSSOLVER_HPP_

#include "Solver.hpp"

namespace iTaSC {

class WDLSSolver: public iTaSC::Solver {
private:
    e_matrix m_AWq,m_WyAWq,m_WyAWqt,m_U,m_V,m_WqV;
    e_vector m_S,m_temp,m_Wy_ydot;
    double m_lambda;
    double m_epsilon;
	double m_qmax;
	int m_ns;
	bool m_transpose;
public:
    WDLSSolver();
    virtual ~WDLSSolver();

    virtual bool init(unsigned int nq, unsigned int nc, const std::vector<bool>& gc);
    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);
	virtual void setParam(SolverParam param, double value)
	{
		switch (param) {
		case DLS_QMAX:
			m_qmax = value;
			break;
		case DLS_LAMBDA_MAX:
			m_lambda = value;
			break;
		case DLS_EPSILON:
			m_epsilon = value;
			break;
		}	
	}
};

}

#endif /* WDLSSOLVER_HPP_ */