OGS
EigenMatrix.cpp
Go to the documentation of this file.
1
11#include "EigenMatrix.h"
12
13#include <fstream>
14
15namespace MathLib
16{
17
19void EigenMatrix::write(const std::string& filename) const
20{
21 std::ofstream of(filename);
22 if (of)
23 {
24 write(of);
25 }
26}
27
29void EigenMatrix::write(std::ostream& os) const
30{
31 for (int k = 0; k < mat_.outerSize(); ++k)
32 {
33 for (RawMatrixType::InnerIterator it(mat_, k); it; ++it)
34 {
35 os << it.row() << " " << it.col() << " " << it.value() << "\n";
36 }
37 }
38 os << std::endl;
39}
40} // namespace MathLib
void write(const std::string &filename) const
printout this matrix for debugging
RawMatrixType mat_