开发者

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 v开发者_开发百科ice versa another way). Is it possible, and how to do such thing?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜