]> Dogcows Code - chaz/yoink/blob - src/stlplus/strings/print_matrix.tpp
testing new non-autotools build system
[chaz/yoink] / src / stlplus / strings / print_matrix.tpp
1 ////////////////////////////////////////////////////////////////////////////////
2
3 // Author: Andy Rushton
4 // Copyright: (c) Southampton University 1999-2004
5 // (c) Andy Rushton 2004-2009
6 // License: BSD License, see ../docs/license.html
7
8 ////////////////////////////////////////////////////////////////////////////////
9
10 namespace stlplus
11 {
12
13 ////////////////////////////////////////////////////////////////////////////////
14
15 template<typename T, typename S>
16 void print_matrix(std::ostream& device, const matrix<T>& values,
17 S print_fn,
18 const std::string& column_separator,
19 const std::string& row_separator)
20 {
21 for (unsigned r = 0; r < values.rows(); r++)
22 {
23 if (r != 0) device << row_separator;
24 for (unsigned c = 0; c < values.columns(); c++)
25 {
26 if (c != 0) device << column_separator;
27 print_fn(device, values(r,c));
28 }
29 }
30 }
31
32 } // end namespace stlplus
33
This page took 0.029954 seconds and 4 git commands to generate.