DMP_BBO library
EigenFileIO.hpp
Go to the documentation of this file.
1 
26 #ifndef EIGENSAVEMATRIX_HPP
27 #define EIGENSAVEMATRIX_HPP
28 
29 #include <string>
30 #include <fstream>
31 #include <iostream>
32 
33 #include <boost/filesystem.hpp>
34 
35 #include <eigen3/Eigen/Core>
36 
37 namespace DmpBbo {
38 
44 template<typename Scalar, int RowsAtCompileTime, int ColsAtCompileTime>
45 bool loadMatrix(std::string filename, Eigen::Matrix<Scalar,RowsAtCompileTime,ColsAtCompileTime>& m);
46 
54 template<typename Scalar, int RowsAtCompileTime, int ColsAtCompileTime>
55 bool saveMatrix(std::string filename, Eigen::Matrix<Scalar,RowsAtCompileTime,ColsAtCompileTime> matrix, bool overwrite=false);
56 
65 template<typename Scalar, int RowsAtCompileTime, int ColsAtCompileTime>
66 bool saveMatrix(std::string directory, std::string filename, Eigen::Matrix<Scalar,RowsAtCompileTime,ColsAtCompileTime> matrix, bool overwrite=false);
67 
68 #include "EigenFileIO.tpp"
69 
70 }
71 
72 #endif // #ifndef EIGENSAVEMATRIX_HPP
73 
Source file for input/output of Eigen matrices to ASCII files.
bool saveMatrix(std::string filename, Eigen::Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTime > matrix, bool overwrite=false)
Save an Eigen matrix to an ASCII file.
bool loadMatrix(std::string filename, Eigen::Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTime > &m)
Load an Eigen matrix from an ASCII file.
Definition: EigenFileIO.tpp:33