Changeset 3182 for trunk/psLib/src
- Timestamp:
- Feb 9, 2005, 4:36:42 PM (21 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 8 added
- 2 deleted
- 19 edited
-
astro/psCoord.c (modified) (6 diffs)
-
astro/psTime.c (modified) (4 diffs)
-
astronomy/astronomy.i (modified) (1 diff)
-
astronomy/psCoord.c (modified) (6 diffs)
-
astronomy/psTime.c (modified) (4 diffs)
-
dataManip/Makefile.am (modified) (2 diffs)
-
dataManip/psBinaryOp.c (added)
-
dataManip/psBinaryOp.h (added)
-
dataManip/psConstants.h (modified) (2 diffs)
-
dataManip/psFunctions.c (modified) (2 diffs)
-
dataManip/psMatrixVectorArithmetic.c (deleted)
-
dataManip/psMatrixVectorArithmetic.h (deleted)
-
dataManip/psMinimize.c (modified) (4 diffs)
-
dataManip/psUnaryOp.c (added)
-
dataManip/psUnaryOp.h (added)
-
image/psImageStats.c (modified) (3 diffs)
-
imageops/psImageStats.c (modified) (3 diffs)
-
math/psBinaryOp.c (added)
-
math/psBinaryOp.h (added)
-
math/psConstants.h (modified) (2 diffs)
-
math/psMinimize.c (modified) (4 diffs)
-
math/psPolynomial.c (modified) (2 diffs)
-
math/psSpline.c (modified) (2 diffs)
-
math/psUnaryOp.c (added)
-
math/psUnaryOp.h (added)
-
psTest.c (modified) (1 diff)
-
pslib.h (modified) (2 diffs)
-
sys/psTrace.c (modified) (6 diffs)
-
sysUtils/psTrace.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r3114 r3182 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1. 49$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-02- 03 00:45:06$12 * @version $Revision: 1.50 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-02-10 02:36:41 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 267 267 { 268 268 while (angle < FLT_EPSILON) { 269 angle+= M_PI;270 } 271 272 while (angle >= M_PI) {273 angle-= M_PI;269 angle+=PS_PI; 270 } 271 272 while (angle >= PS_PI) { 273 angle-=PS_PI; 274 274 } 275 275 return(angle); … … 547 547 R = PS_SQRT_F32((coord->x * coord->x) + (coord->y * coord->y)); 548 548 tmp->d = atan2(-coord->y, coord->x); 549 tmp->r = acos((R * M_PI) / 180.0);549 tmp->r = acos((R * PS_PI) / 180.0); 550 550 551 551 } else if (projection->type == PS_PROJ_CAR) { … … 555 555 } else if (projection->type == PS_PROJ_MER) { 556 556 tmp->d = coord->x; 557 tmp->r = (2.0 * atan(exp((coord->y * M_PI / 180.0)))) - 180.0;557 tmp->r = (2.0 * atan(exp((coord->y * PS_PI / 180.0)))) - 180.0; 558 558 559 559 } else if (projection->type == PS_PROJ_AIT) { 560 chu1 = (coord->x * M_PI) / 720.0;560 chu1 = (coord->x * PS_PI) / 720.0; 561 561 chu1 *= chu1; 562 chu2 = (coord->y * M_PI) / 360.0;562 chu2 = (coord->y * PS_PI) / 360.0; 563 563 chu2 *= chu2; 564 564 chu = PS_SQRT_F32(1.0 - chu1 - chu2); 565 tmp->d = 2.0 * atan2((2.0 * chu * chu) - 1.0, (coord->x * chu * M_PI) / 360.0);566 tmp->r = asin((coord->y * chu * M_PI) / 180.0);565 tmp->d = 2.0 * atan2((2.0 * chu * chu) - 1.0, (coord->x * chu * PS_PI) / 360.0); 566 tmp->r = asin((coord->y * chu * PS_PI) / 180.0); 567 567 568 568 } else if (projection->type == PS_PROJ_PAR) { … … 640 640 // Wrap these to an acceptable range. This assumes that all 641 641 // angles are in radians. 642 tmp->r = fmod(tmp->r, 2* M_PI);643 tmp->d = fmod(tmp->d, 2* M_PI);642 tmp->r = fmod(tmp->r, 2*PS_PI); 643 tmp->d = fmod(tmp->d, 2*PS_PI); 644 644 tmp->rErr = 0.0; 645 645 tmp->dErr = 0.0; … … 731 731 tmp = (psSphere* ) psAlloc(sizeof(psSphere)); 732 732 tmp->r = position->r + tmpR; 733 tmp->r = fmod(tmp->r, 2.0* M_PI);733 tmp->r = fmod(tmp->r, 2.0*PS_PI); 734 734 tmp->d = position->d + tmpD; 735 tmp->d = fmod(tmp->d, 2.0* M_PI);735 tmp->d = fmod(tmp->d, 2.0*PS_PI); 736 736 tmp->rErr = 0.0; 737 737 tmp->dErr = 0.0; -
trunk/psLib/src/astro/psTime.c
r3114 r3182 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.5 0$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-02- 03 00:45:06$12 * @version $Revision: 1.51 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-02-10 02:36:41 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 43 43 44 44 /** Two times pi with double precision accuracy */ 45 #define TWOPI (2.0* M_PI)45 #define TWOPI (2.0*PS_PI) 46 46 47 47 /** Conversion from radians to degrees */ 48 #define R2DEG = (180.0/ M_PI)48 #define R2DEG = (180.0/PS_PI) 49 49 50 50 /** Maximum length of time string */ … … 548 548 549 549 t = 2000.0 + (mjd - 51544.03)/365.2422; 550 dut2ut1 = 0.022*sin(TWOPI*t) - 0.012*cos(TWOPI*t) - 0.006*sin(4.0* M_PI*t) + 0.007*cos(4.0*M_PI*t);550 dut2ut1 = 0.022*sin(TWOPI*t) - 0.012*cos(TWOPI*t) - 0.006*sin(4.0*PS_PI*t) + 0.007*cos(4.0*PS_PI*t); 551 551 result = dut->data.F64[0] + dut->data.F64[1]*(mjd - dut->data.F64[2]) - dut2ut1; 552 552 … … 677 677 } 678 678 679 // Create output sphere and convert arcsec to radians (i.e. x/60/60* M_PI/180)679 // Create output sphere and convert arcsec to radians (i.e. x/60/60*PS_PI/180) 680 680 output = psAlloc(sizeof(psSphere)); 681 output->r = x * M_PI / 648000.0;682 output->d = y * M_PI / 648000.0;681 output->r = x * PS_PI / 648000.0; 682 output->d = y * PS_PI / 648000.0; 683 683 684 684 return output; -
trunk/psLib/src/astronomy/astronomy.i
r3169 r3182 17 17 // add a method to add primitives to metadata 18 18 %inline %{ 19 psBool psMetadataAddStr(psMetadata* md, psS32 where, const char* name, const char* comment, const char* value) { 19 psBool psMetadataAddStr(psMetadata* md, psS32 where, const char* name, 20 const char* comment, const char* value) { 20 21 return psMetadataAdd(md,where,name,PS_TYPE_PTR, PS_META_STR,comment,value); 21 22 } 22 psBool psMetadataAddF32(psMetadata* md, psS32 where, const char* name, const char* comment, psF32 value) { 23 psBool psMetadataAddF32(psMetadata* md, 24 psS32 where, 25 const char* name, 26 const char* comment, 27 psF32 value) 28 { 23 29 return psMetadataAdd(md,where,name,PS_TYPE_F32, PS_META_PRIMITIVE,comment,value); 24 30 } 25 psBool psMetadataAddF64(psMetadata* md, psS32 where, const char* name, const char* comment, psF64 value) { 31 32 psBool psMetadataAddF64(psMetadata* md, 33 psS32 where, 34 const char* name, 35 const char* comment, 36 psF64 value) 37 { 26 38 return psMetadataAdd(md,where,name,PS_TYPE_F64, PS_META_PRIMITIVE,comment,value); 27 39 } 28 psBool psMetadataAddS32(psMetadata* md, psS32 where, const char* name, const char* comment, psS32 value) { 40 41 psBool psMetadataAddS32(psMetadata* md, 42 psS32 where, 43 const char* name, 44 const char* comment, 45 psS32 value) 46 { 29 47 return psMetadataAdd(md,where,name,PS_TYPE_S32, PS_META_PRIMITIVE,comment,value); 30 48 } 31 49 32 psMetadataItem* psMetadataItemAllocStr(const char* name, const char* comment, const char* value) { 50 psMetadataItem* psMetadataItemAllocStr(const char* name, 51 const char* comment, 52 const char* value) 53 { 33 54 return psMetadataItemAlloc(name, PS_TYPE_PTR, PS_META_STR, comment, value); 34 55 } 35 psMetadataItem* psMetadataItemAllocF32(const char* name, const char* comment, psF32 value) { 56 57 psMetadataItem* psMetadataItemAllocF32(const char* name, 58 const char* comment, 59 psF32 value) 60 { 36 61 return psMetadataItemAlloc(name, PS_TYPE_F32, PS_META_PRIMITIVE, comment, value); 37 62 } 38 psMetadataItem* psMetadataItemAllocF64(const char* name, const char* comment, psF64 value) { 63 64 psMetadataItem* psMetadataItemAllocF64(const char* name, 65 const char* comment, 66 psF64 value) 67 { 39 68 return psMetadataItemAlloc(name, PS_TYPE_F64, PS_META_PRIMITIVE, comment, value); 40 69 } 41 psMetadataItem* psMetadataItemAllocS32(const char* name, const char* comment, psS32 value) { 70 71 psMetadataItem* psMetadataItemAllocS32(const char* name, 72 const char* comment, 73 psS32 value) 74 { 42 75 return psMetadataItemAlloc(name, PS_TYPE_S32, PS_META_PRIMITIVE, comment, value); 43 76 } -
trunk/psLib/src/astronomy/psCoord.c
r3114 r3182 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1. 49$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-02- 03 00:45:06$12 * @version $Revision: 1.50 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-02-10 02:36:41 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 267 267 { 268 268 while (angle < FLT_EPSILON) { 269 angle+= M_PI;270 } 271 272 while (angle >= M_PI) {273 angle-= M_PI;269 angle+=PS_PI; 270 } 271 272 while (angle >= PS_PI) { 273 angle-=PS_PI; 274 274 } 275 275 return(angle); … … 547 547 R = PS_SQRT_F32((coord->x * coord->x) + (coord->y * coord->y)); 548 548 tmp->d = atan2(-coord->y, coord->x); 549 tmp->r = acos((R * M_PI) / 180.0);549 tmp->r = acos((R * PS_PI) / 180.0); 550 550 551 551 } else if (projection->type == PS_PROJ_CAR) { … … 555 555 } else if (projection->type == PS_PROJ_MER) { 556 556 tmp->d = coord->x; 557 tmp->r = (2.0 * atan(exp((coord->y * M_PI / 180.0)))) - 180.0;557 tmp->r = (2.0 * atan(exp((coord->y * PS_PI / 180.0)))) - 180.0; 558 558 559 559 } else if (projection->type == PS_PROJ_AIT) { 560 chu1 = (coord->x * M_PI) / 720.0;560 chu1 = (coord->x * PS_PI) / 720.0; 561 561 chu1 *= chu1; 562 chu2 = (coord->y * M_PI) / 360.0;562 chu2 = (coord->y * PS_PI) / 360.0; 563 563 chu2 *= chu2; 564 564 chu = PS_SQRT_F32(1.0 - chu1 - chu2); 565 tmp->d = 2.0 * atan2((2.0 * chu * chu) - 1.0, (coord->x * chu * M_PI) / 360.0);566 tmp->r = asin((coord->y * chu * M_PI) / 180.0);565 tmp->d = 2.0 * atan2((2.0 * chu * chu) - 1.0, (coord->x * chu * PS_PI) / 360.0); 566 tmp->r = asin((coord->y * chu * PS_PI) / 180.0); 567 567 568 568 } else if (projection->type == PS_PROJ_PAR) { … … 640 640 // Wrap these to an acceptable range. This assumes that all 641 641 // angles are in radians. 642 tmp->r = fmod(tmp->r, 2* M_PI);643 tmp->d = fmod(tmp->d, 2* M_PI);642 tmp->r = fmod(tmp->r, 2*PS_PI); 643 tmp->d = fmod(tmp->d, 2*PS_PI); 644 644 tmp->rErr = 0.0; 645 645 tmp->dErr = 0.0; … … 731 731 tmp = (psSphere* ) psAlloc(sizeof(psSphere)); 732 732 tmp->r = position->r + tmpR; 733 tmp->r = fmod(tmp->r, 2.0* M_PI);733 tmp->r = fmod(tmp->r, 2.0*PS_PI); 734 734 tmp->d = position->d + tmpD; 735 tmp->d = fmod(tmp->d, 2.0* M_PI);735 tmp->d = fmod(tmp->d, 2.0*PS_PI); 736 736 tmp->rErr = 0.0; 737 737 tmp->dErr = 0.0; -
trunk/psLib/src/astronomy/psTime.c
r3114 r3182 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.5 0$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-02- 03 00:45:06$12 * @version $Revision: 1.51 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-02-10 02:36:41 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 43 43 44 44 /** Two times pi with double precision accuracy */ 45 #define TWOPI (2.0* M_PI)45 #define TWOPI (2.0*PS_PI) 46 46 47 47 /** Conversion from radians to degrees */ 48 #define R2DEG = (180.0/ M_PI)48 #define R2DEG = (180.0/PS_PI) 49 49 50 50 /** Maximum length of time string */ … … 548 548 549 549 t = 2000.0 + (mjd - 51544.03)/365.2422; 550 dut2ut1 = 0.022*sin(TWOPI*t) - 0.012*cos(TWOPI*t) - 0.006*sin(4.0* M_PI*t) + 0.007*cos(4.0*M_PI*t);550 dut2ut1 = 0.022*sin(TWOPI*t) - 0.012*cos(TWOPI*t) - 0.006*sin(4.0*PS_PI*t) + 0.007*cos(4.0*PS_PI*t); 551 551 result = dut->data.F64[0] + dut->data.F64[1]*(mjd - dut->data.F64[2]) - dut2ut1; 552 552 … … 677 677 } 678 678 679 // Create output sphere and convert arcsec to radians (i.e. x/60/60* M_PI/180)679 // Create output sphere and convert arcsec to radians (i.e. x/60/60*PS_PI/180) 680 680 output = psAlloc(sizeof(psSphere)); 681 output->r = x * M_PI / 648000.0;682 output->d = y * M_PI / 648000.0;681 output->r = x * PS_PI / 648000.0; 682 output->d = y * PS_PI / 648000.0; 683 683 684 684 return output; -
trunk/psLib/src/dataManip/Makefile.am
r3131 r3182 11 11 noinst_LTLIBRARIES = libpslibdataManip.la 12 12 13 libpslibdataManip_la_SOURCES = \ 14 psMatrixVectorArithmetic.c \ 15 psStats.c \ 16 psFunctions.c \ 17 psMatrix.c \ 18 psVectorFFT.c \ 19 psMinimize.c \ 20 psRandom.c 13 libpslibdataManip_la_SOURCES = psUnaryOp.c psBinaryOp.c psStats.c \ 14 psFunctions.c psMatrix.c psVectorFFT.c psMinimize.c psRandom.c 21 15 22 16 BUILT_SOURCES = psDataManipErrors.h … … 32 26 psFunctions.h \ 33 27 psMatrix.h \ 34 psMatrixVectorArithmetic.h \ 28 psBinaryOp.h \ 29 psUnaryOp.h \ 35 30 psVectorFFT.h \ 36 31 psMinimize.h \ -
trunk/psLib/src/dataManip/psConstants.h
r2941 r3182 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.5 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 1-10 19:47:11 $8 * @version $Revision: 1.54 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-02-10 02:36:41 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 37 37 38 38 #define PS_COT(X) (1.0 / atan(X)) 39 #define DEG_TO_RAD(DEGREES) ((DEGREES) * M_PI / 180.0)40 #define MIN_TO_RAD(MINUTES) ((MINUTES) * M_PI / (180.0 * 60.0))41 #define SEC_TO_RAD(SECONDS) ((SECONDS) * M_PI / (180.0 * 60.0 * 60.0))42 #define RAD_TO_DEG(RADIANS) ((RADIANS) * 180.0 / M_PI)43 #define RAD_TO_MIN(RADIANS) ((RADIANS) * 180.0 * 60.0 / M_PI)44 #define RAD_TO_SEC(RADIANS) ((RADIANS) * 180.0 * 60.0 * 60.0 / M_PI)39 #define DEG_TO_RAD(DEGREES) ((DEGREES) * PS_PI / 180.0) 40 #define MIN_TO_RAD(MINUTES) ((MINUTES) * PS_PI / (180.0 * 60.0)) 41 #define SEC_TO_RAD(SECONDS) ((SECONDS) * PS_PI / (180.0 * 60.0 * 60.0)) 42 #define RAD_TO_DEG(RADIANS) ((RADIANS) * 180.0 / PS_PI) 43 #define RAD_TO_MIN(RADIANS) ((RADIANS) * 180.0 * 60.0 / PS_PI) 44 #define RAD_TO_SEC(RADIANS) ((RADIANS) * 180.0 * 60.0 * 60.0 / PS_PI) 45 45 46 46 /***************************************************************************** -
trunk/psLib/src/dataManip/psFunctions.c
r3171 r3182 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.8 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-02- 09 20:56:17$9 * @version $Revision: 1.88 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-02-10 02:36:41 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 975 975 976 976 if (normal == true) { 977 tmp = 1.0 / PS_SQRT_F32(2.0 * M_PI * (sigma * sigma));977 tmp = 1.0 / PS_SQRT_F32(2.0 * PS_PI * (sigma * sigma)); 978 978 } 979 979 -
trunk/psLib/src/dataManip/psMinimize.c
r3115 r3182 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.10 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02- 03 00:54:10$11 * @version $Revision: 1.105 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-10 02:36:41 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 538 538 psF64 flux = normalization * exp(-( u*u/(2.0 * sigmaX * sigmaX) + 539 539 v*v/(2.0 * sigmaY * sigmaY)))/ 540 (2.0 * M_PI * sigmaX * sigmaY);540 (2.0 * PS_PI * sigmaX * sigmaY); 541 541 out->data.F32[i] = flux; 542 542 … … 865 865 for (psS32 i=0;i<n;i++) { 866 866 // NR 5.8.4 867 psF64 Y = cos( M_PI * (0.5 + ((psF32) i)) / ((psF32) n));867 psF64 Y = cos(PS_PI * (0.5 + ((psF32) i)) / ((psF32) n)); 868 868 psF64 X = (Y + bma + bpa) - 1.0; 869 869 tmpScalar.data.F64 = X; … … 893 893 for (k=0;k<n;k++) { 894 894 sum+= f->data.F64[k] * 895 cos( M_PI * ((psF32) j) * (0.5 + ((psF32) k)) / ((psF32) n));895 cos(PS_PI * ((psF32) j) * (0.5 + ((psF32) k)) / ((psF32) n)); 896 896 } 897 897 -
trunk/psLib/src/image/psImageStats.c
r3115 r3182 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.6 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02- 03 00:54:11$11 * @version $Revision: 1.65 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-10 02:36:42 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 139 139 for (i = 0; i < n; i++) { 140 140 tmp = (double)(n - i); 141 tmp = ( M_PI * (tmp - 0.5)) / ((double)n);141 tmp = (PS_PI * (tmp - 0.5)) / ((double)n); 142 142 scalingFactors[i] = cos(tmp); 143 143 } … … 348 348 // Chebyshev polynomials are 0. 349 349 for (x = 0; x < input->numRows; x++) { 350 double xTmp = cos( M_PI * (0.5 + ((float) x)) / ((float) input->numRows));350 double xTmp = cos(PS_PI * (0.5 + ((float) x)) / ((float) input->numRows)); 351 351 double xNode = - ((xTmp + bma + bpa) - 1.0); 352 352 double xOrig = ((float) input->numRows) * (xNode - min) / (max - min); 353 353 354 354 for (y = 0; y < input->numCols; y++) { 355 double yTmp = cos( M_PI * (0.5 + ((float) y)) / ((float) input->numCols));355 double yTmp = cos(PS_PI * (0.5 + ((float) y)) / ((float) input->numCols)); 356 356 double yNode = - ((yTmp + bma + bpa) - 1.0); 357 357 double yOrig = ((float) input->numCols) * (yNode - min) / (max - min); -
trunk/psLib/src/imageops/psImageStats.c
r3115 r3182 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.6 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02- 03 00:54:11$11 * @version $Revision: 1.65 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-10 02:36:42 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 139 139 for (i = 0; i < n; i++) { 140 140 tmp = (double)(n - i); 141 tmp = ( M_PI * (tmp - 0.5)) / ((double)n);141 tmp = (PS_PI * (tmp - 0.5)) / ((double)n); 142 142 scalingFactors[i] = cos(tmp); 143 143 } … … 348 348 // Chebyshev polynomials are 0. 349 349 for (x = 0; x < input->numRows; x++) { 350 double xTmp = cos( M_PI * (0.5 + ((float) x)) / ((float) input->numRows));350 double xTmp = cos(PS_PI * (0.5 + ((float) x)) / ((float) input->numRows)); 351 351 double xNode = - ((xTmp + bma + bpa) - 1.0); 352 352 double xOrig = ((float) input->numRows) * (xNode - min) / (max - min); 353 353 354 354 for (y = 0; y < input->numCols; y++) { 355 double yTmp = cos( M_PI * (0.5 + ((float) y)) / ((float) input->numCols));355 double yTmp = cos(PS_PI * (0.5 + ((float) y)) / ((float) input->numCols)); 356 356 double yNode = - ((yTmp + bma + bpa) - 1.0); 357 357 double yOrig = ((float) input->numCols) * (yNode - min) / (max - min); -
trunk/psLib/src/math/psConstants.h
r2941 r3182 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.5 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 1-10 19:47:11 $8 * @version $Revision: 1.54 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-02-10 02:36:41 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 37 37 38 38 #define PS_COT(X) (1.0 / atan(X)) 39 #define DEG_TO_RAD(DEGREES) ((DEGREES) * M_PI / 180.0)40 #define MIN_TO_RAD(MINUTES) ((MINUTES) * M_PI / (180.0 * 60.0))41 #define SEC_TO_RAD(SECONDS) ((SECONDS) * M_PI / (180.0 * 60.0 * 60.0))42 #define RAD_TO_DEG(RADIANS) ((RADIANS) * 180.0 / M_PI)43 #define RAD_TO_MIN(RADIANS) ((RADIANS) * 180.0 * 60.0 / M_PI)44 #define RAD_TO_SEC(RADIANS) ((RADIANS) * 180.0 * 60.0 * 60.0 / M_PI)39 #define DEG_TO_RAD(DEGREES) ((DEGREES) * PS_PI / 180.0) 40 #define MIN_TO_RAD(MINUTES) ((MINUTES) * PS_PI / (180.0 * 60.0)) 41 #define SEC_TO_RAD(SECONDS) ((SECONDS) * PS_PI / (180.0 * 60.0 * 60.0)) 42 #define RAD_TO_DEG(RADIANS) ((RADIANS) * 180.0 / PS_PI) 43 #define RAD_TO_MIN(RADIANS) ((RADIANS) * 180.0 * 60.0 / PS_PI) 44 #define RAD_TO_SEC(RADIANS) ((RADIANS) * 180.0 * 60.0 * 60.0 / PS_PI) 45 45 46 46 /***************************************************************************** -
trunk/psLib/src/math/psMinimize.c
r3115 r3182 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.10 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02- 03 00:54:10$11 * @version $Revision: 1.105 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-10 02:36:41 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 538 538 psF64 flux = normalization * exp(-( u*u/(2.0 * sigmaX * sigmaX) + 539 539 v*v/(2.0 * sigmaY * sigmaY)))/ 540 (2.0 * M_PI * sigmaX * sigmaY);540 (2.0 * PS_PI * sigmaX * sigmaY); 541 541 out->data.F32[i] = flux; 542 542 … … 865 865 for (psS32 i=0;i<n;i++) { 866 866 // NR 5.8.4 867 psF64 Y = cos( M_PI * (0.5 + ((psF32) i)) / ((psF32) n));867 psF64 Y = cos(PS_PI * (0.5 + ((psF32) i)) / ((psF32) n)); 868 868 psF64 X = (Y + bma + bpa) - 1.0; 869 869 tmpScalar.data.F64 = X; … … 893 893 for (k=0;k<n;k++) { 894 894 sum+= f->data.F64[k] * 895 cos( M_PI * ((psF32) j) * (0.5 + ((psF32) k)) / ((psF32) n));895 cos(PS_PI * ((psF32) j) * (0.5 + ((psF32) k)) / ((psF32) n)); 896 896 } 897 897 -
trunk/psLib/src/math/psPolynomial.c
r3171 r3182 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.8 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-02- 09 20:56:17$9 * @version $Revision: 1.88 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-02-10 02:36:41 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 975 975 976 976 if (normal == true) { 977 tmp = 1.0 / PS_SQRT_F32(2.0 * M_PI * (sigma * sigma));977 tmp = 1.0 / PS_SQRT_F32(2.0 * PS_PI * (sigma * sigma)); 978 978 } 979 979 -
trunk/psLib/src/math/psSpline.c
r3171 r3182 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.8 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-02- 09 20:56:17$9 * @version $Revision: 1.88 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-02-10 02:36:41 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 975 975 976 976 if (normal == true) { 977 tmp = 1.0 / PS_SQRT_F32(2.0 * M_PI * (sigma * sigma));977 tmp = 1.0 / PS_SQRT_F32(2.0 * PS_PI * (sigma * sigma)); 978 978 } 979 979 -
trunk/psLib/src/psTest.c
r3127 r3182 11 11 // 12 12 13 13 #include <sys/types.h> 14 #include <unistd.h> 14 15 #include <stdlib.h> 15 #include <unistd.h>16 16 #include <sys/wait.h> 17 17 #include <stdbool.h> -
trunk/psLib/src/pslib.h
r3115 r3182 9 9 * @author Eric Van Alst, MHPCC 10 10 * 11 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02- 03 00:54:10$11 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-10 02:36:41 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 126 126 #include "psMatrix.h" 127 127 128 /// @defgroup Matrix VectorArithmetic Matrix VectorArithmetic Operations128 /// @defgroup MatrixArithmetic Matrix Arithmetic Operations 129 129 /// @ingroup DataManip 130 #include "psMatrixVectorArithmetic.h" 130 #include "psBinaryOp.h" 131 #include "psUnaryOp.h" 131 132 132 133 #include "psRandom.h" -
trunk/psLib/src/sys/psTrace.c
r3115 r3182 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.4 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02- 03 00:54:11$11 * @version $Revision: 1.42 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-10 02:36:42 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 40 40 #ifndef PS_NO_TRACE 41 41 42 #include <unistd.h> 42 43 #include <stdlib.h> 43 44 #include <stdio.h> … … 146 147 /***************************************************************************** 147 148 componentAdd(): Adds the component named "addNodeName" to the root tree. 148 149 NOTE: replace the call to strsep() with a call to strtok(), which conforms150 to ANSI-C.151 149 *****************************************************************************/ 152 150 static psBool componentAdd(const char *addNodeName, psS32 level) … … 180 178 181 179 strcpy(name, addNodeName); 182 pname = &name[1];180 pname = name+1; 183 181 // Iterate through the components of addNodeName. Strip off the first 184 182 // component of the name, find that in the root tree, or add it if it … … 186 184 187 185 while (pname != NULL) { 188 firstComponent = strsep(&pname, "."); 186 firstComponent = pname; 187 pname = strtok(pname, "."); 188 if (pname != NULL) { 189 *pname = '\0'; 190 pname++; 191 } 189 192 nodeExists = 0; 190 193 for (i = 0; i < currentNode->n; i++) { … … 324 327 pname = &name[1]; 325 328 while (pname != NULL) { 326 firstComponent = strsep(&pname, "."); 329 firstComponent = pname; 330 pname = strtok(pname, "."); 331 if (pname != NULL) { 332 *pname = '\0'; 333 pname++; 334 } 327 335 for (i = 0; i < currentNode->n; i++) { 328 336 if (NULL == currentNode->subcomp[i]) { -
trunk/psLib/src/sysUtils/psTrace.c
r3115 r3182 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.4 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02- 03 00:54:11$11 * @version $Revision: 1.42 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-10 02:36:42 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 40 40 #ifndef PS_NO_TRACE 41 41 42 #include <unistd.h> 42 43 #include <stdlib.h> 43 44 #include <stdio.h> … … 146 147 /***************************************************************************** 147 148 componentAdd(): Adds the component named "addNodeName" to the root tree. 148 149 NOTE: replace the call to strsep() with a call to strtok(), which conforms150 to ANSI-C.151 149 *****************************************************************************/ 152 150 static psBool componentAdd(const char *addNodeName, psS32 level) … … 180 178 181 179 strcpy(name, addNodeName); 182 pname = &name[1];180 pname = name+1; 183 181 // Iterate through the components of addNodeName. Strip off the first 184 182 // component of the name, find that in the root tree, or add it if it … … 186 184 187 185 while (pname != NULL) { 188 firstComponent = strsep(&pname, "."); 186 firstComponent = pname; 187 pname = strtok(pname, "."); 188 if (pname != NULL) { 189 *pname = '\0'; 190 pname++; 191 } 189 192 nodeExists = 0; 190 193 for (i = 0; i < currentNode->n; i++) { … … 324 327 pname = &name[1]; 325 328 while (pname != NULL) { 326 firstComponent = strsep(&pname, "."); 329 firstComponent = pname; 330 pname = strtok(pname, "."); 331 if (pname != NULL) { 332 *pname = '\0'; 333 pname++; 334 } 327 335 for (i = 0; i < currentNode->n; i++) { 328 336 if (NULL == currentNode->subcomp[i]) {
Note:
See TracChangeset
for help on using the changeset viewer.
