diff options
author | wfspotz@sandia.gov <wfspotz@sandia.gov@localhost> | 2007-04-04 20:07:06 +0000 |
---|---|---|
committer | wfspotz@sandia.gov <wfspotz@sandia.gov@localhost> | 2007-04-04 20:07:06 +0000 |
commit | 13b70a28a42c8eab3eefd18bbfcc2636a094924b (patch) | |
tree | f5dd77b9d6458847209615a8bf34a3bc7941b6d3 /numpy/doc/swig | |
parent | 081af11038f18803c051c765b6967ea255cc3b67 (diff) | |
download | numpy-13b70a28a42c8eab3eefd18bbfcc2636a094924b.tar.gz |
Updated documentation in README file
Diffstat (limited to 'numpy/doc/swig')
-rw-r--r-- | numpy/doc/swig/README | 77 |
1 files changed, 42 insertions, 35 deletions
diff --git a/numpy/doc/swig/README b/numpy/doc/swig/README index e594ccabb..9fd5857b6 100644 --- a/numpy/doc/swig/README +++ b/numpy/doc/swig/README @@ -11,40 +11,46 @@ In the spirit of "writing your tests first", I will begin by describing the tests, as they are a good example of what we are trying to do with numpy.i. The files related to testing are:: - series.h - series.cxx - Series.i + Vector.h + Vector.cxx + Vector.i test1D.py + + Matrix.h + Matrix.cxx + Matrix.i test2D.py -The series.h header file contains prototypes for functions that -illustrate the wrapping issues we wish to address. Right now, this -consists of functions with argument signatures of the form:: +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:: (type IN_ARRAY1[ANY]) (type* IN_ARRAY1, int DIM1) (int DIM1, type* IN_ARRAY1) - (type IN_ARRAY2[ANY][ANY]) - (type* IN_ARRAY2, int DIM1, int DIM2) - (int DIM1, int DIM2, type* IN_ARRAY2) - (type INPLACE_ARRAY1[ANY]) (type* INPLACE_ARRAY1, int DIM1) (int DIM1, type* INPLACE_ARRAY1) - (type INPLACE_ARRAY2[ANY][ANY]) - (type* INPLACE_ARRAY2, int DIM1, int DIM2) - (int DIM1, int DIM2, type* INPLACE_ARRAY2) - (type ARGOUT_ARRAY1[ANY]) (type* ARGOUT_ARRAY1, int DIM1) (int DIM1, type* ARGOUT_ARRAY1) +Matrix.h:: + + (type IN_ARRAY2[ANY][ANY]) + (type* IN_ARRAY2, int DIM1, int DIM2) + (int DIM1, int DIM2, type* IN_ARRAY2) + + (type INPLACE_ARRAY2[ANY][ANY]) + (type* INPLACE_ARRAY2, int DIM1, int DIM2) + (int DIM1, int DIM2, type* INPLACE_ARRAY2) + (type ARGOUT_ARRAY2[ANY][ANY]) -which take a pointer to an array of type "type", whose length is -specified by the integer(s) DIM1 (and DIM2). +These function signatures take a pointer to an array of type "type", +whose length is specified by the integer(s) DIM1 (and DIM2). The objective for the IN_ARRAY signatures is for SWIG to generate python wrappers that take a container that constitutes a valid @@ -58,28 +64,29 @@ 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 file series.cxx contains the actual implementations of the -functions described in series.h. The python scripts test1D.py and -test2D.py test the resulting python wrappers using the unittest -module. +The source files Vector.cxx and Matrix.cxx contain the actual +implementations of the functions described in Vector.h and Matrix.h. +The python scripts test1D.py and test2D.py test the resulting python +wrappers using the unittest module. -The SWIG interface file Series.i is 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 -Series.i is required. The other things done in Series.i are the -inclusion of the series.h and numpy.i files, and the "%apply" -directives to force the functions to use the typemaps. +The SWIG interface files Vector.i and Matrix.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 and Matrix.i are required. The other things +done in Vector.i and Matrix.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 -a _Series extension module and a Series python module. 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 object. Targets "all" (default), "doc" -and "clean" are supported. The "doc" target creates HTML -documentation (with make target "html"), and PDF documentation (with -make targets "tex" and "pdf"). - -To build and test the code, simply execute from the shell:: +_Vector and _Matrix extension modules and Vector and Matrix 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"). + +To build and run the test code, simply execute from the shell:: $ make $ make test |