#include "polar_dec.h" #include "polar_svd.h" #ifdef _WIN32 #else # include #endif #include #include #include // From Olga's CGAL mentee's ARAP code template < typename DerivedA, typename DerivedR, typename DerivedT, typename DerivedU, typename DerivedS, typename DerivedV> IGL_INLINE void igl::polar_dec( const Eigen::PlainObjectBase & A, Eigen::PlainObjectBase & R, Eigen::PlainObjectBase & T, Eigen::PlainObjectBase & U, Eigen::PlainObjectBase & S, Eigen::PlainObjectBase & V) { using namespace std; typedef typename DerivedA::Scalar Scalar; const Scalar th = std::sqrt(Eigen::NumTraits::dummy_precision()); Eigen::SelfAdjointEigenSolver eig; feclearexcept(FE_UNDERFLOW); eig.computeDirect(A.transpose()*A); if(fetestexcept(FE_UNDERFLOW) || eig.eigenvalues()(0)/eig.eigenvalues()(2) th) { cout<<"resorting to svd 2..."< IGL_INLINE void igl::polar_dec( const Eigen::PlainObjectBase & A, Eigen::PlainObjectBase & R, Eigen::PlainObjectBase & T) { Eigen::PlainObjectBase U; Eigen::PlainObjectBase V; Eigen::Matrix S; return igl::polar_dec(A,R,T,U,S,V); } #ifndef IGL_HEADER_ONLY // Explicit template instanciation template void igl::polar_dec, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); #endif