IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1541


Ignore:
Timestamp:
Aug 13, 2004, 3:31:43 PM (22 years ago)
Author:
harman
Message:

Added FLT_EPSILON to select functions to align results with that of 64 bit platform with more detail

Location:
trunk/psLib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psMatrixVectorArithmetic.c

    r1526 r1541  
    3030 *  @author Ross Harman, MHPCC
    3131 *
    32  *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
    33  *  @date $Date: 2004-08-13 01:25:23 $
     32 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
     33 *  @date $Date: 2004-08-14 01:31:43 $
    3434 *
    3535 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    640640} else if(!strncmp(OP, "dsin", 4)) {                                                                         \
    641641    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));                                                                \
    643643    } else {                                                                                                 \
    644644        UNARY_TYPE(DIM,OUT,IN,sin(*i1*D2R));                                                                 \
     
    678678        UNARY_TYPE(DIM,OUT,IN,R2D*casin(*i1));                                                               \
    679679    } 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)));                                                              \
    681681    } else {                                                                                                 \
    682682        UNARY_TYPE(DIM,OUT,IN,(R2D*asin(*i1)));                                                              \
     
    692692        UNARY_TYPE(DIM,OUT,IN,R2D*cacos(*i1));                                                               \
    693693    } 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)));                                                              \
    695695    } else {                                                                                                 \
    696696        UNARY_TYPE(DIM,OUT,IN,R2D*acos(*i1));                                                                \
  • trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic02.c

    r1406 r1541  
    1010 *  @author  Ross Harman, MHPCC
    1111 *
    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 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2323
    2424
    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)                                                                      \
    3726for(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    }                                                                                                       \
    4540}                                                                                                            \
    4641printf("\n");
    4742
    4843
    49 #define PRINT_MATRIX(IMAGE,TYPE)                                                                             \
     44#define CHECK_MATRIX(IMAGE,TYPE,TRUTH)                                                                       \
    5045for(int i=IMAGE->numRows-1; i>-1; i--) {                                                                     \
    5146    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        }                                                                                                   \
    5960    }                                                                                                        \
    6061    printf("\n");                                                                                            \
     
    9293
    9394    // Test matrix unary operations
    94     #define testBinaryOpM(OP,TYPE,VALUE1,VALUE2,NROWS,NCOLS)                                                 \
     95    #define testUnaryOpM(OP,TYPE,VALUE1,VALUE2,NROWS,NCOLS,TRUTH)                                            \
    9596    {                                                                                                        \
    9697        printPositiveTestHeader(stdout, "psMatrixVectorArithmetic", "Test matrix psUnaryOp");                \
     
    9899        CREATE_AND_SET_IMAGE(inImage,TYPE,VALUE1,NROWS,NCOLS);                                               \
    99100        CREATE_AND_SET_IMAGE(outImage,TYPE,VALUE2,NROWS,NCOLS);                                              \
    100         printf("Input:\n");                                                                                  \
    101         PRINT_MATRIX(inImage,TYPE);                                                                          \
    102         PRINT_MATRIX(outImage,TYPE);                                                                         \
    103101        outImage = (psImage*)psUnaryOp(outImage, inImage, #OP);                                              \
    104         printf("Output:\n");                                                                                 \
    105         PRINT_MATRIX(outImage,TYPE);                                                                         \
     102        CHECK_MATRIX(outImage,TYPE,TRUTH);                                                                   \
    106103        psFree(inImage);                                                                                     \
    107104        psFree(outImage);                                                                                    \
     
    110107    }
    111108
    112     testBinaryOpM( abs, S32, -10, 0, 3, 2 );
    113     testBinaryOpM( abs, F32, -10.0, 0.0, 3, 2 );
    114     testBinaryOpM( abs, F64, -10.0, 0.0, 3, 2 );
    115     testBinaryOpM( abs, C32, -10.0 - 10.0i, 0.0 + 0.0i, 3, 2 );
    116     testBinaryOpM( exp, S32, 10, 0, 3, 2 );
    117     testBinaryOpM( exp, F32, 10.0, 0.0, 3, 2 );
    118     testBinaryOpM( exp, F64, 10.0, 0.0, 3, 2 );
    119     testBinaryOpM( exp, C32, 10.0 + 10.0i, 0.0 + 0.0i, 3, 2 );
    120     testBinaryOpM( ln, S32, 10, 0, 3, 2 );
    121     testBinaryOpM( ln, F32, 10.0, 0.0, 3, 2 );
    122     testBinaryOpM( ln, F64, 10.0, 0.0, 3, 2 );
    123     testBinaryOpM( ln, C32, 10.0 + 10.0i, 0.0 + 0.0i, 3, 2 );
    124     testBinaryOpM( ten, S32, 3, 0, 3, 2 );
    125     testBinaryOpM( ten, F32, 3.0, 0.0, 3, 2 );
    126     testBinaryOpM( ten, F64, 3.0, 0.0, 3, 2 );
    127     testBinaryOpM( ten, C32, 3.0 + 3.0i, 0.0 + 0.0i, 3, 2 );
    128     testBinaryOpM( log, S32, 1000, 0, 3, 2 );
    129     testBinaryOpM( log, F32, 1000.0, 0.0, 3, 2 );
    130     testBinaryOpM( log, F64, 1000.0, 0.0, 3, 2 );
    131     testBinaryOpM( log, C32, 1000.0 + 1000.0i, 0.0 + 0.0i, 3, 2 );
    132     testBinaryOpM( sin, S32, M_PI_2, 0, 3, 2 );
    133     testBinaryOpM( sin, F32, M_PI_2, 0.0, 3, 2 );
    134     testBinaryOpM( sin, F64, M_PI_2, 0.0, 3, 2 );
    135     testBinaryOpM( sin, C32, M_PI_2 + 1.57079632679489661923i, 0.0 + 0.0i, 3, 2 );
    136     testBinaryOpM( dsin, S32, 90, 0, 3, 2 );
    137     testBinaryOpM( dsin, F32, 90.0, 0.0, 3, 2 );
    138     testBinaryOpM( dsin, F64, 90.0, 0.0, 3, 2 );
    139     testBinaryOpM( dsin, C32, 90.0 + 90.0i, 0.0 + 0.0i, 3, 2 );
    140     testBinaryOpM( cos, S32, 0, 0, 3, 2 );
    141     testBinaryOpM( cos, F32, 0.0, 0.0, 3, 2 );
    142     testBinaryOpM( cos, F64, 0.0, 0.0, 3, 2 );
    143     testBinaryOpM( cos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2 );
    144     testBinaryOpM( dcos, S32, 0, 0, 3, 2 );
    145     testBinaryOpM( dcos, F32, 0.0, 0.0, 3, 2 );
    146     testBinaryOpM( dcos, F64, 0.0, 0.0, 3, 2 );
    147     testBinaryOpM( dcos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2 );
    148     testBinaryOpM( tan, S32, M_PI_4, 0, 3, 2 );
    149     testBinaryOpM( tan, F32, M_PI_4, 0.0, 3, 2 );
    150     testBinaryOpM( tan, F64, M_PI_4, 0.0, 3, 2 );
    151     testBinaryOpM( tan, C32, M_PI_4 + 0.78539816339744830962i, 0.0 + 0.0i, 3, 2 );
    152     testBinaryOpM( dtan, S32, 45, 0, 3, 2 );
    153     testBinaryOpM( dtan, F32, 45.0, 0.0, 3, 2 );
    154     testBinaryOpM( dtan, F64, 45.0, 0.0, 3, 2 );
    155     testBinaryOpM( dtan, C32, 45.0 + 45.0i, 0.0 + 0.0i, 3, 2 );
    156     testBinaryOpM( asin, S32, 1, 0, 3, 2 );
    157     testBinaryOpM( asin, F32, 1.0, 0.0, 3, 2 );
    158     testBinaryOpM( asin, F64, 1.0, 0.0, 3, 2 );
    159     testBinaryOpM( asin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2 );
    160     testBinaryOpM( dasin, S32, 1.0, 0, 3, 2 );
    161     testBinaryOpM( dasin, F32, 1.0, 0.0, 3, 2 );
    162     testBinaryOpM( dasin, F64, 1.0, 0.0, 3, 2 );
    163     testBinaryOpM( dasin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2 );
    164     testBinaryOpM( acos, S32, 0, 0, 3, 2 );
    165     testBinaryOpM( acos, F32, 0.0, 0.0, 3, 2 );
    166     testBinaryOpM( acos, F64, 0.0, 0.0, 3, 2 );
    167     testBinaryOpM( acos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2 );
    168     testBinaryOpM( dacos, S32, 0, 0, 3, 2 );
    169     testBinaryOpM( dacos, F32, 0.0, 0.0, 3, 2 );
    170     testBinaryOpM( dacos, F64, 0.0, 0.0, 3, 2 );
    171     testBinaryOpM( dacos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2 );
    172     testBinaryOpM( atan, S32, 1, 0, 3, 2 );
    173     testBinaryOpM( atan, F32, 1.0, 0.0, 3, 2 );
    174     testBinaryOpM( atan, F64, 1.0, 0.0, 3, 2 );
    175     testBinaryOpM( atan, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2 );
    176     testBinaryOpM( datan, S32, 1, 0, 3, 2 );
    177     testBinaryOpM( datan, F32, 1.0, 0.0, 3, 2 );
    178     testBinaryOpM( datan, F64, 1.0, 0.0, 3, 2 );
    179     testBinaryOpM( 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 );
    180177
    181178
    182179    // Test vector unary operations
    183     #define testBinaryOpV(OP,TYPE,VALUE1,VALUE2,SIZE)                                                        \
     180    #define testUnaryOpV(OP,TYPE,VALUE1,VALUE2,SIZE,TRUTH)                                                   \
    184181    {                                                                                                        \
    185182        printPositiveTestHeader(stdout, "psMatrixVectorArithmetic", "Test vector psUnaryOp");                \
     
    187184        CREATE_AND_SET_VECTOR(inVector,TYPE,VALUE1,SIZE);                                                    \
    188185        CREATE_AND_SET_VECTOR(outVector,TYPE,VALUE2,SIZE);                                                   \
    189         printf("Input:\n");                                                                                  \
    190         PRINT_VECTOR(inVector,TYPE);                                                                         \
    191         PRINT_VECTOR(outVector,TYPE);                                                                        \
    192186        outVector = (psVector*)psUnaryOp(outVector, inVector, #OP);                                          \
    193         printf("Output:\n");                                                                                 \
    194         PRINT_VECTOR(outVector,TYPE);                                                                        \
     187        CHECK_VECTOR(outVector,TYPE,TRUTH);                                                                  \
    195188        psFree(inVector);                                                                                    \
    196189        psFree(outVector);                                                                                   \
     
    199192    }
    200193
    201     testBinaryOpV( abs, S32, -10, 0, 3 );
    202     testBinaryOpV( abs, F32, -10.0, 0.0, 3 );
    203     testBinaryOpV( abs, F64, -10.0, 0.0, 3 );
    204     testBinaryOpV( abs, C32, -10.0 - 10.0i, 0.0 + 0.0i, 3 );
    205     testBinaryOpV( exp, S32, 10, 0, 3 );
    206     testBinaryOpV( exp, F32, 10.0, 0.0, 3 );
    207     testBinaryOpV( exp, F64, 10.0, 0.0, 3 );
    208     testBinaryOpV( exp, C32, 10.0 + 10.0i, 0.0 + 0.0i, 3 );
    209     testBinaryOpV( ln, S32, 10, 0, 3 );
    210     testBinaryOpV( ln, F32, 10.0, 0.0, 3 );
    211     testBinaryOpV( ln, F64, 10.0, 0.0, 3 );
    212     testBinaryOpV( ln, C32, 10.0 + 10.0i, 0.0 + 0.0i, 3 );
    213     testBinaryOpV( ten, S32, 3, 0, 3 );
    214     testBinaryOpV( ten, F32, 3.0, 0.0, 3 );
    215     testBinaryOpV( ten, F64, 3.0, 0.0, 3 );
    216     testBinaryOpV( ten, C32, 3.0 + 3.0i, 0.0 + 0.0i, 3 );
    217     testBinaryOpV( log, S32, 1000, 0, 3 );
    218     testBinaryOpV( log, F32, 1000.0, 0.0, 3 );
    219     testBinaryOpV( log, F64, 1000.0, 0.0, 3 );
    220     testBinaryOpV( log, C32, 1000.0 + 1000.0i, 0.0 + 0.0i, 3 );
    221     testBinaryOpV( sin, S32, M_PI_2, 0, 3 );
    222     testBinaryOpV( sin, F32, M_PI_2, 0.0, 3 );
    223     testBinaryOpV( sin, F64, M_PI_2, 0.0, 3 );
    224     testBinaryOpV( sin, C32, M_PI_2 + 1.57079632679489661923i, 0.0 + 0.0i, 3 );
    225     testBinaryOpV( dsin, S32, 90, 0, 3 );
    226     testBinaryOpV( dsin, F32, 90.0, 0.0, 3 );
    227     testBinaryOpV( dsin, F64, 90.0, 0.0, 3 );
    228     testBinaryOpV( dsin, C32, 90.0 + 90.0i, 0.0 + 0.0i, 3 );
    229     testBinaryOpV( cos, S32, 0, 0, 3 );
    230     testBinaryOpV( cos, F32, 0.0, 0.0, 3 );
    231     testBinaryOpV( cos, F64, 0.0, 0.0, 3 );
    232     testBinaryOpV( cos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3 );
    233     testBinaryOpV( dcos, S32, 0, 0, 3 );
    234     testBinaryOpV( dcos, F32, 0.0, 0.0, 3 );
    235     testBinaryOpV( dcos, F64, 0.0, 0.0, 3 );
    236     testBinaryOpV( dcos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3 );
    237     testBinaryOpV( tan, S32, M_PI_4, 0, 3 );
    238     testBinaryOpV( tan, F32, M_PI_4, 0.0, 3 );
    239     testBinaryOpV( tan, F64, M_PI_4, 0.0, 3 );
    240     testBinaryOpV( tan, C32, M_PI_4 + 0.78539816339744830962i, 0.0 + 0.0i, 3 );
    241     testBinaryOpV( dtan, S32, 45, 0, 3 );
    242     testBinaryOpV( dtan, F32, 45.0, 0.0, 3 );
    243     testBinaryOpV( dtan, F64, 45.0, 0.0, 3 );
    244     testBinaryOpV( dtan, C32, 45.0 + 45.0i, 0.0 + 0.0i, 3 );
    245     testBinaryOpV( asin, S32, 1, 0, 3 );
    246     testBinaryOpV( asin, F32, 1.0, 0.0, 3 );
    247     testBinaryOpV( asin, F64, 1.0, 0.0, 3 );
    248     testBinaryOpV( asin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3 );
    249     testBinaryOpV( dasin, S32, 1.0, 0, 3 );
    250     testBinaryOpV( dasin, F32, 1.0, 0.0, 3 );
    251     testBinaryOpV( dasin, F64, 1.0, 0.0, 3 );
    252     testBinaryOpV( dasin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3 );
    253     testBinaryOpV( acos, S32, 0, 0, 3 );
    254     testBinaryOpV( acos, F32, 0.0, 0.0, 3 );
    255     testBinaryOpV( acos, F64, 0.0, 0.0, 3 );
    256     testBinaryOpV( acos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3 );
    257     testBinaryOpV( dacos, S32, 0, 0, 3 );
    258     testBinaryOpV( dacos, F32, 0.0, 0.0, 3 );
    259     testBinaryOpV( dacos, F64, 0.0, 0.0, 3 );
    260     testBinaryOpV( dacos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3 );
    261     testBinaryOpV( atan, S32, 1, 0, 3 );
    262     testBinaryOpV( atan, F32, 1.0, 0.0, 3 );
    263     testBinaryOpV( atan, F64, 1.0, 0.0, 3 );
    264     testBinaryOpV( atan, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3 );
    265     testBinaryOpV( datan, S32, 1, 0, 3 );
    266     testBinaryOpV( datan, F32, 1.0, 0.0, 3 );
    267     testBinaryOpV( datan, F64, 1.0, 0.0, 3 );
    268     testBinaryOpV( 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 );
    269262
    270263    return 0;
Note: See TracChangeset for help on using the changeset viewer.