Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/multi_array/example/basic1.cpp @ 29

Last change on this file since 29 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 771 bytes
Line 
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#include <cassert>
14#include "boost/multi_array.hpp"
15#include "boost/cstdlib.hpp"
16
17int main () {
18  // Create a 3D array that is 3 x 4 x 2
19  typedef boost::multi_array<double, 3> array;
20  array A(boost::extents[3][4][2]);
21  // Assign a value to an element in the array
22  A[0][0][0] = 3.14;
23  assert(A[0][0][0] == 3.14);
24  return boost::exit_success;
25}
Note: See TracBrowser for help on using the repository browser.