diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2014-03-12 11:19:40 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2014-03-12 11:26:48 -0600 |
commit | a38888c18cd2a20de0eb0578b3fa8660cda79582 (patch) | |
tree | 4f0590684328a013544de84b1577f9322db4cbac /doc/swig/test/Array.i | |
parent | 4fd4850d6b8bb9a8837e19b7ef2b38d0cd67fdd1 (diff) | |
download | numpy-a38888c18cd2a20de0eb0578b3fa8660cda79582.tar.gz |
MAINT: Move doc/swig to tools/swig.
Also update MANIFEST.in and documentation to reflect the move. The
discussion of this change is at #2384.
Closes #2384. Closes #4374.
Diffstat (limited to 'doc/swig/test/Array.i')
-rw-r--r-- | doc/swig/test/Array.i | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/doc/swig/test/Array.i b/doc/swig/test/Array.i deleted file mode 100644 index 6a8605eb6..000000000 --- a/doc/swig/test/Array.i +++ /dev/null @@ -1,102 +0,0 @@ -// -*- c++ -*- - -%module Array - -%{ -#define SWIG_FILE_WITH_INIT -#include "Array1.h" -#include "Array2.h" -%} - -// Get the NumPy typemaps -%include "../numpy.i" - - // Get the STL typemaps -%include "stl.i" - -// Handle standard exceptions -%include "exception.i" -%exception -{ - try - { - $action - } - catch (const std::invalid_argument& e) - { - SWIG_exception(SWIG_ValueError, e.what()); - } - catch (const std::out_of_range& e) - { - SWIG_exception(SWIG_IndexError, e.what()); - } -} -%init %{ - import_array(); -%} - -// Global ignores -%ignore *::operator=; -%ignore *::operator[]; - -// Apply the 1D NumPy typemaps -%apply (int DIM1 , long* INPLACE_ARRAY1) - {(int length, long* data )}; -%apply (long** ARGOUTVIEW_ARRAY1, int* DIM1 ) - {(long** data , int* length)}; - -// Apply the 2D NumPy typemaps -%apply (int DIM1 , int DIM2 , long* INPLACE_ARRAY2) - {(int nrows, int ncols, long* data )}; -%apply (int* DIM1 , int* DIM2 , long** ARGOUTVIEW_ARRAY2) - {(int* nrows, int* ncols, long** data )}; - -// Array1 support -%include "Array1.h" -%extend Array1 -{ - void __setitem__(int i, long v) - { - self->operator[](i) = v; - } - - long __getitem__(int i) - { - return self->operator[](i); - } - - int __len__() - { - return self->length(); - } - - std::string __str__() - { - return self->asString(); - } -} - -// Array2 support -%include "Array2.h" -%extend Array2 -{ - void __setitem__(int i, Array1 & v) - { - self->operator[](i) = v; - } - - Array1 & __getitem__(int i) - { - return self->operator[](i); - } - - int __len__() - { - return self->nrows() * self->ncols(); - } - - std::string __str__() - { - return self->asString(); - } -} |