Changeset 4567
- Timestamp:
- Jul 15, 2005, 1:19:41 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psFunctions.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psFunctions.c
r4540 r4567 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-07-1 2 19:12:01 $9 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-07-15 23:19:41 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1873 1873 PS_ASSERT_INT_NONNEGATIVE(order, NULL); 1874 1874 1875 psSpline1D *tmp = NULL;1875 psSpline1D *tmpSpline = NULL; 1876 1876 unsigned int i; 1877 1877 unsigned int numSplines; 1878 1878 1879 tmp = (psSpline1D *) psAlloc(sizeof(psSpline1D));1879 tmpSpline = (psSpline1D *) psAlloc(sizeof(psSpline1D)); 1880 1880 1881 1881 numSplines = bounds->n - 1; 1882 tmp ->n = numSplines;1883 1884 tmp ->spline = (psPolynomial1D **) psAlloc(numSplines * sizeof(psPolynomial1D *));1882 tmpSpline->n = numSplines; 1883 1884 tmpSpline->spline = (psPolynomial1D **) psAlloc(numSplines * sizeof(psPolynomial1D *)); 1885 1885 for (i=0;i<numSplines;i++) { 1886 (tmp ->spline)[i] = psPolynomial1DAlloc(order+1, PS_POLYNOMIAL_ORD);1886 (tmpSpline->spline)[i] = psPolynomial1DAlloc(order+1, PS_POLYNOMIAL_ORD); 1887 1887 } 1888 1888 1889 1889 // This should be set by the psVectorFitSpline1D() 1890 tmp ->p_psDeriv2 = NULL;1891 1892 tmp ->knots = psVectorAlloc(bounds->n, PS_TYPE_F32);1890 tmpSpline->p_psDeriv2 = NULL; 1891 1892 tmpSpline->knots = psVectorAlloc(bounds->n, PS_TYPE_F32); 1893 1893 1894 1894 for (i=0;i<bounds->n;i++) { 1895 tmp ->knots->data.F32[i] = bounds->data.F32[i];1895 tmpSpline->knots->data.F32[i] = bounds->data.F32[i]; 1896 1896 if (i<(bounds->n-1)) { 1897 1897 if (FLT_EPSILON >= fabs(bounds->data.F32[i+1]-bounds->data.F32[i])) { … … 1901 1901 } 1902 1902 1903 psMemSetDeallocator(tmp ,(psFreeFunc)spline1DFree);1904 return(tmp );1903 psMemSetDeallocator(tmpSpline,(psFreeFunc)spline1DFree); 1904 return(tmpSpline); 1905 1905 } 1906 1906
Note:
See TracChangeset
for help on using the changeset viewer.
