svd_eigen_HH.hpp
Go to the documentation of this file.
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 
31 using namespace Eigen;
32 
33 namespace KDL
34 {
35  inline double PYTHAG(double a,double b) {
36  double at,bt,ct;
37  at = fabs(a);
38  bt = fabs(b);
39  if (at > bt ) {
40  ct=bt/at;
41  return at*sqrt(1.0+ct*ct);
42  } else {
43  if (bt==0)
44  return 0.0;
45  else {
46  ct=at/bt;
47  return bt*sqrt(1.0+ct*ct);
48  }
49  }
50  }
51 
52 
53  inline double SIGN(double a,double b) {
54  return ((b) >= 0.0 ? fabs(a) : -fabs(a));
55  }
56 
69  int svd_eigen_HH(const MatrixXd& A,MatrixXd& U,VectorXd& S,MatrixXd& V,VectorXd& tmp,int maxiter=150,double epsilon=1e-300);
70 }
71 #endif
double SIGN(double a, double b)
int svd_eigen_HH(const MatrixXd &A, MatrixXd &U, VectorXd &S, MatrixXd &V, VectorXd &tmp, int maxiter, double epsilon)
double epsilon
default precision while comparing with Equal(..,..) functions. Initialized at 0.0000001.
INLINE Rall1d< T, V, S > sqrt(const Rall1d< T, V, S > &arg)
Definition: rall1d.h:369
double PYTHAG(double a, double b)


orocos_kdl
Author(s):
autogenerated on Sat Jun 15 2019 19:07:36