From b15b0364e1af08c98a31689083cdc8f2319e825e Mon Sep 17 00:00:00 2001 From: Rene Milk <rene.milk@uni-muenster.de> Date: Thu, 2 Sep 2010 14:52:15 +0200 Subject: [PATCH] example usage of boost::format --- stuff/printing.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stuff/printing.hh b/stuff/printing.hh index d4e76b7e3..025a737e5 100644 --- a/stuff/printing.hh +++ b/stuff/printing.hh @@ -5,6 +5,7 @@ #include <iostream> #include <iomanip> #include <cmath> +#include <boost/format.hpp> #include <dune/stuff/functions.hh> #include <dune/stuff/parametercontainer.hh> @@ -84,7 +85,7 @@ void printSparseRowMatrixMatlabStyle(const T& arg, const std::string name, strea { const int I = arg.rows(); const int J = arg.cols(); - out << "\n" << name << " = sparse( " << I << ", " << J << ");" << std::endl; + out << boost::format("\n%s =sparse( %d, %d );") % name % I % J << std::endl; for (int row = 0; row < arg.rows(); row++) { for (int col = 0; col < arg.cols(); col++) { if (arg(row, col) > eps) -- GitLab