Go to the documentation of this file.00001
00002 #ifndef vnl_matlab_filewrite_h_
00003 #define vnl_matlab_filewrite_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <vcl_string.h>
00019 #include <vcl_fstream.h>
00020 #include <vcl_complex.h>
00021
00022 #include <vnl/vnl_vector.h>
00023 #include <vnl/vnl_matrix.h>
00024
00025
00026
00027
00028
00029 class vnl_matlab_filewrite
00030 {
00031 public:
00032 vnl_matlab_filewrite (char const* file_name, char const *basename = 0);
00033
00034
00035
00036
00037 void write(double v, char const* variable_name = 0);
00038
00039 void write(vnl_vector<double> const & v, char const* variable_name = 0);
00040 void write(vnl_vector<vcl_complex<double> > const & v, char const* variable_name = 0);
00041
00042 void write(vnl_matrix<float> const & M, char const* variable_name = 0);
00043 void write(vnl_matrix<double> const & M, char const* variable_name = 0);
00044 void write(vnl_matrix<vcl_complex<float> > const & M, char const* variable_name = 0);
00045 void write(vnl_matrix<vcl_complex<double> > const & M, char const* variable_name = 0);
00046
00047 void write(double const * const *M, int rows, int cols, char const* variable_name = 0);
00048
00049 protected:
00050 vcl_string basename_;
00051 int variable_int_;
00052 vcl_fstream out_;
00053
00054 vcl_string make_var_name(char const* variable_name);
00055 };
00056
00057 #endif // vnl_matlab_filewrite_h_