
22 Jul
2011
22 Jul
'11
7:49 p.m.
Right now, I'm using boost::multi_array for implementing a dynamic-sized matrix for an algorithm in which the number of rows and columns therein may wildly fluctuate (is boost::multi_array even the right class for this?). What's frustrating me is how I can do any and all of the following: 1. Remove a single row or column from a matrix 2. Insert a single row or column to a matrix 3. Augment two matrices together 4. Swap two rows or columns Is there any way to do the first three without calling resize() and moving the elements around manually? For the last, does something like std::swap(A[row1], A[row2]) work?