Changeset 1516 for trunk/psLib/src/dataManip/psMatrixVectorArithmetic.c
- Timestamp:
- Aug 12, 2004, 8:24:32 AM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psMatrixVectorArithmetic.c
r1440 r1516 30 30 * @author Ross Harman, MHPCC 31 31 * 32 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $33 * @date $Date: 2004-08- 09 23:34:57$32 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 33 * @date $Date: 2004-08-12 18:24:32 $ 34 34 * 35 35 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 90 90 91 91 // Conversion for degrees to radians 92 #define D2R M_PI /180.092 #define D2R M_PIl/180.0 93 93 94 94 // Conversion for radians to degrees 95 #define R2D 180.0/M_PI 95 #define R2D 180.0/M_PIl 96 96 97 97 // Division with NAN checking … … 599 599 } 600 600 601 // Preprocessor macro function to create arithmetic function operation name 601 // Preprocessor macro function to create arithmetic function operation name. Functions below that add 602 // FLT_EPSILON are done so to align results with a 64 bit computing architecture 602 603 #define UNARY_OP(DIM,OUT,IN,OP) \ 603 604 if(!strncmp(OP, "abs", 3)) { \ … … 627 628 } else if(!strncmp(OP, "log", 3)) { \ 628 629 if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \ 629 UNARY_TYPE(DIM,OUT,IN,clog(*i1)/log(10.0)); \630 UNARY_TYPE(DIM,OUT,IN,clog(*i1)/log(10.0)); \ 630 631 } else { \ 631 632 UNARY_TYPE(DIM,OUT,IN,log10(*i1)); \ … … 639 640 } else if(!strncmp(OP, "dsin", 4)) { \ 640 641 if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \ 641 UNARY_TYPE(DIM,OUT,IN,csin(*i1*D2R ));\642 UNARY_TYPE(DIM,OUT,IN,csin(*i1*D2R+FLT_EPSILON)); \ 642 643 } else { \ 643 644 UNARY_TYPE(DIM,OUT,IN,sin(*i1*D2R)); \ … … 676 677 if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \ 677 678 UNARY_TYPE(DIM,OUT,IN,R2D*casin(*i1)); \ 678 } else { \ 679 UNARY_TYPE(DIM,OUT,IN,R2D*asin(*i1)); \ 679 } else if(PS_IS_PSELEMTYPE_INT(IN->type)) { \ 680 UNARY_TYPE(DIM,OUT,IN,(R2D*asin(*i1)+FLT_EPSILON)); \ 681 } else { \ 682 UNARY_TYPE(DIM,OUT,IN,(R2D*asin(*i1))); \ 680 683 } \ 681 684 } else if(!strncmp(OP, "acos", 4)) { \ … … 688 691 if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \ 689 692 UNARY_TYPE(DIM,OUT,IN,R2D*cacos(*i1)); \ 693 } else if(PS_IS_PSELEMTYPE_INT(IN->type)) { \ 694 UNARY_TYPE(DIM,OUT,IN,(R2D*acos(*i1)+FLT_EPSILON)); \ 690 695 } else { \ 691 696 UNARY_TYPE(DIM,OUT,IN,R2D*acos(*i1)); \
Note:
See TracChangeset
for help on using the changeset viewer.
