diff --git a/example/for_each.hpp b/example/for_each.hpp index f63104c..1853358 100644 --- a/example/for_each.hpp +++ b/example/for_each.hpp @@ -10,7 +10,7 @@ template void for_each (const boost::type& type_dispatch, - Array A, Functor& xform) { + Array A, Functor& xform) { for_each(type_dispatch,A.begin(),A.end(),xform); } @@ -21,8 +21,8 @@ void for_each (const boost::type&,Element& Val, Functor& xform) { template void for_each (const boost::type& type_dispatch, - Iterator begin, Iterator end, - Functor& xform) { + Iterator begin, Iterator end, + Functor& xform) { while (begin != end) { for_each(type_dispatch,*begin,xform); ++begin; diff --git a/example/foreach_test.cpp b/example/foreach_test.cpp index 13516b5..e3ef4ff 100644 --- a/example/foreach_test.cpp +++ b/example/foreach_test.cpp @@ -26,7 +26,7 @@ int main() { #if 0 std::copy(A.data(),A.data()+A.num_elements(), - std::ostream_iterator(std::cout,",")); + std::ostream_iterator(std::cout,",")); std::cout << "\n"; #endif @@ -34,7 +34,7 @@ int main() { #if 0 std::copy(A.data(),A.data()+A.num_elements(), - std::ostream_iterator(std::cout,",")); + std::ostream_iterator(std::cout,",")); std::cout << "\n"; #endif diff --git a/example/foreach_test2.cpp b/example/foreach_test2.cpp index 88d101e..c8d64a6 100644 --- a/example/foreach_test2.cpp +++ b/example/foreach_test2.cpp @@ -23,7 +23,7 @@ int main() { #if 0 std::copy(A.begin(),A.end(), - std::ostream_iterator(std::cout,",")); + std::ostream_iterator(std::cout,",")); std::cout << "\n"; #endif @@ -32,7 +32,7 @@ int main() { #if 0 std::copy(A.begin(),A.end(), - std::ostream_iterator(std::cout,",")); + std::ostream_iterator(std::cout,",")); std::cout << "\n"; #endif diff --git a/include/boost/multi_array.hpp b/include/boost/multi_array.hpp index 5e7381a..69a1896 100644 --- a/include/boost/multi_array.hpp +++ b/include/boost/multi_array.hpp @@ -87,7 +87,7 @@ public: template explicit multi_array(ExtentList const& extents, - const general_storage_order& so, + const general_storage_order& so, Allocator const& alloc) : super_type((T*)initial_base_,extents,so), allocator_(alloc) { boost::function_requires< diff --git a/test/access.cpp b/test/access.cpp index 48b9d91..30193ae 100644 --- a/test/access.cpp +++ b/test/access.cpp @@ -29,18 +29,18 @@ void access(Array& A, const const_array_tag&) { for (index i = idx0; i != idx0+2; ++i) for (index j = idx1; j != idx1+3; ++j) for (index k = idx2; k != idx2+4; ++k) { - BOOST_TEST(A[i][j][k] == cnum++); - BOOST_TEST(CA[i][j][k] == A[i][j][k]); + BOOST_TEST(A[i][j][k] == cnum++); + BOOST_TEST(CA[i][j][k] == A[i][j][k]); } // operator() for (index i2 = 0; i2 != 2; ++i2) for (index j2 = 0; j2 != 3; ++j2) for (index k2 = 0; k2 != 4; ++k2) { - boost::array indices; - indices[0] = i2; indices[1] = j2; indices[2] = k2; - BOOST_TEST(A(indices) == A[i2][j2][k2]); - BOOST_TEST(CA(indices) == A(indices)); + boost::array indices; + indices[0] = i2; indices[1] = j2; indices[2] = k2; + BOOST_TEST(A(indices) == A[i2][j2][k2]); + BOOST_TEST(CA(indices) == A(indices)); } ++tests_run; } diff --git a/test/compare.cpp b/test/compare.cpp index d444d66..c43c1ee 100644 --- a/test/compare.cpp +++ b/test/compare.cpp @@ -68,30 +68,30 @@ test_main(int, char*[]) double valsA[] = { 0, 0, 0, - 0, 0, 0, - 0, 0, 0, + 0, 0, 0, + 0, 0, 0, - 1, 1, 1, - 1, 1, 1, - 1, 1, 1, + 1, 1, 1, + 1, 1, 1, + 1, 1, 1, - 2, 2, 2, - 2, 2, 2, - 2, 2, 2 + 2, 2, 2, + 2, 2, 2, + 2, 2, 2 }; double valsB[] = { 0, 0, 0, - 0, 0, 0, - 0, 0, 0, + 0, 0, 0, + 0, 0, 0, - 1, 1, 1, - 1, 1, 1, - 1, 1, 1, + 1, 1, 1, + 1, 1, 1, + 1, 1, 1, - 2, 2, 2, - 2, 2, 2, - 2, 2, 1 + 2, 2, 2, + 2, 2, 2, + 2, 2, 1 }; A.assign(valsA,valsA+num_elements); diff --git a/test/constructors.cpp b/test/constructors.cpp index 5431f8d..900ed6b 100644 --- a/test/constructors.cpp +++ b/test/constructors.cpp @@ -12,9 +12,9 @@ template void check_shape(const Array& A, - unsigned int* sizes, - int* strides, - unsigned int num_elements) + unsigned int* sizes, + int* strides, + unsigned int num_elements) { BOOST_TEST(A.num_elements() == num_elements); BOOST_TEST(A.size() == *sizes); diff --git a/test/dimtest.cpp b/test/dimtest.cpp index 52ec4f2..3ea6a80 100644 --- a/test/dimtest.cpp +++ b/test/dimtest.cpp @@ -32,7 +32,7 @@ typedef std::size_t size_type; explicit index_range(Index start, Index finish, Index stride=1) : start_(start), finish_(finish), stride_(stride), - degenerate_(start_ == finish_) + degenerate_(start_ == finish_) { } @@ -59,7 +59,7 @@ typedef std::size_t size_type; Index get_start(Index low_index_range = 0) const { if (start_ == from_start()) - return low_index_range; + return low_index_range; return start_; } @@ -71,16 +71,16 @@ typedef std::size_t size_type; Index get_finish(Index high_index_range = 0) const { if (finish_ == to_end()) - return high_index_range; + return high_index_range; return finish_; } unsigned int size(Index recommended_length = 0) const { if ((start_ == from_start()) || (finish_ == to_end())) - return recommended_length; + return recommended_length; else - return (finish_ - start_) / stride_; + return (finish_ - start_) / stride_; } Index stride() const { return stride_; } @@ -236,7 +236,7 @@ public: template explicit index_gen(const index_gen& rhs, - const index_range& range) + const index_range& range) { std::copy(rhs.ranges_.begin(),rhs.ranges_.end(),ranges_.begin()); *ranges_.rbegin() = range; diff --git a/test/fail_cdata.cpp b/test/fail_cdata.cpp index c0bcd0d..ca627c4 100644 --- a/test/fail_cdata.cpp +++ b/test/fail_cdata.cpp @@ -18,7 +18,7 @@ test_main(int,char**) boost::array sma_dims = {{2,3,4}}; int data[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13, - 14,15,16,17,18,19,20,21,22,23}; + 14,15,16,17,18,19,20,21,22,23}; const int data_size = 24; array sma(sma_dims); sma.assign(data,data+data_size); diff --git a/test/fail_cparen.cpp b/test/fail_cparen.cpp index 46c5eab..b3922d5 100644 --- a/test/fail_cparen.cpp +++ b/test/fail_cparen.cpp @@ -18,7 +18,7 @@ test_main(int,char**) boost::array sma_dims = {{2,3,4}}; int data[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13, - 14,15,16,17,18,19,20,21,22,23}; + 14,15,16,17,18,19,20,21,22,23}; const int data_size = 24; array sma(sma_dims); sma.assign(data,data+data_size); diff --git a/test/fail_csubarray.cpp b/test/fail_csubarray.cpp index 80edc7f..58580fc 100644 --- a/test/fail_csubarray.cpp +++ b/test/fail_csubarray.cpp @@ -23,7 +23,7 @@ test_main(int,char**) for (array::index i = 0; i != 2; ++i) for (array::index j = 0; j != 3; ++j) for (array::index k = 0; k != 4; ++k) - sma[i][j][k] = num++; + sma[i][j][k] = num++; array::const_subarray::type csba = sma[0]; diff --git a/test/fail_csubarray2.cpp b/test/fail_csubarray2.cpp index fc56351..4de1d63 100644 --- a/test/fail_csubarray2.cpp +++ b/test/fail_csubarray2.cpp @@ -23,7 +23,7 @@ test_main(int,char**) for (array::index i = 0; i != 2; ++i) for (array::index j = 0; j != 3; ++j) for (array::index k = 0; k != 4; ++k) - sma[i][j][k] = num++; + sma[i][j][k] = num++; const array& sma_const = sma; diff --git a/test/fail_csubarray3.cpp b/test/fail_csubarray3.cpp index d686428..734ebe6 100644 --- a/test/fail_csubarray3.cpp +++ b/test/fail_csubarray3.cpp @@ -23,7 +23,7 @@ test_main(int,char**) for (array::index i = 0; i != 2; ++i) for (array::index j = 0; j != 3; ++j) for (array::index k = 0; k != 4; ++k) - sma[i][j][k] = num++; + sma[i][j][k] = num++; const array& sma_const = sma; @@ -31,8 +31,8 @@ test_main(int,char**) for (array::index j = 0; j != 3; ++j) for (array::index k = 0; k != 4; ++k) - // FAIL! sba cannot be assigned to. - sba[j][k] = num++; + // FAIL! sba cannot be assigned to. + sba[j][k] = num++; return boost::exit_success; } diff --git a/test/fail_cview.cpp b/test/fail_cview.cpp index 475a10b..1976001 100644 --- a/test/fail_cview.cpp +++ b/test/fail_cview.cpp @@ -20,7 +20,7 @@ test_main(int,char**) boost::array sma_dims = {{2,3,4}}; int data[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13, - 14,15,16,17,18,19,20,21,22,23}; + 14,15,16,17,18,19,20,21,22,23}; const int data_size = 24; array sma(sma_dims); diff --git a/test/fail_cview2.cpp b/test/fail_cview2.cpp index 4b346a9..27531cb 100644 --- a/test/fail_cview2.cpp +++ b/test/fail_cview2.cpp @@ -20,7 +20,7 @@ test_main(int,char**) boost::array sma_dims = {{2,3,4}}; int data[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13, - 14,15,16,17,18,19,20,21,22,23}; + 14,15,16,17,18,19,20,21,22,23}; const int data_size = 24; array sma(sma_dims); diff --git a/test/fail_cview3.cpp b/test/fail_cview3.cpp index 33e7760..bcc33bc 100644 --- a/test/fail_cview3.cpp +++ b/test/fail_cview3.cpp @@ -20,7 +20,7 @@ test_main(int,char**) boost::array sma_dims = {{2,3,4}}; int data[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13, - 14,15,16,17,18,19,20,21,22,23}; + 14,15,16,17,18,19,20,21,22,23}; const int data_size = 24; array sma(sma_dims); @@ -41,8 +41,8 @@ test_main(int,char**) for (array::index i = 0; i != 2; ++i) for (array::index j = 0; j != 2; ++j) for (array::index k = 0; k != 2; ++k) - // FAIL! csma2 cannot be assigned to. - csma2[i][j][k] = 0; + // FAIL! csma2 cannot be assigned to. + csma2[i][j][k] = 0; return boost::exit_success; } diff --git a/test/fail_ref_cdata.cpp b/test/fail_ref_cdata.cpp index 2665577..41c646d 100644 --- a/test/fail_ref_cdata.cpp +++ b/test/fail_ref_cdata.cpp @@ -18,7 +18,7 @@ test_main(int,char**) boost::array sma_dims = {{2,3,4}}; int data[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13, - 14,15,16,17,18,19,20,21,22,23}; + 14,15,16,17,18,19,20,21,22,23}; array_ref sma(data,sma_dims); const array_ref& csma = sma; diff --git a/test/fail_ref_cparen.cpp b/test/fail_ref_cparen.cpp index 044565d..2505acd 100644 --- a/test/fail_ref_cparen.cpp +++ b/test/fail_ref_cparen.cpp @@ -19,7 +19,7 @@ test_main(int,char**) boost::array sma_dims = {{2,3,4}}; int data[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13, - 14,15,16,17,18,19,20,21,22,23}; + 14,15,16,17,18,19,20,21,22,23}; array_ref sma(data,sma_dims); diff --git a/test/fail_ref_csubarray.cpp b/test/fail_ref_csubarray.cpp index f745a93..f3b8e18 100644 --- a/test/fail_ref_csubarray.cpp +++ b/test/fail_ref_csubarray.cpp @@ -27,7 +27,7 @@ test_main(int,char**) for (array_ref::index i = 0; i != 2; ++i) for (array_ref::index j = 0; j != 3; ++j) for (array_ref::index k = 0; k != 4; ++k) - sma[i][j][k] = num++; + sma[i][j][k] = num++; array_ref::const_subarray::type csba = sma[0]; diff --git a/test/fail_ref_csubarray2.cpp b/test/fail_ref_csubarray2.cpp index 6fd8967..46d5aeb 100644 --- a/test/fail_ref_csubarray2.cpp +++ b/test/fail_ref_csubarray2.cpp @@ -27,12 +27,12 @@ test_main(int,char**) for (array_ref::index i = 0; i != 2; ++i) for (array_ref::index j = 0; j != 3; ++j) for (array_ref::index k = 0; k != 4; ++k) - sma[i][j][k] = num++; + sma[i][j][k] = num++; const array_ref& sma_const = sma; array_ref::subarray::type sba = sma_const[0]; // FAIL! - // preserve constness + // preserve constness return boost::exit_success; } diff --git a/test/fail_ref_csubarray3.cpp b/test/fail_ref_csubarray3.cpp index ec4e212..3ae3a80 100644 --- a/test/fail_ref_csubarray3.cpp +++ b/test/fail_ref_csubarray3.cpp @@ -27,7 +27,7 @@ test_main(int,char**) for (array_ref::index i = 0; i != 2; ++i) for (array_ref::index j = 0; j != 3; ++j) for (array_ref::index k = 0; k != 4; ++k) - sma[i][j][k] = num++; + sma[i][j][k] = num++; const array_ref& sma_const = sma; @@ -35,7 +35,7 @@ test_main(int,char**) for (array_ref::index j = 0; j != 3; ++j) for (array_ref::index k = 0; k != 4; ++k) - sba[j][k] = num++; // FAIL! can't assign to const_subarray. + sba[j][k] = num++; // FAIL! can't assign to const_subarray. return boost::exit_success; } diff --git a/test/fail_ref_cview.cpp b/test/fail_ref_cview.cpp index 317aeaf..5475091 100644 --- a/test/fail_ref_cview.cpp +++ b/test/fail_ref_cview.cpp @@ -20,7 +20,7 @@ test_main(int,char**) boost::array sma_dims = {{2,3,4}}; int data[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13, - 14,15,16,17,18,19,20,21,22,23}; + 14,15,16,17,18,19,20,21,22,23}; array_ref sma(data,sma_dims); diff --git a/test/fail_ref_cview2.cpp b/test/fail_ref_cview2.cpp index e8e9525..9c20e0a 100644 --- a/test/fail_ref_cview2.cpp +++ b/test/fail_ref_cview2.cpp @@ -20,7 +20,7 @@ test_main(int,char**) boost::array sma_dims = {{2,3,4}}; int data[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13, - 14,15,16,17,18,19,20,21,22,23}; + 14,15,16,17,18,19,20,21,22,23}; array_ref sma(data,sma_dims); @@ -39,7 +39,7 @@ test_main(int,char**) for (array_ref::index i = 0; i != 2; ++i) for (array_ref::index j = 0; j != 2; ++j) for (array_ref::index k = 0; k != 2; ++k) - csma2[i][j][k] = 0; // FAIL! csma2 is read only + csma2[i][j][k] = 0; // FAIL! csma2 is read only return boost::exit_success; } diff --git a/test/fail_ref_cview3.cpp b/test/fail_ref_cview3.cpp index b958807..1b59b6d 100644 --- a/test/fail_ref_cview3.cpp +++ b/test/fail_ref_cview3.cpp @@ -20,7 +20,7 @@ test_main(int,char**) boost::array sma_dims = {{2,3,4}}; int data[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13, - 14,15,16,17,18,19,20,21,22,23}; + 14,15,16,17,18,19,20,21,22,23}; array_ref sma(data,sma_dims); @@ -40,7 +40,7 @@ test_main(int,char**) for (array_ref::index i = 0; i != 2; ++i) for (array_ref::index j = 0; j != 2; ++j) for (array_ref::index k = 0; k != 2; ++k) - csma2[i][j][k] = 0; // FAIL! csma2 is read only. + csma2[i][j][k] = 0; // FAIL! csma2 is read only. return boost::exit_success; } diff --git a/test/generative_tests.hpp b/test/generative_tests.hpp index cc2d6c0..30ca09e 100644 --- a/test/generative_tests.hpp +++ b/test/generative_tests.hpp @@ -72,7 +72,7 @@ void assign_if_not_const(Array& A, const mutable_array_tag&) { for (index i = idx0; i != idx0 + 2; ++i) for (index j = idx1; j != idx1 + 3; ++j) for (index k = idx2; k != idx2 + 4; ++k) - A[i][j][k] = num++; + A[i][j][k] = num++; } #endif // MULTIARRAY_TEST_ASSIGN @@ -89,8 +89,8 @@ void access(Array& A, const const_array_tag&); template int run_configuration(const StorageOrder3& so3, - const StorageOrder4& so4, - const Modifier& modifier) { + const StorageOrder4& so4, + const Modifier& modifier) { // multi_array { typedef boost::multi_array array; @@ -169,8 +169,8 @@ int run_configuration(const StorageOrder3& so3, typename array::template array_view<3>::type B =A[ indices[range(idx0+1,idx0+3)] - [range(idx1+1,idx1+4)] - [range(idx2+1,idx2+5)] + [range(idx1+1,idx1+4)] + [range(idx2+1,idx2+5)] ]; access(B,mutable_array_tag()); } @@ -192,8 +192,8 @@ int run_configuration(const StorageOrder3& so3, typename array::template array_view<3>::type B =A[ indices[range(idx0+1,idx0+3)] - [range(idx1+1,idx1+4)] - [range(idx2+1,idx2+5)] + [range(idx1+1,idx1+4)] + [range(idx2+1,idx2+5)] ]; assign(B); @@ -207,15 +207,15 @@ int run_configuration(const StorageOrder3& so3, template int run_storage_tests(const ArrayModifier& modifier) { run_configuration(boost::c_storage_order(), - boost::c_storage_order(),modifier); + boost::c_storage_order(),modifier); run_configuration(boost::fortran_storage_order(), - boost::fortran_storage_order(),modifier); + boost::fortran_storage_order(),modifier); std::size_t ordering[] = {2,0,1,3}; bool ascending[] = {false,true,true,true}; run_configuration(boost::general_storage_order<3>(ordering,ascending), - boost::general_storage_order<4>(ordering,ascending), - modifier); + boost::general_storage_order<4>(ordering,ascending), + modifier); return boost::exit_success; } diff --git a/test/idxgen1.cpp b/test/idxgen1.cpp index 08fb2b5..bbe0109 100644 --- a/test/idxgen1.cpp +++ b/test/idxgen1.cpp @@ -14,12 +14,12 @@ template void check(const boost::detail::multi_array:: - index_gen&) { } + index_gen&) { } bool operator==(const boost::detail::multi_array:: - index_range& lhs, - const boost::detail::multi_array:: - index_range& rhs) { + index_range& lhs, + const boost::detail::multi_array:: + index_range& rhs) { return lhs.start_ == rhs.start_ && lhs.finish_ == rhs.finish_ && lhs.stride_ == rhs.stride_ && diff --git a/test/index_bases.cpp b/test/index_bases.cpp index 02a4ede..a7f7d28 100644 --- a/test/index_bases.cpp +++ b/test/index_bases.cpp @@ -51,13 +51,13 @@ test_main(int,char**) boost::array bases = { { 1, 2, 3 } }; for (size_type a = 0; a < A.shape()[0]; ++a) for (size_type b = 0; b < A.shape()[1]; ++b) - for (size_type c = 0; c < A[b].size(); ++c) { - BOOST_TEST(A[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]); - BOOST_TEST(C[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]); - BOOST_TEST(D[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]); - // Test that E does not inherit A's index_base - BOOST_TEST(E[a][b][c] == B[a][b][c]); - } + for (size_type c = 0; c < A[b].size(); ++c) { + BOOST_TEST(A[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]); + BOOST_TEST(C[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]); + BOOST_TEST(D[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]); + // Test that E does not inherit A's index_base + BOOST_TEST(E[a][b][c] == B[a][b][c]); + } } // Reindex @@ -88,12 +88,12 @@ test_main(int,char**) for (size_type a = 0; a < A.shape()[0]; ++a) for (size_type b = 0; b < A.shape()[1]; ++b) - for (size_type c = 0; c < A.shape()[2]; ++c) { - BOOST_TEST(A[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]); - BOOST_TEST(C[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]); - BOOST_TEST(D[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]); - BOOST_TEST(E[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]); - } + for (size_type c = 0; c < A.shape()[2]; ++c) { + BOOST_TEST(A[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]); + BOOST_TEST(C[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]); + BOOST_TEST(D[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]); + BOOST_TEST(E[a+bases[0]][b+bases[1]][c+bases[2]] == B[a][b][c]); + } } // Set Index Base @@ -122,12 +122,12 @@ test_main(int,char**) for (size_type a = 0; a < A.shape()[0]; ++a) for (size_type b = 0; b < A.shape()[1]; ++b) - for (size_type c = 0; c < A.shape()[2]; ++c) { - BOOST_TEST(A[a+1][b+1][c+1] == B[a][b][c]); - BOOST_TEST(C[a+1][b+1][c+1] == B[a][b][c]); - BOOST_TEST(D[a+1][b+1][c+1] == B[a][b][c]); - BOOST_TEST(E[a+1][b+1][c+1] == B[a][b][c]); - } + for (size_type c = 0; c < A.shape()[2]; ++c) { + BOOST_TEST(A[a+1][b+1][c+1] == B[a][b][c]); + BOOST_TEST(C[a+1][b+1][c+1] == B[a][b][c]); + BOOST_TEST(D[a+1][b+1][c+1] == B[a][b][c]); + BOOST_TEST(E[a+1][b+1][c+1] == B[a][b][c]); + } } return boost::exit_success; diff --git a/test/iterators.cpp b/test/iterators.cpp index 0f05770..63d00cc 100644 --- a/test/iterators.cpp +++ b/test/iterators.cpp @@ -19,7 +19,7 @@ void assign_if_not_const(Array& A, const mutable_array_tag&) { for (iterator3 i = A.begin(); i != A.end(); ++i) for(iterator2 ii = (*i).begin(); ii != (*i).end(); ++ii) for(iterator1 iii = (*ii).begin(); iii != (*ii).end(); ++iii) - *iii = num++; + *iii = num++; } @@ -136,8 +136,8 @@ void test_iterators(Array& A, const IterTraits&) { int vals = 0; for (iterator3 i = A.begin(); i != A.end(); ++i) for(iterator2 ii = (*i).begin(); ii != (*i).end(); ++ii) - for(iterator1 iii = (*ii).begin(); iii != (*ii).end(); ++iii) - BOOST_TEST(*iii == vals++); + for(iterator1 iii = (*ii).begin(); iii != (*ii).end(); ++iii) + BOOST_TEST(*iii == vals++); } // Using operator->() on iterators @@ -149,8 +149,8 @@ void test_iterators(Array& A, const IterTraits&) { int vals = 0; for (iterator3 i = A.begin(); i != A.end(); ++i) for(iterator2 ii = i->begin(); ii != i->end(); ++ii) - for(iterator1 iii = ii->begin(); iii != ii->end(); ++iii) - BOOST_TEST(*iii == vals++); + for(iterator1 iii = ii->begin(); iii != ii->end(); ++iii) + BOOST_TEST(*iii == vals++); } // Reverse Iterator Hierarchy Test @@ -162,9 +162,9 @@ void test_iterators(Array& A, const IterTraits&) { int check_iter_val = A.num_elements()-1; for (riterator3 i = A.rbegin(); i != (riterator3)A.rend(); ++i) for(riterator2 ii = (*i).rbegin(); ii != (riterator2)(*i).rend(); ++ii) - for(riterator1 iii = (*ii).rbegin(); iii != (riterator1)(*ii).rend(); - ++iii) - BOOST_TEST(*iii == check_iter_val--); + for(riterator1 iii = (*ii).rbegin(); iii != (riterator1)(*ii).rend(); + ++iii) + BOOST_TEST(*iii == check_iter_val--); } ++tests_run; } diff --git a/test/reshape.cpp b/test/reshape.cpp index 51d59cf..ef5b4e9 100644 --- a/test/reshape.cpp +++ b/test/reshape.cpp @@ -22,7 +22,7 @@ test_main(int,char**) boost::array new_dims = {{4,3,2}}; int data[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13, - 14,15,16,17,18,19,20,21,22,23}; + 14,15,16,17,18,19,20,21,22,23}; const int data_size=24; // Basic reshape test @@ -40,11 +40,11 @@ test_main(int,char**) int* ptr = data; for (array::index i = 0; i != 4; ++i) for (array::index j = 0; j != 3; ++j) - for (array::index k = 0; k != 2; ++k) { - BOOST_TEST(A[i][j][k] == *ptr); - BOOST_TEST(B[i][j][k] == *ptr); - BOOST_TEST(C[i][j][k] == *ptr++); - } + for (array::index k = 0; k != 2; ++k) { + BOOST_TEST(A[i][j][k] == *ptr); + BOOST_TEST(B[i][j][k] == *ptr); + BOOST_TEST(C[i][j][k] == *ptr++); + } } // Ensure that index bases are preserved over reshape @@ -68,11 +68,11 @@ test_main(int,char**) int* ptr = data; for (array::index i = 0; i != 4; ++i) for (array::index j = 1; j != 4; ++j) - for (array::index k = -1; k != 1; ++k) { - BOOST_TEST(A[i][j][k] == *ptr); - BOOST_TEST(B[i][j][k] == *ptr); - BOOST_TEST(C[i][j][k] == *ptr++); - } + for (array::index k = -1; k != 1; ++k) { + BOOST_TEST(A[i][j][k] == *ptr); + BOOST_TEST(B[i][j][k] == *ptr); + BOOST_TEST(C[i][j][k] == *ptr++); + } } return boost::exit_success; diff --git a/test/slice.cpp b/test/slice.cpp index 010cc05..ce593ac 100644 --- a/test/slice.cpp +++ b/test/slice.cpp @@ -88,12 +88,12 @@ void test_views(Array& A, const ViewTraits&) { for (index i = 0; i != 2; ++i) for (index j = 0; j != 2; ++j) - for (index k = 0; k != 2; ++k) { - BOOST_TEST(B[i][j][k] == A[idx0+i][idx1+j+1][idx2+k*2]); - boost::array elmts; - elmts[0]=i; elmts[1]=j; elmts[2]=k; - BOOST_TEST(B(elmts) == A[idx0+i][idx1+j+1][idx2+k*2]); - } + for (index k = 0; k != 2; ++k) { + BOOST_TEST(B[i][j][k] == A[idx0+i][idx1+j+1][idx2+k*2]); + boost::array elmts; + elmts[0]=i; elmts[1]=j; elmts[2]=k; + BOOST_TEST(B(elmts) == A[idx0+i][idx1+j+1][idx2+k*2]); + } } // Degenerate dimensions { @@ -102,10 +102,10 @@ void test_views(Array& A, const ViewTraits&) { for (index i = 0; i != 2; ++i) for (index j = 0; j != 2; ++j) { - BOOST_TEST(B[i][j] == A[idx0+i][idx1+1][idx2+j*2]); - boost::array elmts; - elmts[0]=i; elmts[1]=j; - BOOST_TEST(B(elmts) == A[idx0+i][idx1+1][idx2+j*2]); + BOOST_TEST(B[i][j] == A[idx0+i][idx1+1][idx2+j*2]); + boost::array elmts; + elmts[0]=i; elmts[1]=j; + BOOST_TEST(B(elmts) == A[idx0+i][idx1+1][idx2+j*2]); } } ++tests_run; diff --git a/test/storage_order.cpp b/test/storage_order.cpp index 8a2eade..774a176 100644 --- a/test/storage_order.cpp +++ b/test/storage_order.cpp @@ -23,7 +23,7 @@ test_main(int,char**) 16,17,18,19, 20,21,22,23 }; - + int data_col[] = { 0,12, 4,16, @@ -56,7 +56,7 @@ test_main(int,char**) for (array::index i = 0; i != 2; ++i) for (array::index j = 0; j != 3; ++j) for (array::index k = 0; k != 4; ++k) - BOOST_TEST(A[i][j][k] == *num++); + BOOST_TEST(A[i][j][k] == *num++); } // Mimic fortran_storage_order using @@ -77,7 +77,7 @@ test_main(int,char**) for (array::index i = 0; i != 2; ++i) for (array::index j = 0; j != 3; ++j) for (array::index k = 0; k != 4; ++k) - BOOST_TEST(A[i][j][k] == *num++); + BOOST_TEST(A[i][j][k] == *num++); } // general_storage_order with arbitrary storage order @@ -107,8 +107,8 @@ test_main(int,char**) int* num = data_row; for (array::index i = 0; i != 2; ++i) for (array::index j = 0; j != 3; ++j) - for (array::index k = 0; k != 4; ++k) - BOOST_TEST(A[i][j][k] == *num++); + for (array::index k = 0; k != 4; ++k) + BOOST_TEST(A[i][j][k] == *num++); } @@ -140,8 +140,8 @@ test_main(int,char**) int* num = data_row; for (array::index i = 0; i != 2; ++i) for (array::index j = 0; j != 3; ++j) - for (array::index k = 0; k != 4; ++k) - BOOST_TEST(A[i][j][k] == *num++); + for (array::index k = 0; k != 4; ++k) + BOOST_TEST(A[i][j][k] == *num++); } return boost::exit_success; diff --git a/test/storage_order_convert.cpp b/test/storage_order_convert.cpp index 1b800fa..9c7df57 100644 --- a/test/storage_order_convert.cpp +++ b/test/storage_order_convert.cpp @@ -16,13 +16,13 @@ test_main(int,char**) { array fortran_ordering = {{0,1,2,3,4}}; array ascending = {{true,true,true,true,true}}; general_storage_order<5> c_storage(c_ordering.begin(), - ascending.begin()); + ascending.begin()); general_storage_order<5> fortran_storage(fortran_ordering.begin(), - ascending.begin()); + ascending.begin()); BOOST_TEST(c_storage == (general_storage_order<5>) c_storage_order()); BOOST_TEST(fortran_storage == - (general_storage_order<5>) fortran_storage_order()); + (general_storage_order<5>) fortran_storage_order()); return boost::exit_success; }