Rella
Rella

Reputation: 66945

C++, Boost: how to emulate matrix container memory structure?

So we have a matrix A N*M and a vector B (of ints or floats) we want to calculate A*B. We want to emulate ways matrices/vectors are held in memory (so to show how differ access speeds depending on how you nest cycles, for example that ijk is slower than kji when you keep data one way and vice versa another way). Is it possible, and how to do such thing?

Upvotes: 0

Views: 213

Answers (1)

Jeremiah Willcock
Jeremiah Willcock

Reputation: 30969

You can use Boost.MultiArray to set up multidimensional arrays (with convenient indexing) with different choices of storage layouts, such as row- and column-major.

Upvotes: 2

Related Questions