![]() | Say our favorite C++ array class is MyArray
template< typename T > class MyArray { public: T* A; // the data int ndim; // no of dimensions (axis) int size[MAXDIM]; // size/length of each dimension int length; // total no of array entries ... }; |
![]() | We can work with this class from Python without needing to SWIG the class (!) |
![]() | We make a filter class converting a NumPy array (pointer) to/from a MyArray object (pointer) |