Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada committed Feb 24, 2015
1 parent 63cd390 commit 47ecaa8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
22 changes: 0 additions & 22 deletions hrplib/hrpUtil/EigenTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,4 @@ namespace hrp{
#include <iostream>
#include <iomanip>

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
22 changes: 22 additions & 0 deletions hrplib/hrpUtil/MatrixSolvers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 47ecaa8

Please sign in to comment.