Boost logo

Ublas :

From: Robbie Vogt (r.vogt_at_[hidden])
Date: 2006-01-11 08:07:08


Hi all,

I've just been having some trouble with processes falling over and found
to my surprise that writing out a matrix is eating up all my memory, and
then some!

The reason seems to be that operator << for both vectors and matrices
compile their output to a temporary stringstream and then send its
contents to the ostream handed to it (via c_str() ). Is there any logic
reason to do this? This is obviously going to cause memory issues for
large matrices for seeming no gain. I notice that the non-generic
version don't bother with the temporary...

Cheers,
Robbie.