IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4898 for trunk/psLib/src/math


Ignore:
Timestamp:
Aug 29, 2005, 3:14:13 PM (21 years ago)
Author:
drobbin
Message:

Implemented psMemCheckType functions and tests. Some testing remains unfinished.

Location:
trunk/psLib/src/math
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psFunctions.c

    r4876 r4898  
    77*  polynomials.  It also contains a Gaussian functions.
    88*
    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 $
    1111*
    1212*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    871871    return(newPoly);
    872872}
     873
     874
     875bool psMemCheckPolynomial1D(psPtr ptr)
     876{
     877    return ( psMemGetDeallocator(ptr) == (psFreeFunc)polynomial1DFree );
     878}
     879
     880bool psMemCheckPolynomial2D(psPtr ptr)
     881{
     882    return ( psMemGetDeallocator(ptr) == (psFreeFunc)polynomial2DFree );
     883}
     884
     885bool psMemCheckPolynomial3D(psPtr ptr)
     886{
     887    return ( psMemGetDeallocator(ptr) == (psFreeFunc)polynomial3DFree );
     888}
     889
     890bool psMemCheckPolynomial4D(psPtr ptr)
     891{
     892    return ( psMemGetDeallocator(ptr) == (psFreeFunc)polynomial4DFree );
     893}
     894
     895bool psMemCheckSpline1D(psPtr ptr)
     896{
     897    return ( psMemGetDeallocator(ptr) == (psFreeFunc)spline1DFree );
     898}
     899
    873900
    874901psF64 psPolynomial1DEval(const psPolynomial1D* poly, psF64 x)
  • trunk/psLib/src/math/psFunctions.h

    r4581 r4898  
    1212 *  @author GLG, MHPCC
    1313 *
    14  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-07-20 01:21:13 $
     14 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2005-08-30 01:14:13 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    163163);
    164164
     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 */
     171bool 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 */
     181bool 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 */
     191bool 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 */
     201bool 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 */
     211bool psMemCheckSpline1D(
     212    psPtr ptr                          ///< the pointer whose type to check
     213);
     214
     215
     216
    165217/** Evaluates a 1-D polynomial at specific coordinates.
    166218 *
  • trunk/psLib/src/math/psMinimize.c

    r4858 r4898  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.131 $ $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 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    13721372}
    13731373
    1374 
     1374static void minimizationFree(psMinimization *min)
     1375{
     1376    // There are non dynamic allocated items
     1377}
    13751378
    13761379/******************************************************************************
     
    13821385
    13831386    psMinimization *min = psAlloc(sizeof(psMinimization));
     1387    psMemSetDeallocator(min, (psFreeFunc)minimizationFree);
    13841388    *(int*)&min->maxIter = maxIter;
    13851389    *(float*)&min->tol = tol;
     
    13901394    return(min);
    13911395}
     1396
     1397bool psMemCheckMinimization(psPtr ptr)
     1398{
     1399    return ( psMemGetDeallocator(ptr) == (psFreeFunc)minimizationFree );
     1400}
     1401
    13921402
    13931403// This macro takes as input the vector BASE and adds a multiple of the vector
  • trunk/psLib/src/math/psMinimize.h

    r4760 r4898  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.52 $ $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 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6060);
    6161
     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 */
     68bool psMemCheckMinimization(
     69    psPtr ptr                          ///< the pointer whose type to check
     70);
     71
     72
    6273/** Derive a polynomial fit.
    6374 *
  • trunk/psLib/src/math/psStats.c

    r4620 r4898  
    1414 *      stats->binsize
    1515 *
    16  *  @version $Revision: 1.138 $ $Name: not supported by cvs2svn $
    17  *  @date $Date: 2005-07-27 19:55:16 $
     16 *  @version $Revision: 1.139 $ $Name: not supported by cvs2svn $
     17 *  @date $Date: 2005-08-30 01:14:13 $
    1818 *
    1919 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    17531753static void histogramFree(psHistogram* myHist);
    17541754
     1755static void statsFree(psStats *newStruct)
     1756{
     1757    // There are non dynamic allocated items
     1758}
     1759
    17551760/******************************************************************************
    17561761    psStatsAlloc(): This routine must create a new psStats data structure.
     
    17611766
    17621767    newStruct = (psStats* ) psAlloc(sizeof(psStats));
     1768    psMemSetDeallocator(newStruct, (psFreeFunc)statsFree);
    17631769    newStruct->sampleMean = NAN;
    17641770    newStruct->sampleMedian = NAN;
     
    17871793}
    17881794
     1795
     1796bool psMemCheckStats(psPtr ptr)
     1797{
     1798    return ( psMemGetDeallocator(ptr) == (psFreeFunc)statsFree );
     1799}
     1800
     1801
     1802
    17891803/******************************************************************************
    17901804psHistogramAlloc(lower, upper, n): allocate a uniform histogram structure
     
    18851899    psFree(myHist->nums);
    18861900}
     1901
     1902
     1903bool psMemCheckHistogram(psPtr ptr)
     1904{
     1905    return ( psMemGetDeallocator(ptr) == (psFreeFunc)histogramFree );
     1906}
     1907
     1908
    18871909
    18881910/*****************************************************************************
  • trunk/psLib/src/math/psStats.h

    r4857 r4898  
    1414 *  @author GLG, MHPCC
    1515 *
    16  *  @version $Revision: 1.47 $ $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 $
    1818 *
    1919 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    105105);
    106106
     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 */
     114bool psMemCheckStats(
     115    psPtr ptr                          ///< the pointer whose type to check
     116);
     117
     118
    107119/******************************************************************************
    108120    Histogram functions and data structures.
     
    140152);
    141153
     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 */
     161bool psMemCheckHistogram(
     162    psPtr ptr                          ///< the pointer whose type to check
     163);
     164
     165
    142166/** Allocator for psHistogram where the bounds of the bins are explicitly
    143167 *  specified.
Note: See TracChangeset for help on using the changeset viewer.