2013-04-10 16:57:12 -07:00
|
|
|
#include <iostream>
|
2018-06-22 20:57:24 +00:00
|
|
|
#include <boost/multi_array.hpp>
|
2013-04-10 16:57:12 -07:00
|
|
|
|
|
|
|
|
typedef boost::multi_array<double, 2> two_d_array_type;
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
// read values
|
|
|
|
|
int dim1, dim2;
|
|
|
|
|
std::cin >> dim1 >> dim2;
|
|
|
|
|
|
|
|
|
|
// create array
|
|
|
|
|
two_d_array_type A(boost::extents[dim1][dim2]);
|
|
|
|
|
|
2016-12-05 22:15:40 +01:00
|
|
|
// write element
|
2013-04-10 16:57:12 -07:00
|
|
|
A[0][0] = 3.1415;
|
|
|
|
|
|
2016-12-05 22:15:40 +01:00
|
|
|
// read element
|
2013-04-10 16:57:12 -07:00
|
|
|
std::cout << A[0][0] << std::endl;
|
2016-12-05 22:15:40 +01:00
|
|
|
|
|
|
|
|
return 0;
|
2013-04-10 16:57:12 -07:00
|
|
|
}
|