#ifndef IGL_PINV_H #define IGL_PINV_H #include "igl_inline.h" #include namespace igl { // Compute the Moore-Penrose pseudoinverse // // Inputs: // A m by n matrix // tol tolerance (if negative then default is used) // Outputs: // X n by m matrix so that A*X*A = A and X*A*X = X and A*X = (A*X)' and // (X*A) = (X*A)' template void pinv( const Eigen::MatrixBase & A, typename DerivedA::Scalar tol, Eigen::PlainObjectBase & X); // Wrapper using default tol template void pinv( const Eigen::MatrixBase & A, Eigen::PlainObjectBase & X); } #ifndef IGL_STATIC_LIBRARY # include "pinv.cpp" #endif #endif