#include "polar_svd.h" #include // Adapted from Olga's CGAL mentee's ARAP code template < typename DerivedA, typename DerivedR, typename DerivedT> IGL_INLINE void igl::polar_svd( const Eigen::PlainObjectBase & A, Eigen::PlainObjectBase & R, Eigen::PlainObjectBase & T) { Eigen::PlainObjectBase U; Eigen::PlainObjectBase V; Eigen::Matrix S; return igl::polar_svd(A,R,T,U,S,V); } template < typename DerivedA, typename DerivedR, typename DerivedT, typename DerivedU, typename DerivedS, typename DerivedV> IGL_INLINE void igl::polar_svd( const Eigen::PlainObjectBase & A, Eigen::PlainObjectBase & R, Eigen::PlainObjectBase & T, Eigen::PlainObjectBase & U, Eigen::PlainObjectBase & S, Eigen::PlainObjectBase & V) { Eigen::JacobiSVD svd; svd.compute(A, Eigen::ComputeFullU | Eigen::ComputeFullV ); U = svd.matrixU(); V = svd.matrixV(); S = svd.singularValues(); R = U*V.transpose(); T = V*S.asDiagonal()*V.adjoint(); } #ifndef IGL_HEADER_ONLY // Explicit template instanciation template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); template void igl::polar_svd, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); #endif