Is there a way to initialize a vector of vectors in the same ,quick, manner as you initialize a matrix?
typedef int type;
type matrix[2][2]=
{
{1,0},{0,1}
In C++0x, I think you can use the same syntax as for your matrix.
In C++03, you have to write some tedious code to populate it. Boost.Assign might be able to simplify it somewhat, using something like the following untested code:
#include
vector > v;
v += list_of(1)(0), list_of(0)(1);
or even
vector > v = list_of(list_of(1)(0))(list_of(0)(1));