c++/arrayNd/array3d.cxx
void print(const boost::multi_array<double, 3>& array)
{
    for(int i=0; i<array.shape()[0]; i++) {
        for(int j=0; j<array.shape()[1]; j++) {
            for(int k=0; k<array.shape()[2]; k++) {
                std::cout << array[i][j][k] << " ";
            }
            std::cout << "\n";
        }
        std::cout << "\n";
    }
}
// safety: array dimensions and data tied into one, can't mix them up!
// also: type safety.
array dimensions and data tied into one, can't mix them up.
also: type safety.
array dimensions and data tied into one can ' t mix them up . also : type safety .
void print(const boost::multi_array<double, 3>& array)
{
    for(int i=0; i<array.shape()[0]; i++) {
        for(int j=0; j<array.shape()[1]; j++) {
            for(int k=0; k<array.shape()[2]; k++) {
                std::cout << array[i][j][k] << " ";
            }
            std::cout << "\n";
        }
        std::cout << "\n";
    }
}
void print ( const boost :: multi_array < double , 3 > & array ) { for ( int i = 0 ; i < array . shape ( ) [ 0 ] ; i ++ ) { for ( int j = 0 ; j < array . shape ( ) [ 1 ] ; j ++ ) { for ( int k = 0 ; k < array . shape ( ) [ 2 ] ; k ++ ) { std :: cout << array [ i ] [ j ] [ k ] << " " ; } std :: cout << " \n " ; } std :: cout << " \n " ; } }
safety: array dimensions and data tied into one, can't mix them up!
safety : array dimensions and data tied into one can ' t mix them up!