IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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/mathtypes
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/mathtypes/psImage.c

    r4887 r4898  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.77 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-08-26 23:01:17 $
     11 *  @version $Revision: 1.78 $ $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
     
    9090    return image;
    9191}
     92
     93
     94bool psMemCheckImage(psPtr ptr)
     95{
     96    return ( psMemGetDeallocator(ptr) == (psFreeFunc)imageFree );
     97}
     98
    9299
    93100psRegion psRegionSet(float x0,
  • trunk/psLib/src/mathtypes/psImage.h

    r4886 r4898  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.63 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-08-26 03:35:02 $
     13 *  @version $Revision: 1.64 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-08-30 01:14:13 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    111111;
    112112
     113
     114/** Checks the type of a particular pointer.
     115 *
     116 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     117 *
     118 *  @return bool:       True if the pointer matches a psImage structure, false otherwise.
     119 */
     120bool psMemCheckImage(
     121    psPtr ptr                          ///< the pointer whose type to check
     122);
     123
     124
    113125/** Create a psRegion with the specified attributes.
    114126 *
  • trunk/psLib/src/mathtypes/psScalar.c

    r4540 r4898  
    88 *  @author Ross Harman, MHPCC
    99 *
    10  *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-07-12 19:12:01 $
     10 *  @version $Revision: 1.18 $ $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
     
    2222#include "psErrorText.h"
    2323
     24static void scalarFree(psScalar *scalar)
     25{
     26    // There are non dynamic allocated items
     27}
     28
    2429psScalar* psScalarAlloc(complex value, psElemType type)
    2530{
     
    2833    // Create scalar
    2934    scalar = (psScalar* ) psAlloc(sizeof(psScalar));
    30 
     35    psMemSetDeallocator(scalar, (psFreeFunc)scalarFree);
    3136    scalar->type.dimen = PS_DIMEN_SCALAR;
    3237    scalar->type.type = type;
     
    7984    return scalar;
    8085}
     86
     87
     88bool psMemCheckScalar(psPtr ptr)
     89{
     90    return ( psMemGetDeallocator(ptr) == (psFreeFunc)scalarFree );
     91}
     92
    8193
    8294psScalar* psScalarCopy(const psScalar *value)
  • trunk/psLib/src/mathtypes/psScalar.h

    r4540 r4898  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-07-12 19:12:01 $
     13 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-08-30 01:14:13 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7070);
    7171
     72
     73/** Checks the type of a particular pointer.
     74 *
     75 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     76 *
     77 *  @return bool:       True if the pointer matches a psScalar structure, false otherwise.
     78 */
     79bool psMemCheckScalar(
     80    psPtr ptr                          ///< the pointer whose type to check
     81);
     82
     83
    7284/** Copy a scalar.
    7385 *
  • trunk/psLib/src/mathtypes/psVector.c

    r4887 r4898  
    99*  @author Robert DeSonia, MHPCC
    1010*
    11 *  @version $Revision: 1.49 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2005-08-26 23:01:17 $
     11*  @version $Revision: 1.50 $ $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
     
    6060
    6161// FUNCTION IMPLEMENTATION - PUBLIC
     62bool psMemCheckVector(psPtr ptr)
     63{
     64    return ( psMemGetDeallocator(ptr) == (psFreeFunc)vectorFree );
     65}
     66
    6267
    6368psVector* psVectorAlloc(long nalloc,
  • trunk/psLib/src/mathtypes/psVector.h

    r4887 r4898  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-08-26 23:01:17 $
     13 *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-08-30 01:14:13 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6161/*****************************************************************************/
    6262
     63/** Checks the type of a particular pointer.
     64 *
     65 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     66 *
     67 *  @return bool:       True if the pointer matches a psVector structure, false otherwise.
     68 */
     69bool psMemCheckVector(
     70    psPtr ptr                          ///< the pointer whose type to check
     71)
     72;
    6373
    6474/** Allocate a vector.
     
    7282    long nalloc,                       ///< Total number of elements to make available.
    7383    psElemType type                    ///< Type of data to be held by vector.
    74 )
    75 ;
     84);
    7685
    7786/** Reallocate a vector.
Note: See TracChangeset for help on using the changeset viewer.