00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef MTL_IO_MATRIX_FILE_INCLUDE
00013 #define MTL_IO_MATRIX_FILE_INCLUDE
00014
00015 namespace mtl { namespace io {
00016
00017 template <typename MatrixIFStream, typename MatrixOFStream>
00018 class matrix_file
00019 {
00020 public:
00021 explicit matrix_file(const std::string& fname) : fname(fname) {}
00022 explicit matrix_file(const char* fname) : fname(fname) {}
00023
00024 std::string file_name() const { return fname; }
00025
00026 template <typename Collection>
00027 matrix_file& operator=(const Collection& c)
00028 {
00029 MatrixOFStream stream(fname);
00030 stream << c;
00031 return *this;
00032 }
00033
00034 protected:
00035 std::string fname;
00036 };
00037
00038 }}
00039
00040 #endif // MTL_IO_MATRIX_FILE_INCLUDE