How can I define a array of boost matrices as a member variable?
None of the following worked.
boost::numeric::ublas::matrix<double> arrayM(1, 3)[arraySize];
boost::numeric::ublas::matrix<double>(1, 3) arrayM[arraySize];
boost::numeric::ublas::matrix<double> arrayM[arraySize](1, 3);
Thanks,
Ravi.
The size you initialize it with has nothing to do with the type. Therefore:
The problem comes with initializing the array. You can’t do this:
Instead, you have to let them default-construct, then resize them all:
Since you’re using boost, consider using
boost::array, since it gives a nicer syntax: