1 | // Copyright 2002 The Trustees of Indiana University. |
---|---|
2 | |
3 | // Use, modification and distribution is subject to the Boost Software |
4 | // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
5 | // http://www.boost.org/LICENSE_1_0.txt) |
6 | |
7 | // Boost.MultiArray Library |
8 | // Authors: Ronald Garcia |
9 | // Jeremy Siek |
10 | // Andrew Lumsdaine |
11 | // See http://www.boost.org/libs/multi_array for documentation. |
12 | |
13 | // |
14 | // index_bases - test of the index_base modifying facilities. |
15 | // |
16 | |
17 | #include <boost/multi_array.hpp> |
18 | |
19 | #include <boost/core/lightweight_test.hpp> |
20 | |
21 | #include <boost/array.hpp> |
22 | #include <vector> |
23 | #include <iostream> |
24 | int |
25 | main() |
26 | { |
27 | typedef boost::multi_array<double, 3> array; |
28 | typedef array::array_view<3>::type array_view; |
29 | |
30 | typedef array::extent_range erange; |
31 | typedef array::index_range irange; |
32 | |
33 | array::extent_gen extents; |
34 | array::index_gen indices; |
35 | |
36 | // Construct with nonzero bases |
37 | { |
38 | |
39 | array A(extents[erange(1,4)][erange(2,5)][erange(3,6)]); |
40 | array_view E = A[indices[irange(1,2)][irange(1,2)][irange(1,2)]]; |
41 | |
42 | } |
43 | return boost::report_errors(); |
44 | } |
45 |