diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-07-29 18:26:55 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-07-29 18:26:55 -0600 |
commit | b307a8a5729e5e18fa8a7ff56892947fc2d2eb79 (patch) | |
tree | cf1bb60e0b31b8a1b01b93af112056473503341b /doc/swig/test/SuperTensor.h | |
parent | 32206dd79cafdce87cfb0db91903084c2fe2e473 (diff) | |
parent | f70632f74f7b0feb9d78aff62eb9eebbb6a502ba (diff) | |
download | numpy-b307a8a5729e5e18fa8a7ff56892947fc2d2eb79.tar.gz |
Merge branch 'numpy-swig' into gh-3451
* numpy-swig:
Added more mentions of the SuperTensor tests and corrected the number of typemaps and tests (currently 1427 unit tests passed with 'make test': 372+324+324+324+40+19+24)
Added mention of the SuperTensor tests in the README file
Removed 'static' keyword from pyfragments.swg altoghether. I've had the following errors In function ‘SWIG_AsVal_long’: error: initialiser element is not constant In function ‘SWIG_AsVal_unsigned_SS_long’: error: initialiser element is not constant, BOTH in Windows/MinGW and Linux when compiling with gcc
Added tests for 4D tensors. Now using a consistant cubes,slices,rows,columns index order everywhere.
cleaned-up loop indexes in Tensor.cxx
cosmetic changes to numpy.i
Fixed the capsule / cobject memory destructor. Added types to deal with lists of arrays and lists of tensors as input and inplace types.
removed the note about testResize1 failing in testArray.py
fixed the testResize1 test in testArray.py -- Changed order of the resize arguments in Array2.h and replaced len(XXXnumpyarray) with XXXnumpyarray.size
Minor adjustments to numpy.i
Updated numpy.i testing documentation
Updated the numpy.i documentation
Initialize all DATA_TYPE* data_temp variables to NULL
Added Egor's ARGOUTVIEWM_ARRAY3 typemaps
Re-instated a Python 3 fix
Removed doc from list of sub-directories
Upgrade numpy.i
Got rid of a unit test
Conflicts:
doc/sphinxext
doc/swig/test/testFortran.py
Diffstat (limited to 'doc/swig/test/SuperTensor.h')
-rw-r--r-- | doc/swig/test/SuperTensor.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/doc/swig/test/SuperTensor.h b/doc/swig/test/SuperTensor.h new file mode 100644 index 000000000..29cc3bbbb --- /dev/null +++ b/doc/swig/test/SuperTensor.h @@ -0,0 +1,53 @@ +#ifndef SUPERTENSOR_H +#define SUPERTENSOR_H + +// The following macro defines the prototypes for a family of +// functions that work with 4D arrays with the forms +// +// TYPE SNAMENorm( TYPE supertensor[2][2][2][2]); +// TYPE SNAMEMax( TYPE * supertensor, int cubes, int slices, int rows, int cols); +// TYPE SNAMEMin( int cubes, int slices, int rows, int cols, TYPE * supertensor); +// void SNAMEScale( TYPE array[3][3][3][3]); +// void SNAMEFloor( TYPE * array, int cubes, int slices, int rows, int cols, TYPE floor); +// void SNAMECeil( int cubes, int slices, int rows, int cols, TYPE * array, TYPE ceil ); +// void SNAMELUSplit(TYPE in[3][3][3][3], TYPE lower[3][3][3][3], TYPE upper[3][3][3][3]); +// +// for any specified type TYPE (for example: short, unsigned int, long +// long, etc.) with given short name SNAME (for example: short, uint, +// longLong, etc.). The macro is then expanded for the given +// TYPE/SNAME pairs. The resulting functions are for testing numpy +// interfaces, respectively, for: +// +// * 4D input arrays, hard-coded lengths +// * 4D input arrays +// * 4D input arrays, data last +// * 4D in-place arrays, hard-coded lengths +// * 4D in-place arrays +// * 4D in-place arrays, data last +// * 4D argout arrays, hard-coded length +// +#define TEST_FUNC_PROTOS(TYPE, SNAME) \ +\ +TYPE SNAME ## Norm( TYPE supertensor[2][2][2][2]); \ +TYPE SNAME ## Max( TYPE * supertensor, int cubes, int slices, int rows, int cols); \ +TYPE SNAME ## Min( int cubes, int slices, int rows, int cols, TYPE * supertensor); \ +void SNAME ## Scale( TYPE array[3][3][3][3], TYPE val); \ +void SNAME ## Floor( TYPE * array, int cubes, int slices, int rows, int cols, TYPE floor); \ +void SNAME ## Ceil( int cubes, int slices, int rows, int cols, TYPE * array, TYPE ceil ); \ +void SNAME ## LUSplit(TYPE supertensor[2][2][2][2], TYPE lower[2][2][2][2], TYPE upper[2][2][2][2]); + +TEST_FUNC_PROTOS(signed char , schar ) +TEST_FUNC_PROTOS(unsigned char , uchar ) +TEST_FUNC_PROTOS(short , short ) +TEST_FUNC_PROTOS(unsigned short , ushort ) +TEST_FUNC_PROTOS(int , int ) +TEST_FUNC_PROTOS(unsigned int , uint ) +TEST_FUNC_PROTOS(long , long ) +TEST_FUNC_PROTOS(unsigned long , ulong ) +TEST_FUNC_PROTOS(long long , longLong ) +TEST_FUNC_PROTOS(unsigned long long, ulongLong) +TEST_FUNC_PROTOS(float , float ) +TEST_FUNC_PROTOS(double , double ) + +#endif + |