Changeset 2439
- Timestamp:
- Nov 24, 2004, 12:33:21 PM (22 years ago)
- Location:
- trunk/psLib
- Files:
-
- 11 edited
-
src/dataManip/psFunctions.c (modified) (4 diffs)
-
src/dataManip/psFunctions.h (modified) (2 diffs)
-
src/dataManip/psMinimize.c (modified) (1 diff)
-
src/math/psMinimize.c (modified) (1 diff)
-
src/math/psPolynomial.c (modified) (4 diffs)
-
src/math/psPolynomial.h (modified) (2 diffs)
-
src/math/psSpline.c (modified) (4 diffs)
-
src/math/psSpline.h (modified) (2 diffs)
-
test/dataManip/tst_psFunc04.c (modified) (2 diffs)
-
test/dataManip/tst_psFunc05.c (modified) (1 diff)
-
test/dataManip/tst_psFunc07.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psFunctions.c
r2433 r2439 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1. 69$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-11-24 2 1:59:43$9 * @version $Revision: 1.70 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-11-24 22:33:21 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 2112 2112 the spline fit functions require F32 and F64. 2113 2113 *****************************************************************************/ 2114 float psSpline1DEval(const psSpline1D *spline, 2115 float x) 2114 float psSpline1DEval( 2115 float x, 2116 const psSpline1D *spline 2117 ) 2116 2118 { 2117 2119 PS_PTR_CHECK_NULL(spline, NAN); … … 2144 2146 // XXX: The spline eval functions require input and output to be F32. 2145 2147 // however the spline fit functions require F32 and F64. 2146 psVector *psSpline1DEvalVector(const psVector *x, 2147 const psSpline1D *spline) 2148 psVector *psSpline1DEvalVector( 2149 const psSpline1D *spline, 2150 const psVector *x 2151 ) 2148 2152 { 2149 2153 PS_PTR_CHECK_NULL(spline, NULL); … … 2157 2161 if (x->type.type == PS_TYPE_F32) { 2158 2162 for (i=0;i<x->n;i++) { 2159 tmpVector->data.F32[i] = psSpline1DEval(spline, x->data.F32[i]); 2163 tmpVector->data.F32[i] = psSpline1DEval( 2164 x->data.F32[i], 2165 spline 2166 ); 2160 2167 } 2161 2168 } else if (x->type.type == PS_TYPE_F64) { 2162 2169 for (i=0;i<x->n;i++) { 2163 tmpVector->data.F32[i] = psSpline1DEval(spline, (float) x->data.F64[i]); 2170 tmpVector->data.F32[i] = psSpline1DEval( 2171 (float) x->data.F64[i], 2172 spline 2173 ); 2164 2174 } 2165 2175 } else { -
trunk/psLib/src/dataManip/psFunctions.h
r2433 r2439 12 12 * @author George Gusciora, MHPCC 13 13 * 14 * @version $Revision: 1.3 5$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-11-24 2 1:59:43$14 * @version $Revision: 1.36 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-11-24 22:33:21 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 409 409 psS32 order); 410 410 411 float psSpline1DEval(const psSpline1D *spline, 412 float x); 413 414 psVector *psSpline1DEvalVector(const psVector *x, 415 const psSpline1D *spline); 411 float psSpline1DEval( 412 float x, 413 const psSpline1D *spline 414 ); 415 416 psVector *psSpline1DEvalVector( 417 const psSpline1D *spline, 418 const psVector *x 419 ); 416 420 417 421 psS32 p_psVectorBinDisect(psVector *bins, -
trunk/psLib/src/dataManip/psMinimize.c
r2438 r2439 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.9 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-11-24 22: 22:38$11 * @version $Revision: 1.91 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-11-24 22:33:21 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/math/psMinimize.c
r2438 r2439 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.9 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-11-24 22: 22:38$11 * @version $Revision: 1.91 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-11-24 22:33:21 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/math/psPolynomial.c
r2433 r2439 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1. 69$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-11-24 2 1:59:43$9 * @version $Revision: 1.70 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-11-24 22:33:21 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 2112 2112 the spline fit functions require F32 and F64. 2113 2113 *****************************************************************************/ 2114 float psSpline1DEval(const psSpline1D *spline, 2115 float x) 2114 float psSpline1DEval( 2115 float x, 2116 const psSpline1D *spline 2117 ) 2116 2118 { 2117 2119 PS_PTR_CHECK_NULL(spline, NAN); … … 2144 2146 // XXX: The spline eval functions require input and output to be F32. 2145 2147 // however the spline fit functions require F32 and F64. 2146 psVector *psSpline1DEvalVector(const psVector *x, 2147 const psSpline1D *spline) 2148 psVector *psSpline1DEvalVector( 2149 const psSpline1D *spline, 2150 const psVector *x 2151 ) 2148 2152 { 2149 2153 PS_PTR_CHECK_NULL(spline, NULL); … … 2157 2161 if (x->type.type == PS_TYPE_F32) { 2158 2162 for (i=0;i<x->n;i++) { 2159 tmpVector->data.F32[i] = psSpline1DEval(spline, x->data.F32[i]); 2163 tmpVector->data.F32[i] = psSpline1DEval( 2164 x->data.F32[i], 2165 spline 2166 ); 2160 2167 } 2161 2168 } else if (x->type.type == PS_TYPE_F64) { 2162 2169 for (i=0;i<x->n;i++) { 2163 tmpVector->data.F32[i] = psSpline1DEval(spline, (float) x->data.F64[i]); 2170 tmpVector->data.F32[i] = psSpline1DEval( 2171 (float) x->data.F64[i], 2172 spline 2173 ); 2164 2174 } 2165 2175 } else { -
trunk/psLib/src/math/psPolynomial.h
r2433 r2439 12 12 * @author George Gusciora, MHPCC 13 13 * 14 * @version $Revision: 1.3 5$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-11-24 2 1:59:43$14 * @version $Revision: 1.36 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-11-24 22:33:21 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 409 409 psS32 order); 410 410 411 float psSpline1DEval(const psSpline1D *spline, 412 float x); 413 414 psVector *psSpline1DEvalVector(const psVector *x, 415 const psSpline1D *spline); 411 float psSpline1DEval( 412 float x, 413 const psSpline1D *spline 414 ); 415 416 psVector *psSpline1DEvalVector( 417 const psSpline1D *spline, 418 const psVector *x 419 ); 416 420 417 421 psS32 p_psVectorBinDisect(psVector *bins, -
trunk/psLib/src/math/psSpline.c
r2433 r2439 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1. 69$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-11-24 2 1:59:43$9 * @version $Revision: 1.70 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-11-24 22:33:21 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 2112 2112 the spline fit functions require F32 and F64. 2113 2113 *****************************************************************************/ 2114 float psSpline1DEval(const psSpline1D *spline, 2115 float x) 2114 float psSpline1DEval( 2115 float x, 2116 const psSpline1D *spline 2117 ) 2116 2118 { 2117 2119 PS_PTR_CHECK_NULL(spline, NAN); … … 2144 2146 // XXX: The spline eval functions require input and output to be F32. 2145 2147 // however the spline fit functions require F32 and F64. 2146 psVector *psSpline1DEvalVector(const psVector *x, 2147 const psSpline1D *spline) 2148 psVector *psSpline1DEvalVector( 2149 const psSpline1D *spline, 2150 const psVector *x 2151 ) 2148 2152 { 2149 2153 PS_PTR_CHECK_NULL(spline, NULL); … … 2157 2161 if (x->type.type == PS_TYPE_F32) { 2158 2162 for (i=0;i<x->n;i++) { 2159 tmpVector->data.F32[i] = psSpline1DEval(spline, x->data.F32[i]); 2163 tmpVector->data.F32[i] = psSpline1DEval( 2164 x->data.F32[i], 2165 spline 2166 ); 2160 2167 } 2161 2168 } else if (x->type.type == PS_TYPE_F64) { 2162 2169 for (i=0;i<x->n;i++) { 2163 tmpVector->data.F32[i] = psSpline1DEval(spline, (float) x->data.F64[i]); 2170 tmpVector->data.F32[i] = psSpline1DEval( 2171 (float) x->data.F64[i], 2172 spline 2173 ); 2164 2174 } 2165 2175 } else { -
trunk/psLib/src/math/psSpline.h
r2433 r2439 12 12 * @author George Gusciora, MHPCC 13 13 * 14 * @version $Revision: 1.3 5$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-11-24 2 1:59:43$14 * @version $Revision: 1.36 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-11-24 22:33:21 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 409 409 psS32 order); 410 410 411 float psSpline1DEval(const psSpline1D *spline, 412 float x); 413 414 psVector *psSpline1DEvalVector(const psVector *x, 415 const psSpline1D *spline); 411 float psSpline1DEval( 412 float x, 413 const psSpline1D *spline 414 ); 415 416 psVector *psSpline1DEvalVector( 417 const psSpline1D *spline, 418 const psVector *x 419 ); 416 420 417 421 psS32 p_psVectorBinDisect(psVector *bins, -
trunk/psLib/test/dataManip/tst_psFunc04.c
r2392 r2439 46 46 for (i=0;i<N+1;i++) { 47 47 x = 0.5 + (float) i+1; 48 y = psSpline1DEval(tmpSpline, x); 48 y = psSpline1DEval( 49 x, 50 tmpSpline 51 ); 49 52 if (fabs(x-y) > FLT_EPSILON) { 50 53 printf("ERROR: f(%f) is %f\n", x, y); … … 98 101 for (i=0;i<N+1;i++) { 99 102 x = 0.5 + (float) i+1; 100 y = psSpline1DEval(tmpSpline, x); 103 y = psSpline1DEval( 104 x, 105 tmpSpline 106 ); 101 107 if (fabs(x-y) > FLT_EPSILON) { 102 108 printf("ERROR: f(%f) is %f\n", x, y); -
trunk/psLib/test/dataManip/tst_psFunc05.c
r2392 r2439 50 50 } 51 51 52 y = psSpline1DEvalVector(x, tmpSpline); 52 y = psSpline1DEvalVector( 53 tmpSpline, 54 x 55 ); 53 56 54 57 for (i=0;i<N+1;i++) { -
trunk/psLib/test/dataManip/tst_psFunc07.c
r2392 r2439 70 70 71 71 psVectorFitSpline1D(tmpSpline, x, y, NULL); 72 newY = psSpline1DEvalVector(newX, tmpSpline); 72 newY = psSpline1DEvalVector( 73 tmpSpline, 74 newX 75 ); 73 76 74 77 for (i=OFFSET;i<NUM_SPLINES-OFFSET+1;i++) { … … 139 142 140 143 psVectorFitSpline1D(tmpSpline, x, y, NULL); 141 newY = psSpline1DEvalVector(newX, tmpSpline); 144 newY = psSpline1DEvalVector( 145 tmpSpline, 146 newX 147 ); 142 148 143 149 for (i=OFFSET;i<NUM_SPLINES-OFFSET+1;i++) {
Note:
See TracChangeset
for help on using the changeset viewer.
