Debian Codegraph @

tools/swig/test/SuperTensor.h

raw
1 #ifndef SUPERTENSOR_H
2 #define SUPERTENSOR_H
3
4 // The following macro defines the prototypes for a family of
5 // functions that work with 4D arrays with the forms
6 //
7 // TYPE SNAMENorm( TYPE supertensor[2][2][2][2]);
8 // TYPE SNAMEMax( TYPE * supertensor, int cubes, int slices, int rows, int cols);
9 // TYPE SNAMEMin( int cubes, int slices, int rows, int cols, TYPE * supertensor);
10 // void SNAMEScale( TYPE array[3][3][3][3]);
11 // void SNAMEFloor( TYPE * array, int cubes, int slices, int rows, int cols, TYPE floor);
12 // void SNAMECeil( int cubes, int slices, int rows, int cols, TYPE * array, TYPE ceil );
13 // void SNAMELUSplit(TYPE in[3][3][3][3], TYPE lower[3][3][3][3], TYPE upper[3][3][3][3]);
14 //
15 // for any specified type TYPE (for example: short, unsigned int, long
16 // long, etc.) with given short name SNAME (for example: short, uint,
17 // longLong, etc.). The macro is then expanded for the given
18 // TYPE/SNAME pairs. The resulting functions are for testing numpy
19 // interfaces, respectively, for:
20 //
21 // * 4D input arrays, hard-coded lengths
22 // * 4D input arrays
23 // * 4D input arrays, data last
24 // * 4D in-place arrays, hard-coded lengths
25 // * 4D in-place arrays
26 // * 4D in-place arrays, data last
27 // * 4D argout arrays, hard-coded length
28 //
29 #define TEST_FUNC_PROTOS(TYPE, SNAME) \
30 \
31 TYPE SNAME ## Norm( TYPE supertensor[2][2][2][2]); \
32 TYPE SNAME ## Max( TYPE * supertensor, int cubes, int slices, int rows, int cols); \
33 TYPE SNAME ## Min( int cubes, int slices, int rows, int cols, TYPE * supertensor); \
34 void SNAME ## Scale( TYPE array[3][3][3][3], TYPE val); \
35 void SNAME ## Floor( TYPE * array, int cubes, int slices, int rows, int cols, TYPE floor); \
36 void SNAME ## Ceil( int cubes, int slices, int rows, int cols, TYPE * array, TYPE ceil ); \
37 void SNAME ## LUSplit(TYPE supertensor[2][2][2][2], TYPE lower[2][2][2][2], TYPE upper[2][2][2][2]);
38
39 TEST_FUNC_PROTOS(signed char , schar )
40 TEST_FUNC_PROTOS(unsigned char , uchar )
41 TEST_FUNC_PROTOS(short , short )
42 TEST_FUNC_PROTOS(unsigned short , ushort )
43 TEST_FUNC_PROTOS(int , int )
44 TEST_FUNC_PROTOS(unsigned int , uint )
45 TEST_FUNC_PROTOS(long , long )
46 TEST_FUNC_PROTOS(unsigned long , ulong )
47 TEST_FUNC_PROTOS(long long , longLong )
48 TEST_FUNC_PROTOS(unsigned long long, ulongLong)
49 TEST_FUNC_PROTOS(float , float )
50 TEST_FUNC_PROTOS(double , double )
51
52 #endif
53