id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 3786,Incoherent views of various storage order,Mathieu Leocmach ,Ronald Garcia,"I have a 256x258 array with only the first 256 lines of interest. The flatten memory block contains then 256 interesting values, 2 craps, 256 interesting values, 2 craps, etc. I want to access each column of the interesting block, then each line. For this I use : 1. a view of the array with limited range in the second dimension 2. a view of line-major ordered array reference to the same block of memory, with limited range in the first dimension Here is a test code: {{{ #!cpp #include #include ""boost/multi_array.hpp"" using namespace boost; using namespace std; int main () { // Create a 2D array that is 256 x 258 typedef multi_array array_type; typedef multi_array_ref ref_type; typedef array_type::array_view<2>::type view_type; array paddedExt = {256,258}; array_type A(paddedExt); /*Initialize the whole memory block with -1 */ fill(A.origin(), A.origin()+A.num_elements(),-1.0); /*Fill the usefull part of the array by accessing data by column*/ view_type B = A[indices[range()][range(0,256)]]; for(view_type::iterator i=B.begin(); i!=B.end(); ++i) for(view_type::subarray<1>::type::iterator j=i->begin(); j!=i->end(); ++j) *j = 1.0; /*Access usefull data by line*/ paddedExt[0]=258; paddedExt[1]=256; ref_type C(A.origin(), paddedExt, fortran_storage_order); view_type D = C[indices[range(0,256)][range()]]; for(view_type::iterator i=D.begin(); i!=D.end(); ++i) for(view_type::subarray<1>::type::iterator j=i->begin(); j!=i->end(); ++j) output(*j); return EXIT_SUCCESS; } }}} This outputs a pretty high number of -1 ! More precisely, we have : * 256 values * 2 craps, 254 values * 2 values, 2 craps, 252 values * 4 values, 2 craps, 250 values * etc. * the last 2*256 good values are not output It's like the views have lost their index_bases somewhere on the way. I compiled and run this test under winXP, mingw32, gcc 3.4.5",Bugs,new,To Be Determined,multi_array,Boost 1.41.0,Problem,,,