Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

vnl_matlab_print.h

Go to the documentation of this file.
00001 #ifndef vnl_matlab_print_h_
00002 #define vnl_matlab_print_h_
00003 // This is vxl/vnl/vnl_matlab_print.h
00004 
00005 //: \file
00006 //  \brief Print matrices and vectors in nice MATLAB format.
00007 //  \author fsm@robots.ox.ac.uk, from awf's MatOps code.
00008 
00009 
00010 template <class T> class vnl_vector;
00011 template <class T> class vnl_matrix;
00012 template <class T> class vnl_diag_matrix;
00013 #include <vcl_iosfwd.h>
00014 
00015 #include <vnl/vnl_matlab_print_format.h>
00016 
00017 // If a variable name (e.g. "foo") is given, the raw data will be preceded by
00018 //   "foo = diag([ " for a vnl_diag_matrix
00019 //   "foo = [ ...\n" for a vnl_matrix and
00020 //   "foo = [ "      for a vnl_vector
00021 // and followed by "])\n", "]\n" and "]\n" respectively. If the variable name
00022 // is a null pointer, the data is printed as is.
00023 
00024 //: print a 1D array.
00025 template <class T>
00026 vcl_ostream &vnl_matlab_print(vcl_ostream &,
00027                           T const *array,
00028                           unsigned length,
00029                           vnl_matlab_print_format =vnl_matlab_print_format_default);
00030 
00031 //: print a 2D array.
00032 template <class T>
00033 vcl_ostream &vnl_matlab_print(vcl_ostream &,
00034                           T const * const *array,
00035                           unsigned rows, unsigned cols,
00036                           vnl_matlab_print_format =vnl_matlab_print_format_default);
00037 
00038 //: print a vnl_diagonal_matrix<>.
00039 template <class T>
00040 vcl_ostream &vnl_matlab_print(vcl_ostream &,
00041                           vnl_diag_matrix<T> const &,
00042                           char const *variable_name =0,
00043                           vnl_matlab_print_format =vnl_matlab_print_format_default);
00044 
00045 //: print a vnl_matrix<>.
00046 template <class T>
00047 vcl_ostream &vnl_matlab_print(vcl_ostream &,
00048                           vnl_matrix<T> const &,
00049                           char const *variable_name =0,
00050                           vnl_matlab_print_format =vnl_matlab_print_format_default);
00051 
00052 //: print a vnl_vector<>.
00053 template <class T>
00054 vcl_ostream &vnl_matlab_print(vcl_ostream &,
00055                           vnl_vector<T> const &,
00056                           char const *variable_name =0,
00057                           vnl_matlab_print_format =vnl_matlab_print_format_default);
00058 
00059 
00060 //: naughty naming-convention-defying-but-handy macro.
00061 #define MATLABPRINT(X) (vnl_matlab_print(vcl_cerr, X, #X))
00062 
00063 #endif // vnl_matlab_print_h_

Generated at Fri May 21 01:15:48 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000