diff options
Diffstat (limited to 'doc/swig/README')
-rw-r--r-- | doc/swig/README | 60 |
1 files changed, 40 insertions, 20 deletions
diff --git a/doc/swig/README b/doc/swig/README index 4a10e436b..df5dbfc47 100644 --- a/doc/swig/README +++ b/doc/swig/README @@ -9,8 +9,8 @@ distribution. Documentation ------------- -Documentation for how to use numpy.i, as well as for the testing system -used here, can be found in the NumPy reference guide. +Documentation for how to use numpy.i, as well as for the testing +system used here, can be found in the NumPy reference guide. Testing ------- @@ -32,6 +32,11 @@ The files related to testing are are in the test subdirectory:: Tensor.i testTensor.py + SuperTensor.h + SuperTensor.cxx + SuperTensor.i + testSuperTensor.py + The header files contain prototypes for functions that illustrate the wrapping issues we wish to address. Right now, this consists of functions with argument signatures of the following forms. Vector.h:: @@ -72,8 +77,21 @@ Tensor.h:: (type ARGOUT_ARRAY3[ANY][ANY][ANY]) +SuperTensor.h:: + + (type IN_ARRAY4[ANY][ANY][ANY][ANY]) + (type* IN_ARRAY4, int DIM1, int DIM2, int DIM3, int DIM4) + (int DIM1, int DIM2, int DIM3, int DIM4, type* IN_ARRAY4) + + (type INPLACE_ARRAY4[ANY][ANY][ANY][ANY]) + (type* INPLACE_ARRAY4, int DIM1, int DIM2, int DIM3, int DIM4) + (int DIM1, int DIM2, int DIM3, int DIM4, type* INPLACE_ARRAY4) + + (type ARGOUT_ARRAY4[ANY][ANY][ANY][ANY]) + These function signatures take a pointer to an array of type "type", -whose length is specified by the integer(s) DIM1 (and DIM2, and DIM3). +whose length is specified by the integer(s) DIM1 (and DIM2, and DIM3, +and DIM4). The objective for the IN_ARRAY signatures is for SWIG to generate python wrappers that take a container that constitutes a valid @@ -87,25 +105,27 @@ The objective for the INPLACE_ARRAY signatures is for SWIG to generate python wrappers that accept a numpy array of any of the above-listed types. -The source files Vector.cxx, Matrix.cxx and Tensor.cxx contain the -actual implementations of the functions described in Vector.h, -Matrix.h and Tensor.h. The python scripts testVector.py, -testMatrix.py and testTensor.py test the resulting python wrappers -using the unittest module. - -The SWIG interface files Vector.i, Matrix.i and Tensor.i are used to -generate the wrapper code. The SWIG_FILE_WITH_INIT macro allows -numpy.i to be used with multiple python modules. If it is specified, -then the %init block found in Vector.i, Matrix.i and Tensor.i are -required. The other things done in Vector.i, Matrix.i and Tensor.i -are the inclusion of the appropriate header file and numpy.i file, and -the "%apply" directives to force the functions to use the typemaps. +The source files Vector.cxx, Matrix.cxx Tensor.cxx and SuperTensor.cxx +contain the actual implementations of the functions described in +Vector.h, Matrix.h Tensor.h and SuperTensor.h. The python scripts +testVector.py, testMatrix.py testTensor.py and testSuperTensor.py +test the resulting python wrappers using the unittest module. + +The SWIG interface files Vector.i, Matrix.i Tensor.i and SuperTensor.i +are used to generate the wrapper code. The SWIG_FILE_WITH_INIT macro +allows numpy.i to be used with multiple python modules. If it is +specified, then the %init block found in Vector.i, Matrix.i Tensor.i +and SuperTensor.i are required. The other things done in Vector.i, +Matrix.i Tensor.i and SuperTensor.i are the inclusion of the +appropriate header file and numpy.i file, and the "%apply" directives +to force the functions to use the typemaps. The setup.py script is a standard python distutils script. It defines -_Vector, _Matrix and _Tensor extension modules and Vector, Matrix and -Tensor python modules. The Makefile automates everything, setting up -the dependencies, calling swig to generate the wrappers, and calling -setup.py to compile the wrapper code and generate the shared objects. +_Vector, _Matrix _Tensor and _SuperTensor extension modules and Vector +, Matrix, Tensor and SuperTensor python modules. The Makefile +automates everything, setting up the dependencies, calling swig to +generate the wrappers, and calling setup.py to compile the wrapper +code and generate the shared objects. Targets "all" (default), "test", "doc" and "clean" are supported. The "doc" target creates HTML documentation (with make target "html"), and PDF documentation (with make targets "tex" and "pdf"). |