boost-multi-array

Boost::multi_array performance question

I am trying to compare the performance of boost::multi_array to native dynamically allocated arrays, with the following test program: #include <windows.h> #define _SCL_SECURE_NO_WARNINGS #define BOOST_DISABLE_ASSERTS #include <boost/multi_array.hpp> int main(int argc, char* argv[]) { const int X_SIZE = 200; const int Y_SIZE = ...

How to assign / copy a Boost::multi_array

I want to assign a copy of a boost::multi_array. How can I do this. The object where I want to assign it to has been initialized with the default constructors. This code does not work, because the dimensions and size are not the same class Field { boost::multi_array<char, 2> m_f; void set_f(boost::multi_array<short, 2> &f) { m...

boost::multi_index index by function call with parameter(s)

Hi Everyone I'm trying to make a boost::multi_index container that uses member functions w/ parameters as keys. class Data { public: std::string get(const std::string & _attr) { return _internals_fetch_data(_attr); } /* assume some implementation for storing data in some structure(s) */ }; Suppose I have a rectangular list of ...

boost::multi_array resize exception?

I'm trying to figure out if the boost::multi_array constructor or resize method can throw a bad_alloc exception (or some other exception indicating the allocation or resize failed). I can't find this information in the documentation anywhere. Clarification (added from comment): This is a scientific algorithm that can fall back to a l...

Boost.MultiArray Beginner: How to get a 4D-Array with dynamic inner-array-sizes?

Hello, i want to store some kind of distance-matrix (2D), where each entry has some alternatives (different coordinates). So i want to access the distance for example x=1 with x_alt=3 and y=3 with y_alt=1, looking in a 4-dim multi-array with array[1][3][3][1]. The important thing to notice is the following: the 2 most inner arrays/vect...