vnl_xio_matrix_fixed.h
Go to the documentation of this file.
1 // This is core/vnl/xio/vnl_xio_matrix_fixed.h
2 #ifndef vnl_xio_matrix_fixed_h
3 #define vnl_xio_matrix_fixed_h
4 //:
5 // \file
6 // \brief XML write a vnl_matrix_fixed
7 // Two functions which write a valid XML fragment to an ostream.
8 // The matrix dimensions are output as attributes of the (top) node.
9 // - x_write() writes a single XML element node with text content only:
10 // space-separated coordinates.
11 // - x_write_tree() writes a 3-level XML fragment: one top element node,
12 // one level below it for the matrix rows, and one level
13 // below that with the individual matrix elements (element
14 // nodes with a single value each).
15 // The name of the top node can be chosen; by default, it is "vnl_matrix_fixed".
16 // The names of the intermediate nodes are "row" and "cell", respectively.
17 // \author Gamze D. Tunali
18 // \date 22-Dec-2005
19 // \verbatim
20 // Modifications
21 // 29 July 2011 - Peter Vanroose - added documentation, tests, and x_write_tree()
22 // \endverbatim
23 
24 #include <string>
25 #include <iosfwd>
26 #include <vnl/vnl_matrix_fixed.h>
27 #ifdef _MSC_VER
28 # include <vcl_msvc_warnings.h>
29 #endif
30 
31 //: XML save vnl_matrix_fixed to stream.
32 // \relatesalso vnl_matrix_fixed
33 template <class T, unsigned m, unsigned n>
34 void x_write(std::ostream & os, vnl_matrix_fixed<T,m,n> const& v,
35  std::string name="vnl_matrix_fixed");
36 
37 //: XML save vnl_matrix_fixed as a 3-level tree to stream.
38 // \relatesalso vnl_matrix_fixed
39 template <class T, unsigned m, unsigned n>
40 void x_write_tree(std::ostream & os, vnl_matrix_fixed<T,m,n> const& v,
41  std::string name="vnl_matrix_fixed");
42 
43 #define VNL_XIO_MATRIX_FIXED_INSTANTIATE(T) extern "Please #include <vnl/xio/vnl_xio_matrix_fixed.hxx> first"
44 
45 #endif // vnl_xio_matrix_fixed_h
void VNL_EXPORT x_write_tree(std::ostream &os, vnl_matrix< T > const &v, std::string name="vnl_matrix")
XML save vnl_matrix as a 3-level tree to stream.
Fixed size, stack-stored, space-efficient matrix.
Definition: vnl_fwd.h:23
#define v
Definition: vnl_vector.h:42
fixed size matrix
void VNL_EXPORT x_write(std::ostream &os, vnl_matrix< T > const &v, std::string name="vnl_matrix")
XML save vnl_matrix to stream.