Changeset 1541
- Timestamp:
- Aug 13, 2004, 3:31:43 PM (22 years ago)
- Location:
- trunk/psLib
- Files:
-
- 2 edited
-
src/dataManip/psMatrixVectorArithmetic.c (modified) (4 diffs)
-
test/dataManip/tst_psMatrixVectorArithmetic02.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psMatrixVectorArithmetic.c
r1526 r1541 30 30 * @author Ross Harman, MHPCC 31 31 * 32 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $33 * @date $Date: 2004-08-1 3 01:25:23 $32 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 33 * @date $Date: 2004-08-14 01:31:43 $ 34 34 * 35 35 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 640 640 } else if(!strncmp(OP, "dsin", 4)) { \ 641 641 if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \ 642 UNARY_TYPE(DIM,OUT,IN,csin(*i1*D2R +FLT_EPSILON));\642 UNARY_TYPE(DIM,OUT,IN,csin(*i1*D2R)); \ 643 643 } else { \ 644 644 UNARY_TYPE(DIM,OUT,IN,sin(*i1*D2R)); \ … … 678 678 UNARY_TYPE(DIM,OUT,IN,R2D*casin(*i1)); \ 679 679 } else if(PS_IS_PSELEMTYPE_INT(IN->type)) { \ 680 UNARY_TYPE(DIM,OUT,IN,(R2D*asin(*i1) +FLT_EPSILON));\680 UNARY_TYPE(DIM,OUT,IN,(R2D*asin(*i1))); \ 681 681 } else { \ 682 682 UNARY_TYPE(DIM,OUT,IN,(R2D*asin(*i1))); \ … … 692 692 UNARY_TYPE(DIM,OUT,IN,R2D*cacos(*i1)); \ 693 693 } else if(PS_IS_PSELEMTYPE_INT(IN->type)) { \ 694 UNARY_TYPE(DIM,OUT,IN,(R2D*acos(*i1) +FLT_EPSILON));\694 UNARY_TYPE(DIM,OUT,IN,(R2D*acos(*i1))); \ 695 695 } else { \ 696 696 UNARY_TYPE(DIM,OUT,IN,R2D*acos(*i1)); \ -
trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic02.c
r1406 r1541 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08- 06 22:34:06$12 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-14 01:31:30 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 24 24 25 #define PRINT_SCALAR(SCALAR,TYPE) \ 26 if(PS_IS_PSELEMTYPE_COMPLEX(SCALAR->type.type)) { \ 27 printf("%.2f%f+.2i ", creal(SCALAR->data.TYPE), cimag(SCALAR->data.TYPE)); \ 28 } else if(PS_IS_PSELEMTYPE_INT(SCALAR->type.type)) { \ 29 printf("%d", (int)SCALAR->data.TYPE); \ 30 } else { \ 31 printf("%.2f", (double)SCALAR->data.TYPE); \ 32 } \ 33 printf("\n\n"); 34 35 36 #define PRINT_VECTOR(VECTOR,TYPE) \ 25 #define CHECK_VECTOR(VECTOR,TYPE,TRUTH) \ 37 26 for(int i=0; i<VECTOR->n; i++) { \ 38 if(PS_IS_PSELEMTYPE_COMPLEX(VECTOR->type.type)) { \ 39 printf("%.2f%+.2fi\n", creal(VECTOR->data.TYPE[i]), cimag(VECTOR->data.TYPE[i])); \ 40 } else if(PS_IS_PSELEMTYPE_INT(VECTOR->type.type)) { \ 41 printf("%d\n", (int)VECTOR->data.TYPE[i]); \ 42 } else { \ 43 printf("%.2f\n", (double)VECTOR->data.TYPE[i]); \ 44 } \ 27 if(cabs(VECTOR->data.TYPE[i])-cabs(TRUTH) > FLT_EPSILON){ \ 28 printf("ERROR:Truth and calculated values don't match for vector operation:\n"); \ 29 if(PS_IS_PSELEMTYPE_COMPLEX(VECTOR->type.type)) { \ 30 printf("Truth: %.2f%+.2fi\n", creal(VECTOR->data.TYPE[i]), cimag(VECTOR->data.TYPE[i])); \ 31 printf("Calculated: %.2f%+.2fi\n", creal(TRUTH), cimag(TRUTH)); \ 32 } else if(PS_IS_PSELEMTYPE_INT(VECTOR->type.type)) { \ 33 printf("Truth: %d\n", (int)(VECTOR->data.TYPE[i])); \ 34 printf("Calculated: %d\n", (int)(TRUTH)); \ 35 } else { \ 36 printf("Truth: %.2f\n", (double)(VECTOR->data.TYPE[i])); \ 37 printf("Calculated: %.2f\n", (double)(TRUTH)); \ 38 } \ 39 } \ 45 40 } \ 46 41 printf("\n"); 47 42 48 43 49 #define PRINT_MATRIX(IMAGE,TYPE)\44 #define CHECK_MATRIX(IMAGE,TYPE,TRUTH) \ 50 45 for(int i=IMAGE->numRows-1; i>-1; i--) { \ 51 46 for(int j=0; j<IMAGE->numCols; j++) { \ 52 if(PS_IS_PSELEMTYPE_COMPLEX(IMAGE->type.type)) { \ 53 printf("%.2f%+.2fi ", creal(IMAGE->data.TYPE[i][j]), cimag(IMAGE->data.TYPE[i][j])); \ 54 } else if(PS_IS_PSELEMTYPE_INT(IMAGE->type.type)) { \ 55 printf("%d ", (int)IMAGE->data.TYPE[i][j]); \ 56 } else { \ 57 printf("%.2f ", (double)IMAGE->data.TYPE[i][j]); \ 58 } \ 47 if(cabs(IMAGE->data.TYPE[i][j])-cabs(TRUTH) > FLT_EPSILON){ \ 48 printf("ERROR:Truth and calculated values don't match for matrix operation:\n"); \ 49 if(PS_IS_PSELEMTYPE_COMPLEX(IMAGE->type.type)) { \ 50 printf("Truth: %.2f%+.2fi\n", creal(IMAGE->data.TYPE[i][j]), cimag(IMAGE->data.TYPE[i][j])); \ 51 printf("Calculated: %.2f%+.2fi\n", creal(TRUTH), cimag(TRUTH)); \ 52 } else if(PS_IS_PSELEMTYPE_INT(IMAGE->type.type)) { \ 53 printf("Truth: %d\n", (int)(IMAGE->data.TYPE[i][j])); \ 54 printf("Calculated: %d\n", (int)(TRUTH)); \ 55 } else { \ 56 printf("Truth: %.2f\n", (double)(IMAGE->data.TYPE[i][j])); \ 57 printf("Calculated: %.2f\n", (double)(TRUTH)); \ 58 } \ 59 } \ 59 60 } \ 60 61 printf("\n"); \ … … 92 93 93 94 // Test matrix unary operations 94 #define test BinaryOpM(OP,TYPE,VALUE1,VALUE2,NROWS,NCOLS)\95 #define testUnaryOpM(OP,TYPE,VALUE1,VALUE2,NROWS,NCOLS,TRUTH) \ 95 96 { \ 96 97 printPositiveTestHeader(stdout, "psMatrixVectorArithmetic", "Test matrix psUnaryOp"); \ … … 98 99 CREATE_AND_SET_IMAGE(inImage,TYPE,VALUE1,NROWS,NCOLS); \ 99 100 CREATE_AND_SET_IMAGE(outImage,TYPE,VALUE2,NROWS,NCOLS); \ 100 printf("Input:\n"); \101 PRINT_MATRIX(inImage,TYPE); \102 PRINT_MATRIX(outImage,TYPE); \103 101 outImage = (psImage*)psUnaryOp(outImage, inImage, #OP); \ 104 printf("Output:\n"); \ 105 PRINT_MATRIX(outImage,TYPE); \ 102 CHECK_MATRIX(outImage,TYPE,TRUTH); \ 106 103 psFree(inImage); \ 107 104 psFree(outImage); \ … … 110 107 } 111 108 112 test BinaryOpM( abs, S32, -10, 0, 3, 2);113 test BinaryOpM( abs, F32, -10.0, 0.0, 3, 2);114 test BinaryOpM( abs, F64, -10.0, 0.0, 3, 2);115 test BinaryOpM( abs, C32, -10.0 - 10.0i, 0.0 + 0.0i, 3, 2);116 test BinaryOpM( exp, S32, 10, 0, 3, 2);117 test BinaryOpM( exp, F32, 10.0, 0.0, 3, 2);118 test BinaryOpM( exp, F64, 10.0, 0.0, 3, 2);119 test BinaryOpM( exp, C32, 10.0 + 10.0i, 0.0 + 0.0i, 3, 2);120 test BinaryOpM( ln, S32, 10, 0, 3, 2);121 test BinaryOpM( ln, F32, 10.0, 0.0, 3, 2);122 test BinaryOpM( ln, F64, 10.0, 0.0, 3, 2);123 test BinaryOpM( ln, C32, 10.0 + 10.0i, 0.0 + 0.0i, 3, 2);124 test BinaryOpM( ten, S32, 3, 0, 3, 2);125 test BinaryOpM( ten, F32, 3.0, 0.0, 3, 2);126 test BinaryOpM( ten, F64, 3.0, 0.0, 3, 2);127 test BinaryOpM( ten, C32, 3.0 + 3.0i, 0.0 + 0.0i, 3, 2);128 test BinaryOpM( log, S32, 1000, 0, 3, 2);129 test BinaryOpM( log, F32, 1000.0, 0.0, 3, 2);130 test BinaryOpM( log, F64, 1000.0, 0.0, 3, 2);131 test BinaryOpM( log, C32, 1000.0 + 1000.0i, 0.0 + 0.0i, 3, 2);132 test BinaryOpM( sin, S32, M_PI_2, 0, 3, 2);133 test BinaryOpM( sin, F32, M_PI_2, 0.0, 3, 2);134 test BinaryOpM( sin, F64, M_PI_2, 0.0, 3, 2);135 test BinaryOpM( sin, C32, M_PI_2 + 1.57079632679489661923i, 0.0 + 0.0i, 3, 2);136 test BinaryOpM( dsin, S32, 90, 0, 3, 2);137 test BinaryOpM( dsin, F32, 90.0, 0.0, 3, 2);138 test BinaryOpM( dsin, F64, 90.0, 0.0, 3, 2);139 test BinaryOpM( dsin, C32, 90.0 + 90.0i, 0.0 + 0.0i, 3, 2);140 test BinaryOpM( cos, S32, 0, 0, 3, 2);141 test BinaryOpM( cos, F32, 0.0, 0.0, 3, 2);142 test BinaryOpM( cos, F64, 0.0, 0.0, 3, 2);143 test BinaryOpM( cos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2);144 test BinaryOpM( dcos, S32, 0, 0, 3, 2);145 test BinaryOpM( dcos, F32, 0.0, 0.0, 3, 2);146 test BinaryOpM( dcos, F64, 0.0, 0.0, 3, 2);147 test BinaryOpM( dcos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2);148 test BinaryOpM( tan, S32, M_PI_4, 0, 3, 2);149 test BinaryOpM( tan, F32, M_PI_4, 0.0, 3, 2);150 test BinaryOpM( tan, F64, M_PI_4, 0.0, 3, 2);151 test BinaryOpM( tan, C32, M_PI_4 + 0.78539816339744830962i, 0.0 + 0.0i, 3, 2);152 test BinaryOpM( dtan, S32, 45, 0, 3, 2);153 test BinaryOpM( dtan, F32, 45.0, 0.0, 3, 2);154 test BinaryOpM( dtan, F64, 45.0, 0.0, 3, 2);155 test BinaryOpM( dtan, C32, 45.0 + 45.0i, 0.0 + 0.0i, 3, 2);156 test BinaryOpM( asin, S32, 1, 0, 3, 2);157 test BinaryOpM( asin, F32, 1.0, 0.0, 3, 2);158 test BinaryOpM( asin, F64, 1.0, 0.0, 3, 2);159 test BinaryOpM( asin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2);160 test BinaryOpM( dasin, S32, 1.0, 0, 3, 2);161 test BinaryOpM( dasin, F32, 1.0, 0.0, 3, 2);162 test BinaryOpM( dasin, F64, 1.0, 0.0, 3, 2);163 test BinaryOpM( dasin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2);164 test BinaryOpM( acos, S32, 0, 0, 3, 2);165 test BinaryOpM( acos, F32, 0.0, 0.0, 3,2 );166 test BinaryOpM( acos, F64, 0.0, 0.0, 3,2 );167 test BinaryOpM( acos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3,2 );168 test BinaryOpM( dacos, S32, 0, 0, 3, 2);169 test BinaryOpM( dacos, F32, 0.0, 0.0, 3, 2);170 test BinaryOpM( dacos, F64, 0.0, 0.0, 3, 2);171 test BinaryOpM( dacos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2);172 test BinaryOpM( atan, S32, 1, 0, 3, 2);173 test BinaryOpM( atan, F32, 1.0, 0.0, 3, 2);174 test BinaryOpM( atan, F64, 1.0, 0.0, 3, 2);175 test BinaryOpM( atan, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2);176 test BinaryOpM( datan, S32, 1, 0, 3, 2);177 test BinaryOpM( datan, F32, 1.0, 0.0, 3, 2);178 test BinaryOpM( datan, F64, 1.0, 0.0, 3, 2);179 test BinaryOpM( datan, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2);109 testUnaryOpM( abs, S32, -10, 0, 3, 2, 10 ); 110 testUnaryOpM( abs, F32, -10.0, 0.0, 3, 2, 10.0 ); 111 testUnaryOpM( abs, F64, -10.0, 0.0, 3, 2, 10.0 ); 112 testUnaryOpM( abs, C32, -10.0 - 10.0i, 0.0 + 0.0i, 3, 2,10+10i ); 113 testUnaryOpM( exp, S32, 10, 0, 3, 2, cexp(10)); 114 testUnaryOpM( exp, F32, 10.0, 0.0, 3, 2, cexp(10.0) ); 115 testUnaryOpM( exp, F64, 10.0, 0.0, 3, 2, cexp(10.0) ); 116 testUnaryOpM( exp, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2, cexp(1.0+1.0i) ); 117 testUnaryOpM( ln, S32, 10, 0, 3, 2, clog(10) ); 118 testUnaryOpM( ln, F32, 10.0, 0.0, 3, 2, clog(10.0) ); 119 testUnaryOpM( ln, F64, 10.0, 0.0, 3, 2, clog(10.0) ); 120 testUnaryOpM( ln, C32, 10.0 + 10.0i, 0.0 + 0.0i, 3, 2, clog(10.0+10.0i) ); 121 testUnaryOpM( ten, S32, 3, 0, 3, 2, 1000 ); 122 testUnaryOpM( ten, F32, 3.0, 0.0, 3, 2, 1000 ); 123 testUnaryOpM( ten, F64, 3.0, 0.0, 3, 2, 1000 ); 124 testUnaryOpM( ten, C32, 1.0 + 0.0i, 0.0 + 0.0i, 3, 2, 10.0 ); 125 testUnaryOpM( log, S32, 1000, 0, 3, 2, 3 ); 126 testUnaryOpM( log, F32, 1000.0, 0.0, 3, 2, 3 ); 127 testUnaryOpM( log, F64, 1000.0, 0.0, 3, 2, 3 ); 128 testUnaryOpM( log, C32, 1000.0 + 0.0i, 0.0 + 0.0i, 3, 2, 3 ); 129 testUnaryOpM( sin, S32, M_PI_2, 0, 3, 2, 1 ); 130 testUnaryOpM( sin, F32, M_PI_2, 0.0, 3, 2, 1.0 ); 131 testUnaryOpM( sin, F64, M_PI_2, 0.0, 3, 2, 1.0 ); 132 testUnaryOpM( sin, C32, M_PI_2 + 0.0i, 0.0 + 0.0i, 3, 2, 1.0 ); 133 testUnaryOpM( dsin, S32, 90, 0, 3, 2 , 1); 134 testUnaryOpM( dsin, F32, 90.0, 0.0, 3, 2, 1.0 ); 135 testUnaryOpM( dsin, F64, 90.0, 0.0, 3, 2, 1.0 ); 136 testUnaryOpM( dsin, C32, 90.0 + 00.0i, 0.0 + 0.0i, 3, 2, 1.0 ); 137 testUnaryOpM( cos, S32, 0, 0, 3, 2, 1 ); 138 testUnaryOpM( cos, F32, 0.0, 0.0, 3, 2, 1.0 ); 139 testUnaryOpM( cos, F64, 0.0, 0.0, 3, 2, 1.0 ); 140 testUnaryOpM( cos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2, 1.0 ); 141 testUnaryOpM( dcos, S32, 0, 0, 3, 2, 1 ); 142 testUnaryOpM( dcos, F32, 0.0, 0.0, 3, 2, 1.0 ); 143 testUnaryOpM( dcos, F64, 0.0, 0.0, 3, 2, 1.0 ); 144 testUnaryOpM( dcos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2, 1.0 ); 145 testUnaryOpM( tan, S32, M_PI_4, 0, 3, 2, 1); 146 testUnaryOpM( tan, F32, M_PI_4, 0.0, 3, 2, 1.0 ); 147 testUnaryOpM( tan, F64, M_PI_4, 0.0, 3, 2, 1.0 ); 148 testUnaryOpM( tan, C32, M_PI_4 + 0.0i, 0.0 + 0.0i, 3, 2, 1 ); 149 testUnaryOpM( dtan, S32, 45, 0, 3, 2, 1 ); 150 testUnaryOpM( dtan, F32, 45.0, 0.0, 3, 2, 1.0 ); 151 testUnaryOpM( dtan, F64, 45.0, 0.0, 3, 2, 1.0 ); 152 testUnaryOpM( dtan, C32, 45.0 + 45.0i, 0.0 + 0.0i, 3, 2, 1.0 ); 153 testUnaryOpM( asin, S32, 1, 0, 3, 2, M_PI_2); 154 testUnaryOpM( asin, F32, 1.0, 0.0, 3, 2, M_PI_2 ); 155 testUnaryOpM( asin, F64, 1.0, 0.0, 3, 2, M_PI_2); 156 testUnaryOpM( asin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2, M_PI_2); 157 testUnaryOpM( dasin, S32, 1.0, 0, 3, 2, 90 ); 158 testUnaryOpM( dasin, F32, 1.0, 0.0, 3, 2, 90.0 ); 159 testUnaryOpM( dasin, F64, 1.0, 0.0, 3, 2, 90.0 ); 160 testUnaryOpM( dasin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2, 90.0 ); 161 testUnaryOpM( acos, S32, 0, 0, 3, 2, M_PI_2); 162 testUnaryOpM( acos, F32, 0.0, 0.0, 3, 2, M_PI_2 ); 163 testUnaryOpM( acos, F64, 0.0, 0.0, 3, 2, M_PI_2 ); 164 testUnaryOpM( acos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2, M_PI_2 ); 165 testUnaryOpM( dacos, S32, 0, 0, 3, 2, 90 ); 166 testUnaryOpM( dacos, F32, 0.0, 0.0, 3, 2, 90.0 ); 167 testUnaryOpM( dacos, F64, 0.0, 0.0, 3, 2, 90.0 ); 168 testUnaryOpM( dacos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2, 90.0 ); 169 testUnaryOpM( atan, S32, 1, 0, 3, 2, M_PI_4); 170 testUnaryOpM( atan, F32, 1.0, 0.0, 3, 2, M_PI_4 ); 171 testUnaryOpM( atan, F64, 1.0, 0.0, 3, 2, M_PI_4); 172 testUnaryOpM( atan, C32, 1.0 + 0.0i, 0.0 + 0.0i, 3, 2, M_PI_4); 173 testUnaryOpM( datan, S32, 1, 0, 3, 2, 45 ); 174 testUnaryOpM( datan, F32, 1.0, 0.0, 3, 2, 45.0 ); 175 testUnaryOpM( datan, F64, 1.0, 0.0, 3, 2, 45.0 ); 176 testUnaryOpM( datan, C32, 1.0 + 0.0i, 0.0 + 0.0i, 3, 2, 45.0 ); 180 177 181 178 182 179 // Test vector unary operations 183 #define test BinaryOpV(OP,TYPE,VALUE1,VALUE2,SIZE)\180 #define testUnaryOpV(OP,TYPE,VALUE1,VALUE2,SIZE,TRUTH) \ 184 181 { \ 185 182 printPositiveTestHeader(stdout, "psMatrixVectorArithmetic", "Test vector psUnaryOp"); \ … … 187 184 CREATE_AND_SET_VECTOR(inVector,TYPE,VALUE1,SIZE); \ 188 185 CREATE_AND_SET_VECTOR(outVector,TYPE,VALUE2,SIZE); \ 189 printf("Input:\n"); \190 PRINT_VECTOR(inVector,TYPE); \191 PRINT_VECTOR(outVector,TYPE); \192 186 outVector = (psVector*)psUnaryOp(outVector, inVector, #OP); \ 193 printf("Output:\n"); \ 194 PRINT_VECTOR(outVector,TYPE); \ 187 CHECK_VECTOR(outVector,TYPE,TRUTH); \ 195 188 psFree(inVector); \ 196 189 psFree(outVector); \ … … 199 192 } 200 193 201 test BinaryOpV( abs, S32, -10, 0, 3);202 test BinaryOpV( abs, F32, -10.0, 0.0, 3);203 test BinaryOpV( abs, F64, -10.0, 0.0, 3);204 test BinaryOpV( abs, C32, -10.0 - 10.0i, 0.0 + 0.0i, 3);205 test BinaryOpV( exp, S32, 10, 0, 3);206 test BinaryOpV( exp, F32, 10.0, 0.0, 3);207 test BinaryOpV( exp, F64, 10.0, 0.0, 3);208 test BinaryOpV( exp, C32, 10.0 + 10.0i, 0.0 + 0.0i, 3);209 test BinaryOpV( ln, S32, 10, 0, 3);210 test BinaryOpV( ln, F32, 10.0, 0.0, 3);211 test BinaryOpV( ln, F64, 10.0, 0.0, 3);212 test BinaryOpV( ln, C32, 10.0 + 10.0i, 0.0 + 0.0i, 3);213 test BinaryOpV( ten, S32, 3, 0, 3);214 test BinaryOpV( ten, F32, 3.0, 0.0, 3);215 test BinaryOpV( ten, F64, 3.0, 0.0, 3);216 test BinaryOpV( ten, C32, 3.0 + 3.0i, 0.0 + 0.0i, 3);217 test BinaryOpV( log, S32, 1000, 0,3 );218 test BinaryOpV( log, F32, 1000.0, 0.0, 3 );219 test BinaryOpV( log, F64, 1000.0, 0.0, 3 );220 test BinaryOpV( log, C32, 1000.0 + 1000.0i, 0.0 + 0.0i, 3 );221 test BinaryOpV( sin, S32, M_PI_2, 0, 3);222 test BinaryOpV( sin, F32, M_PI_2, 0.0, 3);223 test BinaryOpV( sin, F64, M_PI_2, 0.0, 3);224 test BinaryOpV( sin, C32, M_PI_2 + 1.57079632679489661923i, 0.0 + 0.0i, 3);225 test BinaryOpV( dsin, S32, 90, 0, 3);226 test BinaryOpV( dsin, F32, 90.0, 0.0, 3);227 test BinaryOpV( dsin, F64, 90.0, 0.0, 3);228 test BinaryOpV( dsin, C32, 90.0 + 90.0i, 0.0 + 0.0i, 3);229 test BinaryOpV( cos, S32, 0, 0, 3);230 test BinaryOpV( cos, F32, 0.0, 0.0, 3);231 test BinaryOpV( cos, F64, 0.0, 0.0, 3);232 test BinaryOpV( cos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3);233 test BinaryOpV( dcos, S32, 0, 0, 3);234 test BinaryOpV( dcos, F32, 0.0, 0.0, 3);235 test BinaryOpV( dcos, F64, 0.0, 0.0, 3);236 test BinaryOpV( dcos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3);237 test BinaryOpV( tan, S32, M_PI_4, 0, 3);238 test BinaryOpV( tan, F32, M_PI_4, 0.0, 3);239 test BinaryOpV( tan, F64, M_PI_4, 0.0, 3);240 test BinaryOpV( tan, C32, M_PI_4 + 0.78539816339744830962i, 0.0 + 0.0i, 3);241 test BinaryOpV( dtan, S32, 45, 0, 3);242 test BinaryOpV( dtan, F32, 45.0, 0.0, 3);243 test BinaryOpV( dtan, F64, 45.0, 0.0, 3);244 test BinaryOpV( dtan, C32, 45.0 + 45.0i, 0.0 + 0.0i, 3);245 test BinaryOpV( asin, S32, 1, 0, 3);246 test BinaryOpV( asin, F32, 1.0, 0.0, 3);247 test BinaryOpV( asin, F64, 1.0, 0.0, 3);248 test BinaryOpV( asin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3);249 test BinaryOpV( dasin, S32, 1.0, 0, 3);250 test BinaryOpV( dasin, F32, 1.0, 0.0, 3);251 test BinaryOpV( dasin, F64, 1.0, 0.0, 3);252 test BinaryOpV( dasin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3);253 test BinaryOpV( acos, S32, 0, 0, 3);254 test BinaryOpV( acos, F32, 0.0, 0.0, 3);255 test BinaryOpV( acos, F64, 0.0, 0.0, 3);256 test BinaryOpV( acos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3);257 test BinaryOpV( dacos, S32, 0, 0, 3);258 test BinaryOpV( dacos, F32, 0.0, 0.0, 3);259 test BinaryOpV( dacos, F64, 0.0, 0.0, 3);260 test BinaryOpV( dacos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3);261 test BinaryOpV( atan, S32, 1, 0, 3);262 test BinaryOpV( atan, F32, 1.0, 0.0, 3);263 test BinaryOpV( atan, F64, 1.0, 0.0, 3);264 test BinaryOpV( atan, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3);265 test BinaryOpV( datan, S32, 1, 0, 3);266 test BinaryOpV( datan, F32, 1.0, 0.0, 3);267 test BinaryOpV( datan, F64, 1.0, 0.0, 3);268 test BinaryOpV( datan, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3);194 testUnaryOpV( abs, S32, -10, 0, 3, 10 ); 195 testUnaryOpV( abs, F32, -10.0, 0.0, 3, 10.0 ); 196 testUnaryOpV( abs, F64, -10.0, 0.0, 3, 10.0 ); 197 testUnaryOpV( abs, C32, -10.0 - 10.0i, 0.0 + 0.0i, 3, 10+10i ); 198 testUnaryOpV( exp, S32, 10, 0, 3, cexp(10)); 199 testUnaryOpV( exp, F32, 10.0, 0.0, 3, cexp(10.0) ); 200 testUnaryOpV( exp, F64, 10.0, 0.0, 3, cexp(10.0) ); 201 testUnaryOpV( exp, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, cexp(1.0+1.0i) ); 202 testUnaryOpV( ln, S32, 10, 0, 3, clog(10) ); 203 testUnaryOpV( ln, F32, 10.0, 0.0, 3, clog(10.0) ); 204 testUnaryOpV( ln, F64, 10.0, 0.0, 3, clog(10.0) ); 205 testUnaryOpV( ln, C32, 10.0 + 10.0i, 0.0 + 0.0i, 3, clog(10.0+10.0i) ); 206 testUnaryOpV( ten, S32, 3, 0, 3, 1000 ); 207 testUnaryOpV( ten, F32, 3.0, 0.0, 3, 1000 ); 208 testUnaryOpV( ten, F64, 3.0, 0.0, 3, 1000 ); 209 testUnaryOpV( ten, C32, 1.0 + 0.0i, 0.0 + 0.0i, 3, 10.0 ); 210 testUnaryOpV( log, S32, 1000, 0, 3, 3 ); 211 testUnaryOpV( log, F32, 1000.0, 0.0, 3, 3 ); 212 testUnaryOpV( log, F64, 1000.0, 0.0, 3, 3 ); 213 testUnaryOpV( log, C32, 1000.0 + 0.0i, 0.0 + 0.0i, 3, 3 ); 214 testUnaryOpV( sin, S32, M_PI_2, 0, 3, 1 ); 215 testUnaryOpV( sin, F32, M_PI_2, 0.0, 3, 1.0 ); 216 testUnaryOpV( sin, F64, M_PI_2, 0.0, 3, 1.0 ); 217 testUnaryOpV( sin, C32, M_PI_2 + 0.0i, 0.0 + 0.0i, 3, 1.0 ); 218 testUnaryOpV( dsin, S32, 90, 0, 3, 1); 219 testUnaryOpV( dsin, F32, 90.0, 0.0, 3, 1.0 ); 220 testUnaryOpV( dsin, F64, 90.0, 0.0, 3, 1.0 ); 221 testUnaryOpV( dsin, C32, 90.0 + 00.0i, 0.0 + 0.0i, 3, 1.0 ); 222 testUnaryOpV( cos, S32, 0, 0, 3, 1 ); 223 testUnaryOpV( cos, F32, 0.0, 0.0, 3, 1.0 ); 224 testUnaryOpV( cos, F64, 0.0, 0.0, 3, 1.0 ); 225 testUnaryOpV( cos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 1.0 ); 226 testUnaryOpV( dcos, S32, 0, 0, 3, 1 ); 227 testUnaryOpV( dcos, F32, 0.0, 0.0, 3, 1.0 ); 228 testUnaryOpV( dcos, F64, 0.0, 0.0, 3, 1.0 ); 229 testUnaryOpV( dcos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 1.0 ); 230 testUnaryOpV( tan, S32, M_PI_4, 0, 3, 1); 231 testUnaryOpV( tan, F32, M_PI_4, 0.0, 3, 1.0 ); 232 testUnaryOpV( tan, F64, M_PI_4, 0.0, 3, 1.0 ); 233 testUnaryOpV( tan, C32, M_PI_4 + 0.0i, 0.0 + 0.0i, 3, 1 ); 234 testUnaryOpV( dtan, S32, 45, 0, 3, 1 ); 235 testUnaryOpV( dtan, F32, 45.0, 0.0, 3, 1.0 ); 236 testUnaryOpV( dtan, F64, 45.0, 0.0, 3, 1.0 ); 237 testUnaryOpV( dtan, C32, 45.0 + 45.0i, 0.0 + 0.0i, 3, 1.0 ); 238 testUnaryOpV( asin, S32, 1, 0, 3, M_PI_2); 239 testUnaryOpV( asin, F32, 1.0, 0.0, 3, M_PI_2 ); 240 testUnaryOpV( asin, F64, 1.0, 0.0, 3, M_PI_2); 241 testUnaryOpV( asin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, M_PI_2); 242 testUnaryOpV( dasin, S32, 1.0, 0, 3, 90 ); 243 testUnaryOpV( dasin, F32, 1.0, 0.0, 3, 90.0 ); 244 testUnaryOpV( dasin, F64, 1.0, 0.0, 3, 90.0 ); 245 testUnaryOpV( dasin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 90.0 ); 246 testUnaryOpV( acos, S32, 0, 0, 3, M_PI_2); 247 testUnaryOpV( acos, F32, 0.0, 0.0, 3, M_PI_2 ); 248 testUnaryOpV( acos, F64, 0.0, 0.0, 3, M_PI_2 ); 249 testUnaryOpV( acos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, M_PI_2 ); 250 testUnaryOpV( dacos, S32, 0, 0, 3, 90 ); 251 testUnaryOpV( dacos, F32, 0.0, 0.0, 3, 90.0 ); 252 testUnaryOpV( dacos, F64, 0.0, 0.0, 3, 90.0 ); 253 testUnaryOpV( dacos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 90.0 ); 254 testUnaryOpV( atan, S32, 1, 0, 3, M_PI_4); 255 testUnaryOpV( atan, F32, 1.0, 0.0, 3, M_PI_4 ); 256 testUnaryOpV( atan, F64, 1.0, 0.0, 3, M_PI_4); 257 testUnaryOpV( atan, C32, 1.0 + 0.0i, 0.0 + 0.0i, 3, M_PI_4); 258 testUnaryOpV( datan, S32, 1, 0, 3, 45 ); 259 testUnaryOpV( datan, F32, 1.0, 0.0, 3, 45.0 ); 260 testUnaryOpV( datan, F64, 1.0, 0.0, 3, 45.0 ); 261 testUnaryOpV( datan, C32, 1.0 + 0.0i, 0.0 + 0.0i, 3, 45.0 ); 269 262 270 263 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.
