core/vnl/xio/vnl_xio_matrix_fixed.h
Go to the documentation of this file.
00001 // This is core/vnl/xio/vnl_xio_matrix_fixed.h
00002 #ifndef vnl_xio_matrix_fixed_h
00003 #define vnl_xio_matrix_fixed_h
00004 //:
00005 // \file
00006 // \brief XML write a vnl_matrix_fixed
00007 //  Two functions which write a valid XML fragment to an ostream.
00008 //  The matrix dimensions are output as attributes of the (top) node.
00009 // - x_write() writes a single XML element node with text content only:
00010 //             space-separated coordinates.
00011 // - x_write_tree() writes a 3-level XML fragment: one top element node,
00012 //                  one level below it for the matrix rows, and one level
00013 //                  below that with the individual matrix elements (element
00014 //                  nodes with a single value each).
00015 //  The name of the top node can be chosen; by default, it is "vnl_matrix_fixed".
00016 //  The names of the intermediate nodes are "row" and "cell", respectively.
00017 // \author Gamze D. Tunali
00018 // \date 22-Dec-2005
00019 // \verbatim
00020 //  Modifications
00021 //   29 July 2011 - Peter Vanroose - added documentation, tests, and x_write_tree()
00022 // \endverbatim
00023 
00024 #include <vnl/vnl_matrix_fixed.h>
00025 #include <vcl_string.h>
00026 #include <vcl_iosfwd.h>
00027 
00028 //: XML save vnl_matrix_fixed to stream.
00029 // \relatesalso vnl_matrix_fixed
00030 template <class T, unsigned m, unsigned n>
00031 void x_write(vcl_ostream & os, vnl_matrix_fixed<T,m,n> const& v,
00032              vcl_string name="vnl_matrix_fixed");
00033 
00034 //: XML save vnl_matrix_fixed as a 3-level tree to stream.
00035 // \relatesalso vnl_matrix_fixed
00036 template <class T, unsigned m, unsigned n>
00037 void x_write_tree(vcl_ostream & os, vnl_matrix_fixed<T,m,n> const& v,
00038                   vcl_string name="vnl_matrix_fixed");
00039 
00040 #define VNL_XIO_MATRIX_FIXED_INSTANTIATE(T) extern "Please #include <vnl/xio/vnl_xio_matrix_fixed.txx> first"
00041 
00042 #endif // vnl_xio_matrix_fixed_h