4
// The following macro defines the prototypes for a family of
5
// functions that work with 3D arrays with the forms
7
// TYPE SNAMENorm( TYPE tensor[2][2][2]);
8
// TYPE SNAMEMax( TYPE * tensor, int rows, int cols, int num);
9
// TYPE SNAMEMin( int rows, int cols, int num, TYPE * tensor);
10
// void SNAMEScale( TYPE array[3][3][3]);
11
// void SNAMEFloor( TYPE * array, int rows, int cols, int num, TYPE floor);
12
// void SNAMECeil( int rows, int cols, int num, TYPE * array, TYPE ceil );
13
// void SNAMELUSplit(TYPE in[3][3][3], TYPE lower[3][3][3], TYPE upper[3][3][3]);
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:
21
// * 3D input arrays, hard-coded lengths
23
// * 3D input arrays, data last
24
// * 3D in-place arrays, hard-coded lengths
25
// * 3D in-place arrays
26
// * 3D in-place arrays, data last
27
// * 3D argout arrays, hard-coded length
29
#define TEST_FUNC_PROTOS(TYPE, SNAME) \
31
TYPE SNAME ## Norm( TYPE tensor[2][2][2]); \
32
TYPE SNAME ## Max( TYPE * tensor, int rows, int cols, int num); \
33
TYPE SNAME ## Min( int rows, int cols, int num, TYPE * tensor); \
34
void SNAME ## Scale( TYPE array[3][3][3], TYPE val); \
35
void SNAME ## Floor( TYPE * array, int rows, int cols, int num, TYPE floor); \
36
void SNAME ## Ceil( int rows, int cols, int num, TYPE * array, TYPE ceil ); \
37
void SNAME ## LUSplit(TYPE tensor[2][2][2], TYPE lower[2][2][2], TYPE upper[2][2][2]);
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 )