Sergey Sergey - 5 months ago 30
C++ Question

Does Boost provide a facility for printing uBLAS datatypes?

I'm debugging an application that massively uses uBLAS vectors and matrices. I would like to print them to console with something like:

boost::numeric::ublas::vector<double> v;
// ...filling v...
std::cout << v; // or boost::whatever << v;

Exact output format does dot matter, I just want to look at the vector contents. Does Boost provide such an overload of
with uBLAS types? Any other short way of printing uBLAS types would be OK too. It's not a big effort to write these functions by myself, but I'm looking for a "standard" technique to do it, if any.


boost/numeric/ublas/io.hpp defines operator<< for uBlas components.