Created
December 5, 2011 07:27
-
-
Save shelling/1432704 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <boost/multi_array.hpp> | |
| using namespace std; | |
| typedef boost::multi_array<double, 2> array2d; | |
| typedef array2d::index index2d; | |
| int main(int argc, char **argv) { | |
| array2d hello(boost::extents[20][25]); | |
| for (index2d i = 0; i < hello.shape()[0]; i++) { | |
| for (index2d j = 0; j < hello.shape()[1]; j++) { | |
| cout << hello[i][j] << " "; | |
| } | |
| cout << endl; | |
| } | |
| for (int i = 0; i < hello.num_dimensions(); i++) { | |
| cout << "shape-" << i << " " << hello.shape()[i] << endl; | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment