Orocos KDL
svd_eigen_HH.hpp
1// Copyright (C) 2007 Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
2
3// Version: 1.0
4// Author: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
5// Maintainer: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
6// URL: http://www.orocos.org/kdl
7
8// This library is free software; you can redistribute it and/or
9// modify it under the terms of the GNU Lesser General Public
10// License as published by the Free Software Foundation; either
11// version 2.1 of the License, or (at your option) any later version.
12
13// This library is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16// Lesser General Public License for more details.
17
18// You should have received a copy of the GNU Lesser General Public
19// License along with this library; if not, write to the Free Software
20// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
22
23//Based on the svd of the KDL-0.2 library by Erwin Aertbelien
24#ifndef SVD_EIGEN_HH_HPP
25#define SVD_EIGEN_HH_HPP
26
27
28#include <Eigen/Core>
29#include <algorithm>
30
31namespace KDL
32{
33 inline double PYTHAG(double a,double b) {
34 double at,bt,ct;
35 at = fabs(a);
36 bt = fabs(b);
37 if (at > bt ) {
38 ct=bt/at;
39 return at*sqrt(1.0+ct*ct);
40 } else {
41 if (bt==0)
42 return 0.0;
43 else {
44 ct=at/bt;
45 return bt*sqrt(1.0+ct*ct);
46 }
47 }
48 }
49
50
51 inline double SIGN(double a,double b) {
52 return ((b) >= 0.0 ? fabs(a) : -fabs(a));
53 }
54
67 int svd_eigen_HH(const Eigen::MatrixXd& A,Eigen::MatrixXd& U,Eigen::VectorXd& S,Eigen::MatrixXd& V,Eigen::VectorXd& tmp,int maxiter=150,double epsilon=1e-300);
68}
69#endif
Definition articulatedbodyinertia.hpp:32
double PYTHAG(double a, double b)
Definition svd_eigen_HH.hpp:33
INLINE Rall1d< T, V, S > sqrt(const Rall1d< T, V, S > &arg)
Definition rall1d.h:369
int svd_eigen_HH(const Eigen::MatrixXd &A, Eigen::MatrixXd &U, Eigen::VectorXd &S, Eigen::MatrixXd &V, Eigen::VectorXd &tmp, int maxiter=150, double epsilon=1e-300)
double SIGN(double a, double b)
Definition svd_eigen_HH.hpp:51
double epsilon
default precision while comparing with Equal(..,..) functions. Initialized at 0.0000001.