Reputation: 1412
I want a matrix container class that has similar functionality to vector<vector<type>>, but stores elements in contiguous memory. I bet there is none in the standard library (including C++0x); does Boost provide one?
Upvotes: 2
Views: 419
Reputation: 44804
It looks like you want the misleadingly-named Boost Matrix.
The templated class matrix is the base container adaptor for dense matrices. For a (m x n)-dimensional matrix and 0 <= i < m, 0 <= j < n every element mi, j is mapped to the (i x n + j)-th element of the container for row major orientation or the (i + j x m)-th element of the container for column major orientation.
Upvotes: 3