I'm trying to read in a file that contains matrix data into a boost matrix. "" is already supposed to have operator overloads for this sort of thing and I can get it to write to a standard stream (cout). I don't know what's wrong with going the other way. I'm fairly new to C++, so I'm guessing I'm making an incorrect assumption regarding file streams, but it seemed like it made sense. Here are the web pages I'm going on:
http://www.boost.org/doc/libs/1_51_0/boost/numeric/ublas/io.hpp
http://www.cplusplus.com/reference/iostream/ifstream/ifstream/
Here's my code:
using namespace std;
matrix<double> M;
ifstream s("C:\temp\perm.txt", ifstream::in);
s >> M;
s.close();
std::cout << M;
Here's what my file looks like:
[4,4]((0,0,1,0),(0,0,0,1),(0,1,0,0),(1,0,0,0))