Changeset 3096
- Timestamp:
- Jan 26, 2005, 10:41:04 AM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 13 edited
-
src/dataManip/psFunctions.c (modified) (7 diffs)
-
src/dataManip/psFunctions.h (modified) (2 diffs)
-
src/dataManip/psMinimize.c (modified) (6 diffs)
-
src/math/psMinimize.c (modified) (6 diffs)
-
src/math/psPolynomial.c (modified) (7 diffs)
-
src/math/psPolynomial.h (modified) (2 diffs)
-
src/math/psSpline.c (modified) (7 diffs)
-
src/math/psSpline.h (modified) (2 diffs)
-
test/dataManip/tst_psFunc02.c (modified) (5 diffs)
-
test/dataManip/tst_psFunc03.c (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
r3027 r3096 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.8 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-01- 17 23:25:09$9 * @version $Revision: 1.84 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-01-26 20:41:04 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 92 92 psFree(tmpSpline->p_psDeriv2); 93 93 } 94 psFree(tmpSpline-> domains);94 psFree(tmpSpline->knots); 95 95 96 96 return; … … 1833 1833 // psPolynomial1D **spline; 1834 1834 // psF32 *p_psDeriv2; 1835 // ps F32 *domains;1835 // psVector *knots; 1836 1836 //} psSpline1D; 1837 1837 1838 1838 /***************************************************************************** 1839 1839 NOTE: "n" specifies the number of spline polynomials. Therefore, there 1840 must exist n+1 points in " domains".1840 must exist n+1 points in "knots". 1841 1841 1842 1842 XXX: Ensure that domain[i+1] != domain[i] … … 1867 1867 tmp->p_psDeriv2 = NULL; 1868 1868 1869 tmp-> domains = (psF32 *) psAlloc((numSplines+1) * sizeof(psF32));1869 tmp->knots = psVectorAlloc(numSplines+1, PS_TYPE_F32); 1870 1870 width = (max - min) / ((psF32) numSplines); 1871 1871 1872 (tmp->domains)[0] = min;1872 tmp->knots->data.F32[0] = min; 1873 1873 tmpDomain = min+width; 1874 1874 for (i=1;i<numSplines+1;i++) { 1875 (tmp->domains)[i] = tmpDomain;1875 tmp->knots->data.F32[i] = tmpDomain; 1876 1876 tmpDomain+= width; 1877 1877 } 1878 (tmp->domains)[numSplines] = max;1878 tmp->knots->data.F32[numSplines] = max; 1879 1879 1880 1880 p_psMemSetDeallocator(tmp,(psFreeFcn)spline1DFree); … … 1909 1909 tmp->p_psDeriv2 = NULL; 1910 1910 1911 tmp-> domains = (psF32 *) psAlloc((bounds->n) * sizeof(psF32));1911 tmp->knots = psVectorAlloc(bounds->n, PS_TYPE_F32); 1912 1912 1913 1913 for (i=0;i<bounds->n;i++) { 1914 (tmp->domains)[i] = bounds->data.F32[i];1914 tmp->knots->data.F32[i] = bounds->data.F32[i]; 1915 1915 if (i<(bounds->n-1)) { 1916 1916 if (FLT_EPSILON >= fabs(bounds->data.F32[i+1]-bounds->data.F32[i])) { … … 2136 2136 psSpline1DEval(): this routine takes an existing spline of arbitrary order 2137 2137 and an independent x value. Each determines which spline that x corresponds 2138 to by doing a bracket disection on the domains of the spline data structure2138 to by doing a bracket disection on the knots of the spline data structure 2139 2139 (vectorBinDisectF32()). Then it evaluates the spline at that x location 2140 2140 by a call to the 1D polynomial functions. … … 2155 2155 2156 2156 n = spline->n; 2157 binNum = vectorBinDisectF32(spline->domains, (spline->n)+1, x); 2157 //XXX binNum = vectorBinDisectF32(spline->domains, (spline->n)+1, x); 2158 binNum = vectorBinDisectF32(spline->knots->data.F32, (spline->n)+1, x); 2158 2159 if (binNum < 0) { 2159 2160 psLogMsg(__func__, PS_LOG_WARN, 2160 2161 "psSpline1DEval(): x ordinate (%f) is outside the spline range (%f - %f).", 2161 x, (spline->domains)[0],2162 (spline->domains)[n-1]);2163 2164 if (x < (spline->domains)[0]) {2162 x, spline->knots->data.F32[0], 2163 spline->knots->data.F32[n-1]); 2164 2165 if (x < spline->knots->data.F32[0]) { 2165 2166 return(psPolynomial1DEval(spline->spline[0], 2166 2167 x)); 2167 } else if (x > (spline->domains)[n-1]) {2168 } else if (x > spline->knots->data.F32[n-1]) { 2168 2169 return(psPolynomial1DEval(spline->spline[n-1], 2169 2170 x)); -
trunk/psLib/src/dataManip/psFunctions.h
r2847 r3096 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1. 39$ $Name: not supported by cvs2svn $15 * @date $Date: 200 4-12-29 22:15:51$14 * @version $Revision: 1.40 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-01-26 20:41:04 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 394 394 typedef struct 395 395 { 396 psS32 n; ///< The number of spline polynomials 397 psPolynomial1D **spline; ///< An array of n pointers to the spline polynomials 398 psF32 *p_psDeriv2; ///< For cubic splines, the second derivative at each domain point. Size is n+1. 399 psF32 *domains; ///< The boundaries between each spline piece. Size is n+1. 396 psS32 n; ///< The number of spline polynomials 397 psPolynomial1D **spline; ///< An array of n pointers to the spline polynomials 398 psF32 *p_psDeriv2; ///< For cubic splines, the second derivative at each domain point. Size is n+1. 399 psF32 *domains; ///< The boundaries between each spline piece. Size is n+1. 400 psVector *knots; ///< The boundaries between each spline piece. Size is n+1. 400 401 } 401 402 psSpline1D; -
trunk/psLib/src/dataManip/psMinimize.c
r3027 r3096 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.10 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-01- 17 23:25:09$11 * @version $Revision: 1.102 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-01-26 20:41:04 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 171 171 PS_PTR_CHECK_NULL(spline, NAN); 172 172 PS_INT_CHECK_NON_NEGATIVE(spline->n, NAN); 173 PS_ PTR_CHECK_NULL(spline->domains, NAN);173 PS_VECTOR_CHECK_NULL(spline->domains, NAN); 174 174 PS_PTR_CHECK_NULL(spline->p_psDeriv2, NAN); 175 175 PS_VECTOR_CHECK_NULL(x, NAN); … … 189 189 190 190 n = spline->n; 191 klo = p_psVectorBinDisect32(spline-> domains, (spline->n)+1, X);191 klo = p_psVectorBinDisect32(spline->knots->data.F32, (spline->n)+1, X); 192 192 if (klo < 0) { 193 193 psLogMsg(__func__, PS_LOG_WARN, … … 196 196 } 197 197 khi = klo + 1; 198 H = (spline->domains)[khi] - (spline->domains)[klo];199 A = ( (spline->domains)[khi] - X) / H;200 B = (X - (spline->domains)[klo]) / H;198 H = spline->knots->data.F32[khi] - spline->knots->data.F32[klo]; 199 A = (spline->knots->data.F32[khi] - X) / H; 200 B = (X - spline->knots->data.F32[klo]) / H; 201 201 C = ((A*A*A)-A) * (H*H/6.0); 202 202 D = ((B*B*B)-B) * (H*H/6.0); … … 236 236 237 237 XXX: Is the x argument redundant? What do we do if the x argument is 238 supplied, but does not equal the domains specified in mySpline?238 supplied, but does not equal the knots specified in mySpline? 239 239 240 240 XXX: can psSpline be NULL? … … 314 314 for (i=0;i<mySpline->n;i++) { 315 315 slope = (y32->data.F32[i+1] - y32->data.F32[i]) / 316 (mySpline-> domains[i+1] - mySpline->domains[i]);316 (mySpline->knots->data.F32[i+1] - mySpline->knots->data.F32[i]); 317 317 (mySpline->spline[i])->coeff[0] = y32->data.F32[i] - 318 (slope * mySpline-> domains[i]);318 (slope * mySpline->knots->data.F32[i]); 319 319 320 320 (mySpline->spline[i])->coeff[1] = slope; -
trunk/psLib/src/math/psMinimize.c
r3027 r3096 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.10 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-01- 17 23:25:09$11 * @version $Revision: 1.102 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-01-26 20:41:04 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 171 171 PS_PTR_CHECK_NULL(spline, NAN); 172 172 PS_INT_CHECK_NON_NEGATIVE(spline->n, NAN); 173 PS_ PTR_CHECK_NULL(spline->domains, NAN);173 PS_VECTOR_CHECK_NULL(spline->domains, NAN); 174 174 PS_PTR_CHECK_NULL(spline->p_psDeriv2, NAN); 175 175 PS_VECTOR_CHECK_NULL(x, NAN); … … 189 189 190 190 n = spline->n; 191 klo = p_psVectorBinDisect32(spline-> domains, (spline->n)+1, X);191 klo = p_psVectorBinDisect32(spline->knots->data.F32, (spline->n)+1, X); 192 192 if (klo < 0) { 193 193 psLogMsg(__func__, PS_LOG_WARN, … … 196 196 } 197 197 khi = klo + 1; 198 H = (spline->domains)[khi] - (spline->domains)[klo];199 A = ( (spline->domains)[khi] - X) / H;200 B = (X - (spline->domains)[klo]) / H;198 H = spline->knots->data.F32[khi] - spline->knots->data.F32[klo]; 199 A = (spline->knots->data.F32[khi] - X) / H; 200 B = (X - spline->knots->data.F32[klo]) / H; 201 201 C = ((A*A*A)-A) * (H*H/6.0); 202 202 D = ((B*B*B)-B) * (H*H/6.0); … … 236 236 237 237 XXX: Is the x argument redundant? What do we do if the x argument is 238 supplied, but does not equal the domains specified in mySpline?238 supplied, but does not equal the knots specified in mySpline? 239 239 240 240 XXX: can psSpline be NULL? … … 314 314 for (i=0;i<mySpline->n;i++) { 315 315 slope = (y32->data.F32[i+1] - y32->data.F32[i]) / 316 (mySpline-> domains[i+1] - mySpline->domains[i]);316 (mySpline->knots->data.F32[i+1] - mySpline->knots->data.F32[i]); 317 317 (mySpline->spline[i])->coeff[0] = y32->data.F32[i] - 318 (slope * mySpline-> domains[i]);318 (slope * mySpline->knots->data.F32[i]); 319 319 320 320 (mySpline->spline[i])->coeff[1] = slope; -
trunk/psLib/src/math/psPolynomial.c
r3027 r3096 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.8 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-01- 17 23:25:09$9 * @version $Revision: 1.84 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-01-26 20:41:04 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 92 92 psFree(tmpSpline->p_psDeriv2); 93 93 } 94 psFree(tmpSpline-> domains);94 psFree(tmpSpline->knots); 95 95 96 96 return; … … 1833 1833 // psPolynomial1D **spline; 1834 1834 // psF32 *p_psDeriv2; 1835 // ps F32 *domains;1835 // psVector *knots; 1836 1836 //} psSpline1D; 1837 1837 1838 1838 /***************************************************************************** 1839 1839 NOTE: "n" specifies the number of spline polynomials. Therefore, there 1840 must exist n+1 points in " domains".1840 must exist n+1 points in "knots". 1841 1841 1842 1842 XXX: Ensure that domain[i+1] != domain[i] … … 1867 1867 tmp->p_psDeriv2 = NULL; 1868 1868 1869 tmp-> domains = (psF32 *) psAlloc((numSplines+1) * sizeof(psF32));1869 tmp->knots = psVectorAlloc(numSplines+1, PS_TYPE_F32); 1870 1870 width = (max - min) / ((psF32) numSplines); 1871 1871 1872 (tmp->domains)[0] = min;1872 tmp->knots->data.F32[0] = min; 1873 1873 tmpDomain = min+width; 1874 1874 for (i=1;i<numSplines+1;i++) { 1875 (tmp->domains)[i] = tmpDomain;1875 tmp->knots->data.F32[i] = tmpDomain; 1876 1876 tmpDomain+= width; 1877 1877 } 1878 (tmp->domains)[numSplines] = max;1878 tmp->knots->data.F32[numSplines] = max; 1879 1879 1880 1880 p_psMemSetDeallocator(tmp,(psFreeFcn)spline1DFree); … … 1909 1909 tmp->p_psDeriv2 = NULL; 1910 1910 1911 tmp-> domains = (psF32 *) psAlloc((bounds->n) * sizeof(psF32));1911 tmp->knots = psVectorAlloc(bounds->n, PS_TYPE_F32); 1912 1912 1913 1913 for (i=0;i<bounds->n;i++) { 1914 (tmp->domains)[i] = bounds->data.F32[i];1914 tmp->knots->data.F32[i] = bounds->data.F32[i]; 1915 1915 if (i<(bounds->n-1)) { 1916 1916 if (FLT_EPSILON >= fabs(bounds->data.F32[i+1]-bounds->data.F32[i])) { … … 2136 2136 psSpline1DEval(): this routine takes an existing spline of arbitrary order 2137 2137 and an independent x value. Each determines which spline that x corresponds 2138 to by doing a bracket disection on the domains of the spline data structure2138 to by doing a bracket disection on the knots of the spline data structure 2139 2139 (vectorBinDisectF32()). Then it evaluates the spline at that x location 2140 2140 by a call to the 1D polynomial functions. … … 2155 2155 2156 2156 n = spline->n; 2157 binNum = vectorBinDisectF32(spline->domains, (spline->n)+1, x); 2157 //XXX binNum = vectorBinDisectF32(spline->domains, (spline->n)+1, x); 2158 binNum = vectorBinDisectF32(spline->knots->data.F32, (spline->n)+1, x); 2158 2159 if (binNum < 0) { 2159 2160 psLogMsg(__func__, PS_LOG_WARN, 2160 2161 "psSpline1DEval(): x ordinate (%f) is outside the spline range (%f - %f).", 2161 x, (spline->domains)[0],2162 (spline->domains)[n-1]);2163 2164 if (x < (spline->domains)[0]) {2162 x, spline->knots->data.F32[0], 2163 spline->knots->data.F32[n-1]); 2164 2165 if (x < spline->knots->data.F32[0]) { 2165 2166 return(psPolynomial1DEval(spline->spline[0], 2166 2167 x)); 2167 } else if (x > (spline->domains)[n-1]) {2168 } else if (x > spline->knots->data.F32[n-1]) { 2168 2169 return(psPolynomial1DEval(spline->spline[n-1], 2169 2170 x)); -
trunk/psLib/src/math/psPolynomial.h
r2847 r3096 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1. 39$ $Name: not supported by cvs2svn $15 * @date $Date: 200 4-12-29 22:15:51$14 * @version $Revision: 1.40 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-01-26 20:41:04 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 394 394 typedef struct 395 395 { 396 psS32 n; ///< The number of spline polynomials 397 psPolynomial1D **spline; ///< An array of n pointers to the spline polynomials 398 psF32 *p_psDeriv2; ///< For cubic splines, the second derivative at each domain point. Size is n+1. 399 psF32 *domains; ///< The boundaries between each spline piece. Size is n+1. 396 psS32 n; ///< The number of spline polynomials 397 psPolynomial1D **spline; ///< An array of n pointers to the spline polynomials 398 psF32 *p_psDeriv2; ///< For cubic splines, the second derivative at each domain point. Size is n+1. 399 psF32 *domains; ///< The boundaries between each spline piece. Size is n+1. 400 psVector *knots; ///< The boundaries between each spline piece. Size is n+1. 400 401 } 401 402 psSpline1D; -
trunk/psLib/src/math/psSpline.c
r3027 r3096 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.8 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-01- 17 23:25:09$9 * @version $Revision: 1.84 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-01-26 20:41:04 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 92 92 psFree(tmpSpline->p_psDeriv2); 93 93 } 94 psFree(tmpSpline-> domains);94 psFree(tmpSpline->knots); 95 95 96 96 return; … … 1833 1833 // psPolynomial1D **spline; 1834 1834 // psF32 *p_psDeriv2; 1835 // ps F32 *domains;1835 // psVector *knots; 1836 1836 //} psSpline1D; 1837 1837 1838 1838 /***************************************************************************** 1839 1839 NOTE: "n" specifies the number of spline polynomials. Therefore, there 1840 must exist n+1 points in " domains".1840 must exist n+1 points in "knots". 1841 1841 1842 1842 XXX: Ensure that domain[i+1] != domain[i] … … 1867 1867 tmp->p_psDeriv2 = NULL; 1868 1868 1869 tmp-> domains = (psF32 *) psAlloc((numSplines+1) * sizeof(psF32));1869 tmp->knots = psVectorAlloc(numSplines+1, PS_TYPE_F32); 1870 1870 width = (max - min) / ((psF32) numSplines); 1871 1871 1872 (tmp->domains)[0] = min;1872 tmp->knots->data.F32[0] = min; 1873 1873 tmpDomain = min+width; 1874 1874 for (i=1;i<numSplines+1;i++) { 1875 (tmp->domains)[i] = tmpDomain;1875 tmp->knots->data.F32[i] = tmpDomain; 1876 1876 tmpDomain+= width; 1877 1877 } 1878 (tmp->domains)[numSplines] = max;1878 tmp->knots->data.F32[numSplines] = max; 1879 1879 1880 1880 p_psMemSetDeallocator(tmp,(psFreeFcn)spline1DFree); … … 1909 1909 tmp->p_psDeriv2 = NULL; 1910 1910 1911 tmp-> domains = (psF32 *) psAlloc((bounds->n) * sizeof(psF32));1911 tmp->knots = psVectorAlloc(bounds->n, PS_TYPE_F32); 1912 1912 1913 1913 for (i=0;i<bounds->n;i++) { 1914 (tmp->domains)[i] = bounds->data.F32[i];1914 tmp->knots->data.F32[i] = bounds->data.F32[i]; 1915 1915 if (i<(bounds->n-1)) { 1916 1916 if (FLT_EPSILON >= fabs(bounds->data.F32[i+1]-bounds->data.F32[i])) { … … 2136 2136 psSpline1DEval(): this routine takes an existing spline of arbitrary order 2137 2137 and an independent x value. Each determines which spline that x corresponds 2138 to by doing a bracket disection on the domains of the spline data structure2138 to by doing a bracket disection on the knots of the spline data structure 2139 2139 (vectorBinDisectF32()). Then it evaluates the spline at that x location 2140 2140 by a call to the 1D polynomial functions. … … 2155 2155 2156 2156 n = spline->n; 2157 binNum = vectorBinDisectF32(spline->domains, (spline->n)+1, x); 2157 //XXX binNum = vectorBinDisectF32(spline->domains, (spline->n)+1, x); 2158 binNum = vectorBinDisectF32(spline->knots->data.F32, (spline->n)+1, x); 2158 2159 if (binNum < 0) { 2159 2160 psLogMsg(__func__, PS_LOG_WARN, 2160 2161 "psSpline1DEval(): x ordinate (%f) is outside the spline range (%f - %f).", 2161 x, (spline->domains)[0],2162 (spline->domains)[n-1]);2163 2164 if (x < (spline->domains)[0]) {2162 x, spline->knots->data.F32[0], 2163 spline->knots->data.F32[n-1]); 2164 2165 if (x < spline->knots->data.F32[0]) { 2165 2166 return(psPolynomial1DEval(spline->spline[0], 2166 2167 x)); 2167 } else if (x > (spline->domains)[n-1]) {2168 } else if (x > spline->knots->data.F32[n-1]) { 2168 2169 return(psPolynomial1DEval(spline->spline[n-1], 2169 2170 x)); -
trunk/psLib/src/math/psSpline.h
r2847 r3096 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1. 39$ $Name: not supported by cvs2svn $15 * @date $Date: 200 4-12-29 22:15:51$14 * @version $Revision: 1.40 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-01-26 20:41:04 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 394 394 typedef struct 395 395 { 396 psS32 n; ///< The number of spline polynomials 397 psPolynomial1D **spline; ///< An array of n pointers to the spline polynomials 398 psF32 *p_psDeriv2; ///< For cubic splines, the second derivative at each domain point. Size is n+1. 399 psF32 *domains; ///< The boundaries between each spline piece. Size is n+1. 396 psS32 n; ///< The number of spline polynomials 397 psPolynomial1D **spline; ///< An array of n pointers to the spline polynomials 398 psF32 *p_psDeriv2; ///< For cubic splines, the second derivative at each domain point. Size is n+1. 399 psF32 *domains; ///< The boundaries between each spline piece. Size is n+1. 400 psVector *knots; ///< The boundaries between each spline piece. Size is n+1. 400 401 } 401 402 psSpline1D; -
trunk/psLib/test/dataManip/tst_psFunc02.c
r2730 r3096 56 56 } 57 57 58 if (tmpSpline-> domains == NULL) {59 printf("ERROR: Could not allocate psSpline1D-> domains data structure\n");58 if (tmpSpline->knots == NULL) { 59 printf("ERROR: Could not allocate psSpline1D->knots data structure\n"); 60 60 testStatus = false; 61 61 } 62 62 63 63 for (i=0;i<N+1;i++) { 64 printf("psSpline1D->domains[%d] is %f\n", i, tmpSpline->domains[i]); 64 printf("psSpline1D->knots->data.F32[%d] is %f\n", i, 65 tmpSpline->knots->data.F32[i]); 65 66 } 66 67 … … 137 138 } 138 139 139 if (tmpSpline-> domains == NULL) {140 printf("ERROR: Could not allocate psSpline1D-> domains data structure\n");140 if (tmpSpline->knots == NULL) { 141 printf("ERROR: Could not allocate psSpline1D->knots data structure\n"); 141 142 testStatus = false; 142 143 } 143 144 144 145 for (i=0;i<N+1;i++) { 145 printf("psSpline1D->domains[%d] is %f\n", i, tmpSpline->domains[i]); 146 printf("psSpline1D->knots->data.F32[%d] is %f\n", i, 147 tmpSpline->knots->data.F32[i]); 146 148 } 147 149 … … 191 193 } 192 194 193 if (tmpSpline-> domains == NULL) {194 printf("ERROR: Could not allocate psSpline1D-> domains data structure\n");195 if (tmpSpline->knots == NULL) { 196 printf("ERROR: Could not allocate psSpline1D->knots data structure\n"); 195 197 testStatus = false; 196 198 } 197 199 198 200 for (i=0;i<N+1;i++) { 199 printf("psSpline1D->domains[%d] is %f\n", i, tmpSpline->domains[i]); 201 printf("psSpline1D->data.F32[%d] is %f\n", i, 202 tmpSpline->knots->data.F32[i]); 200 203 } 201 204 … … 272 275 } 273 276 274 if (tmpSpline-> domains == NULL) {275 printf("ERROR: Could not allocate psSpline1D-> domains data structure\n");277 if (tmpSpline->knots == NULL) { 278 printf("ERROR: Could not allocate psSpline1D->knots data structure\n"); 276 279 testStatus = false; 277 280 } 278 281 279 282 for (i=0;i<N+1;i++) { 280 printf("psSpline1D->domains[%d] is %f\n", i, tmpSpline->domains[i]); 283 printf("psSpline1D->knots->data.F32[%d] is %f\n", i, 284 tmpSpline->knots->data.F32[i]); 281 285 } 282 286 … … 331 335 } 332 336 333 if (tmpSpline-> domains == NULL) {334 printf("ERROR: Could not allocate psSpline1D-> domains data structure\n");337 if (tmpSpline->knots == NULL) { 338 printf("ERROR: Could not allocate psSpline1D->knots data structure\n"); 335 339 testStatus = false; 336 340 } 337 341 338 342 for (i=0;i<N+1;i++) { 339 printf("psSpline1D->domains[%d] is %f\n", i, tmpSpline->domains[i]); 343 printf("psSpline1D->knots->data.F32[%d] is %f\n", i, 344 tmpSpline->knots->data.F32[i]); 340 345 } 341 346 psFree(bounds); -
trunk/psLib/test/dataManip/tst_psFunc03.c
r2392 r3096 61 61 } 62 62 63 if (tmpSpline-> domains == NULL) {64 printf("ERROR: Could not allocate psSpline1D-> domains data structure\n");63 if (tmpSpline->knots == NULL) { 64 printf("ERROR: Could not allocate psSpline1D->knots data structure\n"); 65 65 testStatus = false; 66 66 } 67 67 68 68 for (i=0;i<N+1;i++) { 69 if (tmpSpline->domains[i] != bounds->data.F32[i]) { 70 printf("ERROR: psSpline1D->domains[%d] is %f\n", i, tmpSpline->domains[i]); 69 if (tmpSpline->knots->data.F32[i] != bounds->data.F32[i]) { 70 printf("ERROR: psSpline1D->knots->data.F32[%d] is %f\n", i, 71 tmpSpline->knots->data.F32[i]); 71 72 } 72 73 } … … 121 122 } 122 123 123 if (tmpSpline-> domains == NULL) {124 printf("ERROR: Could not allocate psSpline1D-> domains data structure\n");124 if (tmpSpline->knots == NULL) { 125 printf("ERROR: Could not allocate psSpline1D->knots data structure\n"); 125 126 testStatus = false; 126 127 } 127 128 128 129 for (i=0;i<N+1;i++) { 129 if (tmpSpline->domains[i] != bounds->data.F32[i]) { 130 printf("ERROR: psSpline1D->domains[%d] is %f\n", i, tmpSpline->domains[i]); 130 if (tmpSpline->knots->data.F32[i] != bounds->data.F32[i]) { 131 printf("ERROR: psSpline1D->knots->data.F32[%d] is %f\n", i, 132 tmpSpline->knots->data.F32[i]); 131 133 } 132 134 } -
trunk/psLib/test/dataManip/tst_psFunc04.c
r2846 r3096 40 40 41 41 for (i=0;i<N+1;i++) { 42 data->data.F32[i] = tmpSpline-> domains[i];42 data->data.F32[i] = tmpSpline->knots->data.F32[i]; 43 43 } 44 44 psVectorFitSpline1D(tmpSpline, data, data, NULL); … … 95 95 96 96 for (i=0;i<N+1;i++) { 97 data->data.F32[i] = tmpSpline-> domains[i];97 data->data.F32[i] = tmpSpline->knots->data.F32[i]; 98 98 } 99 99 psVectorFitSpline1D(tmpSpline, data, data, NULL); -
trunk/psLib/test/dataManip/tst_psFunc05.c
r2439 r3096 41 41 42 42 for (i=0;i<N+1;i++) { 43 data->data.F32[i] = tmpSpline-> domains[i];43 data->data.F32[i] = tmpSpline->knots->data.F32[i]; 44 44 } 45 45 -
trunk/psLib/test/dataManip/tst_psFunc07.c
r2439 r3096 54 54 55 55 for (i=0;i<NUM_SPLINES+1;i++) { 56 x->data.F32[i] = tmpSpline-> domains[i];56 x->data.F32[i] = tmpSpline->knots->data.F32[i]; 57 57 y->data.F32[i] = myFunc(x->data.F32[i]); 58 58 } … … 126 126 127 127 for (i=0;i<NUM_SPLINES+1;i++) { 128 x->data.F64[i] = tmpSpline-> domains[i];128 x->data.F64[i] = tmpSpline->knots->data.F32[i]; 129 129 y->data.F64[i] = myFunc(x->data.F64[i]); 130 130 }
Note:
See TracChangeset
for help on using the changeset viewer.
