core/vnl/vnl_file_matrix.txx
Go to the documentation of this file.
00001 // This is core/vnl/vnl_file_matrix.txx
00002 #ifndef vnl_file_matrix_txx_
00003 #define vnl_file_matrix_txx_
00004 //:
00005 // \file
00006 //
00007 // \author Andrew W. Fitzgibbon, Oxford RRG
00008 // \date   23 Dec 96
00009 //
00010 //-----------------------------------------------------------------------------
00011 
00012 #include "vnl_file_matrix.h"
00013 #include <vcl_fstream.h>
00014 #include <vcl_iostream.h>
00015 
00016 //: Load matrix from filename.
00017 template <class T>
00018 vnl_file_matrix<T>::vnl_file_matrix(char const* filename)
00019 {
00020   if (filename && filename[0]=='-' && filename[1]=='\0')
00021     ok_ = this->read_ascii(vcl_cin);
00022   else {
00023     vcl_ifstream o(filename);
00024     ok_ = this->read_ascii(o);
00025   }
00026 
00027   if (!ok_)
00028     vcl_cerr << "vnl_file_matrix: ERROR loading " << filename << '\n';
00029 }
00030 
00031 //--------------------------------------------------------------------------------
00032 
00033 #undef VNL_FILE_MATRIX_INSTANTIATE
00034 #define VNL_FILE_MATRIX_INSTANTIATE(T) template class vnl_file_matrix<T >
00035 
00036 #endif // vnl_file_matrix_txx_