multi_array dinamically built
10 Jan
2003
10 Jan
'03
6:13 p.m.
Hi, I would like to dinamically create a multi_array. Something like typedef boost::multi_array<bool, 2> BoolMatrix; typedef boost::multi_array<bool, 2>::index indexBoolMatrix; boost::array<BoolMatrix::index, 2> shape = {{ 5, 8 }}; BoolMatrix *A; // NO MEMORY ALLOCATED ... A = new BoolMatrix(shape); // MEMORY ALLOCATED A.assign(data,data+40); // ELEMENTS INITIALIZED The compiler (gcc 2.95.4) says that this kind of things are wrong. Or didn't I understand how the memory allocation in multi_array works? Cheers, Ramón.
7924
Age (days ago)
7924
Last active (days ago)
0 comments
1 participants
participants (1)
-
Ramón Casero Cañas