diff --git a/stuff/printing.hh b/stuff/printing.hh index 815636edaf3a781dcf07da2d6dabbac1f1bc7490..3156387683e53632016f8401add017130fd9bc8b 100644 --- a/stuff/printing.hh +++ b/stuff/printing.hh @@ -90,11 +90,11 @@ void printSparseRowMatrixMatlabStyle(const T& arg, std::string name, stream& out const int I = arg.rows(); const int J = arg.cols(); out << boost::format("\n%s =sparse( %d, %d );") % name % I % J << std::endl; - for (size_t row = 0; row < arg.rows(); row++) { - for (size_t col = 0; col < arg.cols(); col++) { - const auto value = arg(row, col); - if (std::fabs(value) > eps) - out << name << "(" << row + 1 << "," << col + 1 << ")=" << std::setprecision(matlab_output_precision) << value + for (int row = 0; row < arg.rows(); row++) { + for (int col = 0; col < arg.cols(); col++) { + const double val = arg(row, col); + if (std::fabs(val) > eps) + out << name << "(" << row + 1 << "," << col + 1 << ")=" << std::setprecision(matlab_output_precision) << val << ";\n"; } }