vnl_xio_matrix.h
Go to the documentation of this file.
1 // This is core/vnl/xio/vnl_xio_matrix.h
2 #ifndef vnl_xio_matrix_h
3 #define vnl_xio_matrix_h
4 //:
5 // \file
6 // \brief XML write a vnl_matrix
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".
16 // The names of the intermediate nodes are "row" and "cell", respectively.
17 // \author Peter Vanroose
18 // \date 29 July 2011
19 // \verbatim
20 // Modifications
21 // <none yet>
22 // \endverbatim
23 
24 #include <string>
25 #include <iosfwd>
26 #include <vnl/vnl_matrix.h>
27 #ifdef _MSC_VER
28 # include <vcl_msvc_warnings.h>
29 #endif
30 
31 //: XML save vnl_matrix to stream.
32 // \relatesalso vnl_matrix
33 template <class T>
34 void VNL_EXPORT x_write(std::ostream & os, vnl_matrix<T> const& v,
35  std::string name="vnl_matrix");
36 
37 //: XML save vnl_matrix as a 3-level tree to stream.
38 // \relatesalso vnl_matrix
39 template <class T>
40 void VNL_EXPORT x_write_tree(std::ostream & os, vnl_matrix<T> const& v,
41  std::string name="vnl_matrix");
42 
43 #define VNL_XIO_MATRIX_INSTANTIATE(T) extern "Please #include <vnl/xio/vnl_xio_matrix.hxx> first"
44 
45 #endif // vnl_xio_matrix_h
An ordinary mathematical matrix.
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.
#define v
Definition: vnl_vector.h:42
An ordinary mathematical matrix.
Definition: vnl_adjugate.h:22
void VNL_EXPORT x_write(std::ostream &os, vnl_matrix< T > const &v, std::string name="vnl_matrix")
XML save vnl_matrix to stream.