IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 20, 2004, 2:40:32 PM (22 years ago)
Author:
harman
Message:

Added double array

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/collections/psArray.h

    r485 r486  
    88 *  @author Ross Harman, MHPCC
    99 *   
    10  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-04-21 00:18:05 $
     10 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-04-21 00:40:32 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    9696typedef struct
    9797{
    98     psType type; ///< Type of data. THIS STRUCT ELEMENT MUST BE FIRST IN THE STRUCT!
    99     int nalloc;  ///< Total number of elements available.
    100     int n;   ///< Number of elements in use.
    101     float *arr;  ///< Array data.
     98    psType type;    ///< Type of data. THIS STRUCT ELEMENT MUST BE FIRST IN THE STRUCT!
     99    int nalloc;     ///< Total number of elements available.
     100    int n;          ///< Number of elements in use.
     101    float *arr;     ///< Array data.
    102102}
    103103psFloatArray;
     104
     105/** An array of doubles.
     106 *
     107 * Struct for maintaining an array of double precision floating point numbers.
     108 *
     109 */
     110typedef struct
     111{
     112    psType type;    ///< Type of data.  THIS STRUCT ELEMENT MUST BE FIRST IN THE STRUCT!
     113    int nalloc;     ///< Total number of elements available.
     114    int n;          ///< Number of elements in use.
     115    double *arr;    ///< Array data.
     116}
     117psDoubleArray;
    104118
    105119/*****************************************************************************/
     
    107121/*****************************************************************************/
    108122
    109 /** Allocate an integer array */
     123/** Allocate an integer array.
     124 *
     125 * Uses psLib memory allocation functions to create an array of integers as defined by the psIntArray struct.
     126 *
     127 */
    110128psIntArray *psIntArrayAlloc(
    111129    int nalloc  ///< Total number of elements to make available
    112130);
    113131
    114 /** Reallocate an integer array */
     132/** Reallocate an integer array.
     133 *
     134 * Uses psLib memory allocation functions to reallocate an array of integers as defined by the psIntArray
     135 * struct.
     136 *
     137 */
    115138psIntArray *psIntArrayRealloc(
    116139    psIntArray *myArray,    ///< Array to reallocate.
     
    119142
    120143
    121 /** Deallocate an integer array */
     144/** Deallocate an integer array
     145 *
     146 * Uses psLib memory allocation functions to deallocate an array of integers as defined by the psIntArray
     147 * struct.
     148 *
     149 */
    122150void psIntArrayFree(
    123151    psIntArray *restrict myArray    ///< Array to free
     
    153181    psFloatArray *restrict myArray  ///< Array to free
    154182);
     183
     184/** Allocate a Double array.
     185 *
     186 * Uses psLib memory allocation functions to create an array of doubles as defined by the psDoubleArray
     187 * struct.
     188 *
     189 */
     190psDoubleArray *psDoubleArrayAlloc(
     191    int nalloc  ///< Total number of elements to make available.
     192);
     193
     194/** Reallocate a Double array.
     195 *
     196 * Uses psLib memory allocation functions to reallocate an array of Doubles as defined by the psDoubleArray
     197 * struct.
     198 *
     199 */
     200psDoubleArray *psDoubleArrayRealloc(
     201    psDoubleArray *myArray, ///< Array to reallocate.
     202    int nalloc              ///< Total number of elements to make available.
     203);
     204
     205/** Deallocate a Double array
     206 *
     207 * Uses psLib memory allocation functions to deallocate an array of doubles as defined by the psDoubleArray
     208 * struct.
     209 *
     210 */
     211void psDoubleArrayFree(
     212    psDoubleArray *restrict myArray  ///< Array to free
     213);
     214
     215
     216
     217
     218
     219
     220
    155221
    156222/** An array of complex numbers.
     
    182248
    183249
    184 /************************************************************************************************************/
    185 
    186 /** An array of double-precision real numbers */
    187 typedef struct
    188 {
    189     psType type;  ///< Type of data.  THIS STRUCT ELEMENT MUST BE FIRST IN THE STRUCT!
    190     int nalloc;   ///< Total number of elements available
    191     int n;    ///< Number of elements in use
    192     double *arr;  ///< The array data
    193 }
    194 psDoubleArray;
    195 
    196 /** Constructor \ingroup DataGroup */
    197 psDoubleArray *psDoubleArrayAlloc(int nalloc) ///< Total number of elements to make available
    198 ;
    199 
    200 /** Reallocator \ingroup DataGroup */
    201 psDoubleArray *psDoubleArrayRealloc(psDoubleArray *myArray, ///< Array to reallocate
    202                                     int nalloc) ///< Total number of elements to make available
    203 ;
    204 
    205 /** Destructor \ingroup DataGroup */
    206 void psDoubleArrayFree(psDoubleArray *restrict myArray) ///< Array to free
    207 ;
     250
    208251
    209252/** Array of pointers to void.
Note: See TracChangeset for help on using the changeset viewer.