3 #include <Eigen/Eigenvalues> 11 template <
typename _MatrixType>
12 static typename _MatrixType::PlainObject guaranteeSPD (
const _MatrixType &A,
const typename _MatrixType::RealScalar& minEig = 0.0)
14 typedef typename _MatrixType::PlainObject Matrix;
15 typedef Eigen::SelfAdjointEigenSolver<Matrix> EigenDecomp;
16 typedef typename EigenDecomp::RealVectorType EigenValues;
19 Eigen::SelfAdjointEigenSolver<Matrix> eigOfA (A, Eigen::ComputeEigenvectors);
22 EigenValues s = eigOfA.eigenvalues();
23 s = s.cwiseMax(minEig);
26 Matrix spdA = eigOfA.eigenvectors() * s.asDiagonal() * eigOfA.eigenvectors().adjoint();
Definition: LinearAngular6DCommand.hpp:8