Boost logo

Ublas :

From: pkyoung (pkyoung_at_[hidden])
Date: 2007-03-21 02:34:56

i have trouble with reading ublas matrix from input stream.

after quite long googling, i came to read the previous posting in this
mailing list:

After this posting, is there any progress with this??

in case you cannot read the above link. my problem in detail is as
and the cause of problem is as stated in the link:
> STL shipped with VC2005 does not support
> extraction of numbers separated with anything but whitespace
so the size of matrix enclosed by [ and , ( as in [3,3]) cannot be read.
#include <fstream>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
namespace ub=boost::numeric::ublas;
int main(int argc, char* argv[])
ub::matrix<int> data;
for (int i=0 ; i<3 ; i++)
for (int j=0 ; j<3 ; j++)
std::ofstream ofs("data.txt");
ofs << data << "\n";
ub::matrix<int> out;
std::ifstream ifs("data.txt");
ifs >> out;
std::cout << out << "\n";
return 0;
g++ on linux, this gives
but with vc8.0 this gives