Boost logo

Boost Users :

Subject: [Boost-users] Manipulating boost::multi_array
From: kelvSYC (kelvsyc_at_[hidden])
Date: 2011-07-22 15:49:24

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?

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at