Skip to content

Instantly share code, notes, and snippets.

@jdswinbank
Created February 12, 2015 05:37
Show Gist options
  • Save jdswinbank/26a7eadfad7354eaf9df to your computer and use it in GitHub Desktop.
Save jdswinbank/26a7eadfad7354eaf9df to your computer and use it in GitHub Desktop.
#include <iostream>
#include "ndarray.h"
using namespace std;
int main(void) {
int height = 3968;
int width = 9;
int nSwaths = 15; ndarray::Array<float, 3, 2> slitFuncsSwaths = ndarray::allocate(height, width, nSwaths);
cout << "slitFuncsSwaths.getShape() = " << slitFuncsSwaths.getShape() << endl;
cout << "slitFuncsSwaths.getShape()[0] = " << slitFuncsSwaths.getShape()[0]
<< ", slitFuncsSwaths.getShape()[1] = " << slitFuncsSwaths.getShape()[1]
<< ", slitFuncsSwaths.getShape()[2] = " << slitFuncsSwaths.getShape()[2] << endl;
cout << "slitFuncsSwaths[view(0)()(0) = " << slitFuncsSwaths[ndarray::view(0)()(0)] << endl;
cout << "slitFuncsSwaths[view(0)(0,9)(0) = "
<< slitFuncsSwaths[ndarray::view(0)(0,slitFuncsSwaths.getShape()[1])(0)] << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment