c++: boost::multi_array - initialize a multi_array

Hi all,
i am trying to initialize all the elements in boost::multi_array type to
zero, so far, with out success. At tried using std::fill for 1-dim
boost::multi_array and it worked. Once i tried std:fill on 2-dim
boost::multi_array it haven't worked any more.
I saw boost have
#include
(num_elements) ] ); vec::uint_2d_vec_t boo( boost::extents[ static_cast< vec::index_2d_t (num_elements) ][ static_cast< vec::index_2d_t >(kappa) ] );
std::fill( foo.begin() , foo.end() , 0); std::fill( boo.begin()->begin() , boo.end()->end() , 0); std::cout << "Done" << std::endl; return EXIT_SUCCESS; } any suggestion is welcome regards

i am trying to initialize all the elements in boost::multi_array type to zero, so far, with out success. At tried using std::fill for 1-dim boost::multi_array and it worked. Once i tried std:fill on 2-dim boost::multi_array it haven't worked any more.
One approach is the use multi_array::data() and
multi_array::num_elements() to get pointer-based iterators to the
underlying raw storage:
boost::multi_array
participants (2)
-
Hannan Sadar
-
Rhys Ulerich