Changeset 4898 for trunk/psLib/src/math
- Timestamp:
- Aug 29, 2005, 3:14:13 PM (21 years ago)
- Location:
- trunk/psLib/src/math
- Files:
-
- 6 edited
-
psFunctions.c (modified) (2 diffs)
-
psFunctions.h (modified) (2 diffs)
-
psMinimize.c (modified) (4 diffs)
-
psMinimize.h (modified) (2 diffs)
-
psStats.c (modified) (5 diffs)
-
psStats.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psFunctions.c
r4876 r4898 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-08- 25 22:52:29$9 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-08-30 01:14:13 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 871 871 return(newPoly); 872 872 } 873 874 875 bool psMemCheckPolynomial1D(psPtr ptr) 876 { 877 return ( psMemGetDeallocator(ptr) == (psFreeFunc)polynomial1DFree ); 878 } 879 880 bool psMemCheckPolynomial2D(psPtr ptr) 881 { 882 return ( psMemGetDeallocator(ptr) == (psFreeFunc)polynomial2DFree ); 883 } 884 885 bool psMemCheckPolynomial3D(psPtr ptr) 886 { 887 return ( psMemGetDeallocator(ptr) == (psFreeFunc)polynomial3DFree ); 888 } 889 890 bool psMemCheckPolynomial4D(psPtr ptr) 891 { 892 return ( psMemGetDeallocator(ptr) == (psFreeFunc)polynomial4DFree ); 893 } 894 895 bool psMemCheckSpline1D(psPtr ptr) 896 { 897 return ( psMemGetDeallocator(ptr) == (psFreeFunc)spline1DFree ); 898 } 899 873 900 874 901 psF64 psPolynomial1DEval(const psPolynomial1D* poly, psF64 x) -
trunk/psLib/src/math/psFunctions.h
r4581 r4898 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 7-20 01:21:13 $14 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-08-30 01:14:13 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 163 163 ); 164 164 165 /** Checks the type of a particular pointer. 166 * 167 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 168 * 169 * @return bool: True if the pointer matches a psPolynomial1D structure, false otherwise. 170 */ 171 bool psMemCheckPolynomial1D( 172 psPtr ptr ///< the pointer whose type to check 173 ); 174 175 /** Checks the type of a particular pointer. 176 * 177 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 178 * 179 * @return bool: True if the pointer matches a psPolynomial2D structure, false otherwise. 180 */ 181 bool psMemCheckPolynomial2D( 182 psPtr ptr ///< the pointer whose type to check 183 ); 184 185 /** Checks the type of a particular pointer. 186 * 187 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 188 * 189 * @return bool: True if the pointer matches a psPolynomial3D structure, false otherwise. 190 */ 191 bool psMemCheckPolynomial3D( 192 psPtr ptr ///< the pointer whose type to check 193 ); 194 195 /** Checks the type of a particular pointer. 196 * 197 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 198 * 199 * @return bool: True if the pointer matches a psPolynomial4D structure, false otherwise. 200 */ 201 bool psMemCheckPolynomial4D( 202 psPtr ptr ///< the pointer whose type to check 203 ); 204 205 /** Checks the type of a particular pointer. 206 * 207 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 208 * 209 * @return bool: True if the pointer matches a psSpline1D structure, false otherwise. 210 */ 211 bool psMemCheckSpline1D( 212 psPtr ptr ///< the pointer whose type to check 213 ); 214 215 216 165 217 /** Evaluates a 1-D polynomial at specific coordinates. 166 218 * -
trunk/psLib/src/math/psMinimize.c
r4858 r4898 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.13 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-08- 24 01:04:37$11 * @version $Revision: 1.132 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-08-30 01:14:13 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1372 1372 } 1373 1373 1374 1374 static void minimizationFree(psMinimization *min) 1375 { 1376 // There are non dynamic allocated items 1377 } 1375 1378 1376 1379 /****************************************************************************** … … 1382 1385 1383 1386 psMinimization *min = psAlloc(sizeof(psMinimization)); 1387 psMemSetDeallocator(min, (psFreeFunc)minimizationFree); 1384 1388 *(int*)&min->maxIter = maxIter; 1385 1389 *(float*)&min->tol = tol; … … 1390 1394 return(min); 1391 1395 } 1396 1397 bool psMemCheckMinimization(psPtr ptr) 1398 { 1399 return ( psMemGetDeallocator(ptr) == (psFreeFunc)minimizationFree ); 1400 } 1401 1392 1402 1393 1403 // This macro takes as input the vector BASE and adds a multiple of the vector -
trunk/psLib/src/math/psMinimize.h
r4760 r4898 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1.5 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-08- 11 23:04:32$10 * @version $Revision: 1.53 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-08-30 01:14:13 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 60 60 ); 61 61 62 /** Checks the type of a particular pointer. 63 * 64 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 65 * 66 * @return bool: True if the pointer matches a psMinimization structure, false otherwise. 67 */ 68 bool psMemCheckMinimization( 69 psPtr ptr ///< the pointer whose type to check 70 ); 71 72 62 73 /** Derive a polynomial fit. 63 74 * -
trunk/psLib/src/math/psStats.c
r4620 r4898 14 14 * stats->binsize 15 15 * 16 * @version $Revision: 1.13 8$ $Name: not supported by cvs2svn $17 * @date $Date: 2005-0 7-27 19:55:16$16 * @version $Revision: 1.139 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2005-08-30 01:14:13 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1753 1753 static void histogramFree(psHistogram* myHist); 1754 1754 1755 static void statsFree(psStats *newStruct) 1756 { 1757 // There are non dynamic allocated items 1758 } 1759 1755 1760 /****************************************************************************** 1756 1761 psStatsAlloc(): This routine must create a new psStats data structure. … … 1761 1766 1762 1767 newStruct = (psStats* ) psAlloc(sizeof(psStats)); 1768 psMemSetDeallocator(newStruct, (psFreeFunc)statsFree); 1763 1769 newStruct->sampleMean = NAN; 1764 1770 newStruct->sampleMedian = NAN; … … 1787 1793 } 1788 1794 1795 1796 bool psMemCheckStats(psPtr ptr) 1797 { 1798 return ( psMemGetDeallocator(ptr) == (psFreeFunc)statsFree ); 1799 } 1800 1801 1802 1789 1803 /****************************************************************************** 1790 1804 psHistogramAlloc(lower, upper, n): allocate a uniform histogram structure … … 1885 1899 psFree(myHist->nums); 1886 1900 } 1901 1902 1903 bool psMemCheckHistogram(psPtr ptr) 1904 { 1905 return ( psMemGetDeallocator(ptr) == (psFreeFunc)histogramFree ); 1906 } 1907 1908 1887 1909 1888 1910 /***************************************************************************** -
trunk/psLib/src/math/psStats.h
r4857 r4898 14 14 * @author GLG, MHPCC 15 15 * 16 * @version $Revision: 1.4 7$ $Name: not supported by cvs2svn $17 * @date $Date: 2005-08- 23 23:23:05$16 * @version $Revision: 1.48 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2005-08-30 01:14:13 $ 18 18 * 19 19 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 105 105 ); 106 106 107 108 /** Checks the type of a particular pointer. 109 * 110 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 111 * 112 * @return bool: True if the pointer matches a psStats structure, false otherwise. 113 */ 114 bool psMemCheckStats( 115 psPtr ptr ///< the pointer whose type to check 116 ); 117 118 107 119 /****************************************************************************** 108 120 Histogram functions and data structures. … … 140 152 ); 141 153 154 155 /** Checks the type of a particular pointer. 156 * 157 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 158 * 159 * @return bool: True if the pointer matches a psHistogram structure, false otherwise. 160 */ 161 bool psMemCheckHistogram( 162 psPtr ptr ///< the pointer whose type to check 163 ); 164 165 142 166 /** Allocator for psHistogram where the bounds of the bins are explicitly 143 167 * specified.
Note:
See TracChangeset
for help on using the changeset viewer.
