MatrixSolvers.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
3  * All rights reserved. This program is made available under the terms of the
4  * Eclipse Public License v1.0 which accompanies this distribution, and is
5  * available at http://www.eclipse.org/legal/epl-v10.html
6  * Contributors:
7  * National Institute of Advanced Industrial Science and Technology (AIST)
8  * General Robotix Inc.
9  */
10 
11 #ifndef HRPUTIL_MATRIX_SOLVERS_H_INCLUDED
12 #define HRPUTIL_MATRIX_SOLVERS_H_INCLUDED
13 
14 #include "EigenTypes.h"
15 #include "config.h"
16 
17 namespace hrp {
18 
22  HRP_UTIL_EXPORT int solveLinearEquation(const dmatrix &_a, const dvector &_b, dvector &_x, double _sv_ratio=1.0e-3);
23 
25  HRP_UTIL_EXPORT int solveLinearEquationLU(const dmatrix &_a, const dvector &_b, dvector &_x);
26  HRP_UTIL_EXPORT int solveLinearEquationSVD(const dmatrix &_a, const dvector &_b, dvector &_x, double _sv_ratio=1.0e-3);
27 
28  HRP_UTIL_EXPORT int calcPseudoInverse(const dmatrix &_a, dmatrix &_a_pseu, double _sv_ratio=1.0e-3);
29 
30  HRP_UTIL_EXPORT int calcEigenVectors(const dmatrix &_a, dmatrix &_evec, dvector &_eval);
31  HRP_UTIL_EXPORT int calcSRInverse(const dmatrix& _a, dmatrix &_a_sr, double _sr_ratio, dmatrix _w);
32  HRP_UTIL_EXPORT double det(const dmatrix &a);
33 
37  inline dmatrix inverse(const dmatrix& M)
38  {
39  const int dim = M.rows();
40  dmatrix E = dmatrix::Identity(dim,dim);
41  dmatrix Minv(dim, dim);
42  solveLinearEquationLU(M, E, Minv);
43  return Minv;
44  }
45 
46 };
47 
48 #endif
Eigen::MatrixXd dmatrix
Definition: EigenTypes.h:13
int solveLinearEquationSVD(const dmatrix &_a, const dvector &_b, dvector &_x, double _sv_ratio)
Eigen::VectorXd dvector
Definition: EigenTypes.h:14
dmatrix inverse(const dmatrix &M)
Definition: MatrixSolvers.h:37
long b
Definition: jpegint.h:371
double det(const dmatrix &_a)
int calcSRInverse(const dmatrix &_a, dmatrix &_a_sr, double _sr_ratio, dmatrix _w)
#define HRP_UTIL_EXPORT
int calcPseudoInverse(const dmatrix &_a, dmatrix &_a_pseu, double _sv_ratio)
int solveLinearEquation(const dmatrix &_a, const dvector &_b, dvector &_x, double _sv_ratio)
int calcEigenVectors(const dmatrix &_a, dmatrix &_evec, dvector &_eval)
int solveLinearEquationLU(dmatrix a, const dmatrix &b, dmatrix &out_x)


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Sep 8 2022 02:24:04