diff --git a/hrplib/hrpUtil/EigenTypes.h b/hrplib/hrpUtil/EigenTypes.h index cd25f14a3..bd0d42154 100644 --- a/hrplib/hrpUtil/EigenTypes.h +++ b/hrplib/hrpUtil/EigenTypes.h @@ -20,26 +20,4 @@ namespace hrp{ #include #include -inline std::ostream& operator<<(std::ostream& out, hrp::dmatrix &a) { - const int c = a.rows(); - const int n = a.cols(); - - for(int i = 0; i < c; i++){ - out << " :"; - for(int j = 0; j < n; j++){ - out << " " << std::setw(7) << std::setiosflags(std::ios::fixed) << std::setprecision(4) << (a)(i,j); - } - out << std::endl; - } -} - -inline std::ostream& operator<<(std::ostream& out, hrp::dvector &a) { - const int n = a.size(); - - for(int i = 0; i < n; i++){ - out << std::setw(7) << std::setiosflags(std::ios::fixed) << std::setprecision(4) << a(i) << " "; - } - out << std::endl; -} - #endif diff --git a/hrplib/hrpUtil/MatrixSolvers.cpp b/hrplib/hrpUtil/MatrixSolvers.cpp index d9f1fb1da..01c0b3674 100644 --- a/hrplib/hrpUtil/MatrixSolvers.cpp +++ b/hrplib/hrpUtil/MatrixSolvers.cpp @@ -46,6 +46,28 @@ extern "C" void dgeev_(char const*jobvl, char const*jobvr, int *n, double *A, int *ldvl, double *vr, int *ldvr, double *work, int *lwork, int *info); +inline std::ostream& operator<<(std::ostream& out, hrp::dmatrix &a) { + const int c = a.rows(); + const int n = a.cols(); + + for(int i = 0; i < c; i++){ + out << " :"; + for(int j = 0; j < n; j++){ + out << " " << std::setw(7) << std::setiosflags(std::ios::fixed) << std::setprecision(4) << (a)(i,j); + } + out << std::endl; + } +} + +inline std::ostream& operator<<(std::ostream& out, hrp::dvector &a) { + const int n = a.size(); + + for(int i = 0; i < n; i++){ + out << std::setw(7) << std::setiosflags(std::ios::fixed) << std::setprecision(4) << a(i) << " "; + } + out << std::endl; +} + // originally in hrpCLAPACK.{cpp,h} // solveLinearEquation() // b = a * x, x = b^(-1) * a