IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3476


Ignore:
Timestamp:
Mar 22, 2005, 11:52:49 AM (21 years ago)
Author:
desonia
Message:

* empty log message *

Location:
trunk/psLib
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/pslib.kdevelop

    r3341 r3476  
    113113      <group pattern="*.h" name="Header files" />
    114114      <group pattern="*.c" name="Source files" />
     115      <hidenonprojectfiles>false</hidenonprojectfiles>
     116      <hidenonlocation>false</hidenonlocation>
    115117    </groups>
    116118    <tree>
  • trunk/psLib/pslib.kdevses

    r3443 r3476  
    22<!DOCTYPE KDevPrjSession>
    33<KDevPrjSession>
    4  <DocsAndViews NumberOfDocuments="3" >
    5   <Doc0 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/astronomy/psMetadata.c" >
    6    <View0 line="92" Type="Source" />
     4 <DocsAndViews NumberOfDocuments="5" >
     5  <Doc0 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/fileUtils/psFits.h" >
     6   <View0 line="219" Type="Source" />
    77  </Doc0>
    8   <Doc1 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/astronomy/psDB.c" >
    9    <View0 line="101" Type="Source" />
     8  <Doc1 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/fileUtils/psFits.c" >
     9   <View0 line="1379" Type="Source" />
    1010  </Doc1>
    11   <Doc2 NumberOfViews="1" URL="file:/usr/share/aclocal/pilot-link.m4" >
    12    <View0 line="0" Type="Source" />
     11  <Doc2 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/test/fileUtils/tst_psFits.c" >
     12   <View0 line="917" Type="Source" />
    1313  </Doc2>
     14  <Doc3 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/collections/psVector.h" >
     15   <View0 line="156" Type="Source" />
     16  </Doc3>
     17  <Doc4 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/collections/psVector.c" >
     18   <View0 line="537" Type="Source" />
     19  </Doc4>
    1420 </DocsAndViews>
    1521 <pluginList>
     22  <kdevdebugger>
     23   <breakpointList/>
     24  </kdevdebugger>
    1625  <kdevbookmarks>
    1726   <bookmarks/>
     
    2332   <kcachegrind path="" />
    2433  </kdevvalgrind>
    25   <kdevdebugger>
    26    <breakpointList/>
    27   </kdevdebugger>
    2834 </pluginList>
    2935</KDevPrjSession>
  • trunk/psLib/src/collections/psVector.c

    r3407 r3476  
    99*  @author Robert DeSonia, MHPCC
    1010*
    11 *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2005-03-11 20:38:56 $
     11*  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2005-03-22 21:52:49 $
    1313*
    1414*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3737    }
    3838
    39     psFree(psVec->data.V);
     39    psFree(psVec->data.U8);
    4040}
    4141
     
    5959
    6060    // Create vector data array
    61     psVec->data.V = psAlloc(nalloc * elementSize);
     61    psVec->data.U8 = psAlloc(nalloc * elementSize);
    6262
    6363    return psVec;
     
    8080        }
    8181        // Realloc after decrementation to avoid accessing freed array elements
    82         in->data.V = psRealloc(in->data.V, nalloc * elementSize);
     82        in->data.U8 = psRealloc(in->data.U8, nalloc * elementSize);
    8383        in->nalloc = nalloc;
    8484    }
     
    107107    // need to increase data buffer?
    108108    if (byteSize > in->nalloc*PSELEMTYPE_SIZEOF(in->type.type)) {
    109         in->data.V = psRealloc(in->data.V, byteSize);
     109        in->data.U8 = psRealloc(in->data.U8, byteSize);
    110110        in->nalloc = n;
    111111    }
     
    235235    inType = inVector->type.type;
    236236    N = inVector->n;
    237     inVec = inVector->data.V;
     237    inVec = (psPtr)inVector->data.U8;
    238238    elSize = PSELEMTYPE_SIZEOF(inType);
    239239
     
    249249    }
    250250    outVector->n = N;
    251     outVec = outVector->data.V;
     251    outVec = outVector->data.U8;
    252252
    253253    if (N == 0) {
     
    496496}
    497497
     498psF64 p_psVectorGetElementF64(psVector* vector,
     499                              int position)
     500{
     501    if (vector == NULL) {
     502        return NAN;
     503    }
     504    if (position < 0 || position >= vector->n) {
     505        return NAN;
     506    }
     507
     508    switch (vector->type.type) {
     509    case PS_TYPE_U8:
     510        return vector->data.U8[position];
     511        break;
     512    case PS_TYPE_U16:
     513        return vector->data.U16[position];
     514        break;
     515    case PS_TYPE_U32:
     516        return vector->data.U32[position];
     517        break;
     518    case PS_TYPE_U64:
     519        return vector->data.U64[position];
     520        break;
     521    case PS_TYPE_S8:
     522        return vector->data.S8[position];
     523        break;
     524    case PS_TYPE_S16:
     525        return vector->data.S16[position];
     526        break;
     527    case PS_TYPE_S32:
     528        return vector->data.S32[position];
     529        break;
     530    case PS_TYPE_S64:
     531        return vector->data.S64[position];
     532        break;
     533    case PS_TYPE_F32:
     534        return vector->data.F32[position];
     535        break;
     536    case PS_TYPE_F64:
     537        return vector->data.F64[position];
     538    default:
     539        return NAN;
     540    }
     541}
  • trunk/psLib/src/collections/psVector.h

    r3407 r3476  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-03-11 20:38:56 $
     13 *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-03-22 21:52:49 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3737
    3838    union {
    39         psBool B;               ///< Boolean data.
    4039        psU8* U8;               ///< Unsigned 8-bit integer data.
    4140        psU16* U16;             ///< Unsigned 16-bit integer data.
     
    5049        psC32* C32;             ///< Single-precision complex data.
    5150        psC64* C64;             ///< Double-precision complex data.
    52         psPtr V;                ///< Pointer to data.
    5351    } data;                     ///< Union for data types.
    5452}
     
    153151);
    154152
     153/** Returns an element in the vector as a psF64 value
     154 *
     155 *  @return psF64          the value at specified position, or NAN if position is invalid.
     156 */
     157psF64 p_psVectorGetElementF64(
     158    psVector* vector,                  ///< vector to retrieve element
     159    int position                       ///< the vector position to get
     160);
     161
     162
    155163/// @}
    156164
  • trunk/psLib/src/dataIO/psFits.c

    r3407 r3476  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-03-11 20:38:56 $
     9 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-03-22 21:52:49 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7878    case TDBLCOMPLEX:
    7979        return PS_TYPE_C64;
     80    case TLOGICAL:
     81        return PS_TYPE_BOOL;
    8082    default:
     83        psError(PS_ERR_IO, true,
     84                "Unknown FITS datatype, %d.",
     85                datatype);
    8186        return PS_TYPE_PTR;
    8287    }
    8388}
    84 
    8589
    8690static bool convertPsTypeToFits(psElemType type, int* bitPix, double* bZero, int* dataType)
     
    12951299    fits_get_num_rows(fits->p_fd, &numRows, &status);
    12961300
     1301    // get the column length.
     1302    int width;
     1303    if ( fits_get_col_display_width(fits->p_fd, colnum, &width, &status) != 0) {
     1304        char fitsErr[MAX_STRING_LENGTH];
     1305        (void)fits_get_errstatus(status, fitsErr);
     1306        psError(PS_ERR_IO, true,
     1307                PS_ERRORTEXT_psFits_GET_COLTYPE,
     1308                fitsErr);
     1309        return NULL;
     1310    }
     1311
     1312    // allocate the buffers
    12971313    psArray* result = psArrayAlloc(numRows);
     1314    for (int row = 0; row < numRows; row++) {
     1315        result->data[row] = psAlloc((width+1)*sizeof(char));
     1316    }
     1317    result->n = numRows;
    12981318
    12991319    fits_read_col_str(fits->p_fd,
     
    13221342                                   const char* colname)
    13231343{
     1344    int status = 0;
    13241345    int colnum = 0;
    1325     int status = 0;
    13261346
    13271347    if (fits == NULL) {
     
    13591379    // get the number of rows
    13601380    long numRows = 0;
    1361     fits_get_num_rows(fits->p_fd, &numRows, &status);
     1381    fits_get_num_rows(fits->p_fd,
     1382                      &numRows,
     1383                      &status);
    13621384
    13631385    // get the column datatype.
     
    13761398    psVector* result = psVectorAlloc(numRows, convertFitsToPsType(typecode));
    13771399
    1378     fits_read_col(fits->p_fd, typecode, colnum, 1 /* firstrow */,
    1379                   1 /* firstelem */, numRows, NULL, result->data.V,
    1380                   NULL, &status);
     1400    fits_read_col(fits->p_fd,
     1401                  typecode,
     1402                  colnum,
     1403                  1 /* firstrow */,
     1404                  1 /* firstelem */,
     1405                  numRows,
     1406                  NULL,
     1407                  (psPtr)(result->data.U8),
     1408                  NULL,
     1409                  &status);
    13811410
    13821411    if ( status != 0) {
  • trunk/psLib/src/dataIO/psFits.h

    r3407 r3476  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-03-11 20:38:56 $
     9 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-03-22 21:52:49 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    206206 */
    207207psArray* psFitsReadTableColumn(
    208     psFits* fits,
    209     const char* colname
     208    psFits* fits,                      ///< the psFits object
     209    const char* colname                ///< the column name
    210210);
    211211
     
    262262    ///< Array of psMetadata items, which contains the output data items of each row.
    263263    int row                            ///< the row number to update.
    264 
    265264);
    266265
  • trunk/psLib/src/dataManip/psConstants.h

    r3313 r3476  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-02-24 00:19:51 $
     8 *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-03-22 21:52:49 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    191191#define PS_VECTOR_CHECK_NULL(NAME, RVAL) PS_VECTOR_CHECK_NULL_GENERAL(NAME, return RVAL)
    192192#define PS_VECTOR_CHECK_NULL_GENERAL(NAME, CLEANUP) \
    193 if (NAME == NULL || NAME->data.V == NULL) { \
     193if (NAME == NULL || NAME->data.U8 == NULL) { \
    194194    psError(PS_ERR_BAD_PARAMETER_NULL, true, \
    195195            "Unallowable operation: psVector %s or its data is NULL.", \
     
    272272    NEW_STATIC32 = psVectorRecycle(NEW_STATIC32, OLD->n, PS_TYPE_F32); \
    273273    p_psMemSetPersistent(NEW_STATIC32, true); \
    274     p_psMemSetPersistent(NEW_STATIC32->data.V, true); \
     274    p_psMemSetPersistent(NEW_STATIC32->data.U8, true); \
    275275    for (i=0; i < OLD->n ; i++) { \
    276276        NEW_STATIC32->data.F32[i] = (float) OLD->data.F64[i]; \
     
    285285    NEW_STATIC64 = psVectorRecycle(NEW_STATIC64, OLD->n, PS_TYPE_F64); \
    286286    p_psMemSetPersistent(NEW_STATIC64, true); \
    287     p_psMemSetPersistent(NEW_STATIC64->data.V, true); \
     287    p_psMemSetPersistent(NEW_STATIC64->data.U8, true); \
    288288    for (i=0; i < OLD->n ; i++) { \
    289289        NEW_STATIC64->data.F64[i] = (double) OLD->data.F32[i]; \
     
    295295VEC = psVectorRecycle(VEC, N, PS_TYPE_F32); \
    296296p_psMemSetPersistent(VEC, true); \
    297 p_psMemSetPersistent(VEC->data.V, true); \
     297p_psMemSetPersistent(VEC->data.U8, true); \
    298298for (int i=0;i<N;i++) { \
    299299    VEC->data.F32[i] = 1.0; \
     
    303303VEC = psVectorRecycle(VEC, N, PS_TYPE_F64); \
    304304p_psMemSetPersistent(VEC, true); \
    305 p_psMemSetPersistent(VEC->data.V, true); \
     305p_psMemSetPersistent(VEC->data.U8, true); \
    306306for (int i=0;i<N;i++) { \
    307307    VEC->data.F64[i] = 1.0; \
     
    311311VEC = psVectorRecycle(VEC, N, PS_TYPE_F32); \
    312312p_psMemSetPersistent(VEC, true); \
    313 p_psMemSetPersistent(VEC->data.V, true); \
     313p_psMemSetPersistent(VEC->data.U8, true); \
    314314for (int i=0;i<N;i++) { \
    315315    VEC->data.F32[i] = (float) i; \
     
    319319VEC = psVectorRecycle(VEC, N, PS_TYPE_F64); \
    320320p_psMemSetPersistent(VEC, true); \
    321 p_psMemSetPersistent(VEC->data.V, true); \
     321p_psMemSetPersistent(VEC->data.U8, true); \
    322322for (int i=0;i<N;i++) { \
    323323    VEC->data.F64[i] = (float) i; \
     
    328328NAME = psVectorRecycle(NAME, SIZE, TYPE); \
    329329p_psMemSetPersistent(NAME, true); \
    330 p_psMemSetPersistent(NAME->data.V, true); \
     330p_psMemSetPersistent(NAME->data.U8, true); \
    331331
    332332#define PS_VECTOR_DECLARE_ALLOC_STATIC(NAME, SIZE, TYPE) \
  • trunk/psLib/src/dataManip/psMatrix.c

    r3341 r3476  
    2121 *  @author Robert DeSonia, MHPCC
    2222 *
    23  *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
    24  *  @date $Date: 2005-02-28 23:34:10 $
     23 *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
     24 *  @date $Date: 2005-03-22 21:52:49 $
    2525 *
    2626 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    216216
    217217    (*outPerm)->n = numCols;
    218     perm.data = (*outPerm)->data.V;
     218    perm.data = (psPtr)((*outPerm)->data.U8);
    219219    lu = gsl_matrix_alloc(numRows, numCols);
    220220
     
    273273    outVector->n = numCols;
    274274    perm.size = inPerm->n;
    275     perm.data = inPerm->data.V;
     275    perm.data = (psPtr)(inPerm->data.U8);
    276276
    277277    // Solve for {x} in equation: {b} = [A]{x}
     
    580580    }
    581581
    582     memcpy(outVector->data.V, inImage->data.V[0], size);
     582    memcpy(outVector->data.U8, inImage->data.U8[0], size);
    583583
    584584    return outVector;
     
    637637    PS_CHECK_DIMEN_AND_TYPE(outImage, PS_DIMEN_IMAGE, VECTORTOMATRIX_CLEANUP);
    638638
    639     memcpy(outImage->data.V[0], inVector->data.V, size);
     639    memcpy(outImage->data.U8[0], inVector->data.U8, size);
    640640
    641641    return outImage;
  • trunk/psLib/src/dataManip/psMinimize.c

    r3264 r3476  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.106 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-02-17 19:26:23 $
     11 *  @version $Revision: 1.107 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-03-22 21:52:49 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    16081608        myParamMask = psVectorRecycle(myParamMask, params->n, PS_TYPE_U8);
    16091609        p_psMemSetPersistent(myParamMask, true);
    1610         p_psMemSetPersistent(myParamMask->data.V, true);
     1610        p_psMemSetPersistent(myParamMask->data.U8, true);
    16111611        for (i=0;i<myParamMask->n;i++) {
    16121612            myParamMask->data.U8[i] = 0;
  • trunk/psLib/src/dataManip/psVectorFFT.c

    r3264 r3476  
    55 *  @author Robert DeSonia, MHPCC
    66 *
    7  *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-02-17 19:26:23 $
     7 *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-03-22 21:52:49 $
    99 *
    1010 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    8787        }
    8888        out->type.type = PS_TYPE_F32;
    89         out->data.V = psRealloc(out->data.V,PSELEMTYPE_SIZEOF(PS_TYPE_F32)*out->nalloc);
     89        out->data.U8 = psRealloc(out->data.U8,PSELEMTYPE_SIZEOF(PS_TYPE_F32)*out->nalloc);
    9090    }
    9191
     
    113113        out = psVectorRecycle(out, numElements, type);
    114114        out->n = numElements;
    115         memcpy(out->data.V, in->data.V, numElements * PSELEMTYPE_SIZEOF(type));
     115        memcpy(out->data.U8, in->data.U8, numElements * PSELEMTYPE_SIZEOF(type));
    116116        return out;
    117117    }
     
    172172        out = psVectorRecycle(out, numElements, type);
    173173        out->n = numElements;
    174         memset(out->data.V, 0, PSELEMTYPE_SIZEOF(type) * numElements);
     174        memset(out->data.U8, 0, PSELEMTYPE_SIZEOF(type) * numElements);
    175175        return out;
    176176    }
     
    298298        out = psVectorRecycle(out, numElements, type);
    299299        out->n = numElements;
    300         memcpy(out->data.V, in->data.V, PSELEMTYPE_SIZEOF(type) * numElements);
     300        memcpy(out->data.U8, in->data.U8, PSELEMTYPE_SIZEOF(type) * numElements);
    301301        return out;
    302302    }
  • trunk/psLib/src/fft/psVectorFFT.c

    r3264 r3476  
    55 *  @author Robert DeSonia, MHPCC
    66 *
    7  *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-02-17 19:26:23 $
     7 *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-03-22 21:52:49 $
    99 *
    1010 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    8787        }
    8888        out->type.type = PS_TYPE_F32;
    89         out->data.V = psRealloc(out->data.V,PSELEMTYPE_SIZEOF(PS_TYPE_F32)*out->nalloc);
     89        out->data.U8 = psRealloc(out->data.U8,PSELEMTYPE_SIZEOF(PS_TYPE_F32)*out->nalloc);
    9090    }
    9191
     
    113113        out = psVectorRecycle(out, numElements, type);
    114114        out->n = numElements;
    115         memcpy(out->data.V, in->data.V, numElements * PSELEMTYPE_SIZEOF(type));
     115        memcpy(out->data.U8, in->data.U8, numElements * PSELEMTYPE_SIZEOF(type));
    116116        return out;
    117117    }
     
    172172        out = psVectorRecycle(out, numElements, type);
    173173        out->n = numElements;
    174         memset(out->data.V, 0, PSELEMTYPE_SIZEOF(type) * numElements);
     174        memset(out->data.U8, 0, PSELEMTYPE_SIZEOF(type) * numElements);
    175175        return out;
    176176    }
     
    298298        out = psVectorRecycle(out, numElements, type);
    299299        out->n = numElements;
    300         memcpy(out->data.V, in->data.V, PSELEMTYPE_SIZEOF(type) * numElements);
     300        memcpy(out->data.U8, in->data.U8, PSELEMTYPE_SIZEOF(type) * numElements);
    301301        return out;
    302302    }
  • trunk/psLib/src/fileUtils/psFits.c

    r3407 r3476  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-03-11 20:38:56 $
     9 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-03-22 21:52:49 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7878    case TDBLCOMPLEX:
    7979        return PS_TYPE_C64;
     80    case TLOGICAL:
     81        return PS_TYPE_BOOL;
    8082    default:
     83        psError(PS_ERR_IO, true,
     84                "Unknown FITS datatype, %d.",
     85                datatype);
    8186        return PS_TYPE_PTR;
    8287    }
    8388}
    84 
    8589
    8690static bool convertPsTypeToFits(psElemType type, int* bitPix, double* bZero, int* dataType)
     
    12951299    fits_get_num_rows(fits->p_fd, &numRows, &status);
    12961300
     1301    // get the column length.
     1302    int width;
     1303    if ( fits_get_col_display_width(fits->p_fd, colnum, &width, &status) != 0) {
     1304        char fitsErr[MAX_STRING_LENGTH];
     1305        (void)fits_get_errstatus(status, fitsErr);
     1306        psError(PS_ERR_IO, true,
     1307                PS_ERRORTEXT_psFits_GET_COLTYPE,
     1308                fitsErr);
     1309        return NULL;
     1310    }
     1311
     1312    // allocate the buffers
    12971313    psArray* result = psArrayAlloc(numRows);
     1314    for (int row = 0; row < numRows; row++) {
     1315        result->data[row] = psAlloc((width+1)*sizeof(char));
     1316    }
     1317    result->n = numRows;
    12981318
    12991319    fits_read_col_str(fits->p_fd,
     
    13221342                                   const char* colname)
    13231343{
     1344    int status = 0;
    13241345    int colnum = 0;
    1325     int status = 0;
    13261346
    13271347    if (fits == NULL) {
     
    13591379    // get the number of rows
    13601380    long numRows = 0;
    1361     fits_get_num_rows(fits->p_fd, &numRows, &status);
     1381    fits_get_num_rows(fits->p_fd,
     1382                      &numRows,
     1383                      &status);
    13621384
    13631385    // get the column datatype.
     
    13761398    psVector* result = psVectorAlloc(numRows, convertFitsToPsType(typecode));
    13771399
    1378     fits_read_col(fits->p_fd, typecode, colnum, 1 /* firstrow */,
    1379                   1 /* firstelem */, numRows, NULL, result->data.V,
    1380                   NULL, &status);
     1400    fits_read_col(fits->p_fd,
     1401                  typecode,
     1402                  colnum,
     1403                  1 /* firstrow */,
     1404                  1 /* firstelem */,
     1405                  numRows,
     1406                  NULL,
     1407                  (psPtr)(result->data.U8),
     1408                  NULL,
     1409                  &status);
    13811410
    13821411    if ( status != 0) {
  • trunk/psLib/src/fileUtils/psFits.h

    r3407 r3476  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-03-11 20:38:56 $
     9 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-03-22 21:52:49 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    206206 */
    207207psArray* psFitsReadTableColumn(
    208     psFits* fits,
    209     const char* colname
     208    psFits* fits,                      ///< the psFits object
     209    const char* colname                ///< the column name
    210210);
    211211
     
    262262    ///< Array of psMetadata items, which contains the output data items of each row.
    263263    int row                            ///< the row number to update.
    264 
    265264);
    266265
  • trunk/psLib/src/fits/psFits.c

    r3407 r3476  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-03-11 20:38:56 $
     9 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-03-22 21:52:49 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7878    case TDBLCOMPLEX:
    7979        return PS_TYPE_C64;
     80    case TLOGICAL:
     81        return PS_TYPE_BOOL;
    8082    default:
     83        psError(PS_ERR_IO, true,
     84                "Unknown FITS datatype, %d.",
     85                datatype);
    8186        return PS_TYPE_PTR;
    8287    }
    8388}
    84 
    8589
    8690static bool convertPsTypeToFits(psElemType type, int* bitPix, double* bZero, int* dataType)
     
    12951299    fits_get_num_rows(fits->p_fd, &numRows, &status);
    12961300
     1301    // get the column length.
     1302    int width;
     1303    if ( fits_get_col_display_width(fits->p_fd, colnum, &width, &status) != 0) {
     1304        char fitsErr[MAX_STRING_LENGTH];
     1305        (void)fits_get_errstatus(status, fitsErr);
     1306        psError(PS_ERR_IO, true,
     1307                PS_ERRORTEXT_psFits_GET_COLTYPE,
     1308                fitsErr);
     1309        return NULL;
     1310    }
     1311
     1312    // allocate the buffers
    12971313    psArray* result = psArrayAlloc(numRows);
     1314    for (int row = 0; row < numRows; row++) {
     1315        result->data[row] = psAlloc((width+1)*sizeof(char));
     1316    }
     1317    result->n = numRows;
    12981318
    12991319    fits_read_col_str(fits->p_fd,
     
    13221342                                   const char* colname)
    13231343{
     1344    int status = 0;
    13241345    int colnum = 0;
    1325     int status = 0;
    13261346
    13271347    if (fits == NULL) {
     
    13591379    // get the number of rows
    13601380    long numRows = 0;
    1361     fits_get_num_rows(fits->p_fd, &numRows, &status);
     1381    fits_get_num_rows(fits->p_fd,
     1382                      &numRows,
     1383                      &status);
    13621384
    13631385    // get the column datatype.
     
    13761398    psVector* result = psVectorAlloc(numRows, convertFitsToPsType(typecode));
    13771399
    1378     fits_read_col(fits->p_fd, typecode, colnum, 1 /* firstrow */,
    1379                   1 /* firstelem */, numRows, NULL, result->data.V,
    1380                   NULL, &status);
     1400    fits_read_col(fits->p_fd,
     1401                  typecode,
     1402                  colnum,
     1403                  1 /* firstrow */,
     1404                  1 /* firstelem */,
     1405                  numRows,
     1406                  NULL,
     1407                  (psPtr)(result->data.U8),
     1408                  NULL,
     1409                  &status);
    13811410
    13821411    if ( status != 0) {
  • trunk/psLib/src/fits/psFits.h

    r3407 r3476  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-03-11 20:38:56 $
     9 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-03-22 21:52:49 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    206206 */
    207207psArray* psFitsReadTableColumn(
    208     psFits* fits,
    209     const char* colname
     208    psFits* fits,                      ///< the psFits object
     209    const char* colname                ///< the column name
    210210);
    211211
     
    262262    ///< Array of psMetadata items, which contains the output data items of each row.
    263263    int row                            ///< the row number to update.
    264 
    265264);
    266265
  • trunk/psLib/src/image/psImageErrors.dat

    r2879 r3476  
    7979psImageConvolve_KERNEL_TOO_LARGE       Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d.
    8080psImage_COEFF_NULL                     Polynomial coefficients cannot be NULL.
     81psImageManip_TRANSFORM_NULL            Specified input transform can not be NULL.
  • trunk/psLib/src/image/psImageErrors.h

    r3264 r3476  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-02-17 19:26:24 $
     9 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-03-22 21:52:49 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9696#define PS_ERRORTEXT_psImageConvolve_KERNEL_TOO_LARGE "Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d."
    9797#define PS_ERRORTEXT_psImage_COEFF_NULL "Polynomial coefficients cannot be NULL."
     98#define PS_ERRORTEXT_psImageManip_TRANSFORM_NULL "Specified input transform can not be NULL"
    9899//~End
    99100
  • trunk/psLib/src/image/psImageExtraction.c

    r3313 r3476  
    99 *  @author Robert DeSonia, MHPCC
    1010 *
    11  *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-02-24 00:19:51 $
     11 *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-03-22 21:52:49 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    370370                ps##TYPE *imgVecData = imgVec->data.TYPE; \
    371371                if (maskVec != NULL) { \
    372                     maskVecData = maskVec->data.V; \
    373                     maskData = (psMaskType* )(mask->data.V[row0]) + c; \
     372                    maskVecData = maskVec->data.U8; \
     373                    maskData = (psMaskType* )(mask->data.U8[row0]) + c; \
    374374                } \
    375375                for (psS32 r=row0;r<row1;r++) { \
     
    453453            // point the vector struct to the
    454454            // data to calculate the stats
    455             imgVec->data.V = (psPtr )(in->data.U8[r] + col0 * elementSize);
     455            imgVec->data.U8 = (psPtr )(in->data.U8[r] + col0 * elementSize);
    456456            if (maskVec != NULL) {
    457                 maskVec->data.V = (psPtr )(mask->data.U8[r] + col0 * sizeof(psMaskType));
     457                maskVec->data.U8 = (psPtr )(mask->data.U8[r] + col0 * sizeof(psMaskType));
    458458            }
    459459            myStats = psVectorStats(myStats, imgVec, NULL, maskVec, maskVal);
  • trunk/psLib/src/image/psImageManip.c

    r3446 r3476  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-03-18 02:35:14 $
     12 *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-03-22 21:52:49 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2727#include "psConstants.h"
    2828#include "psImageErrors.h"
     29#include "psCoord.h"
    2930
    3031psS32 psImageClip(psImage* input,
     
    10341035    break;
    10351036
    1036 
    10371037    switch (mode) {
    10381038        PSIMAGE_SHIFT_ARBITRARY_CASE(FLAT);
     
    10491049    return out;
    10501050}
     1051
     1052
     1053// XXX: implementation is awaiting working psPlaneTransform functions like
     1054// invert.  Also, the next SDRS should have a different signature.
     1055psImage* psImageTransform(psImage *output,
     1056                          const psImage *input,
     1057                          const psImage *inputMask,
     1058                          int inputMaskVal,
     1059                          const psPlaneTransform *outToIn,
     1060                          const psImage *combineMask,
     1061                          int combineMaskVal)
     1062{
     1063    if (input == NULL) {
     1064        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     1065                PS_ERRORTEXT_psImage_IMAGE_NULL);
     1066        return NULL;
     1067    }
     1068
     1069    if (outToIn == NULL) {
     1070        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     1071                PS_ERRORTEXT_psImageManip_TRANSFORM_NULL);
     1072        return NULL;
     1073    }
     1074
     1075    // find the input image domain in the output image
     1076
     1077    // loop through the output image using the domain above and transform
     1078    // each output pixel to input coordinates and use psImagePixelInterpolate
     1079    // to determine the pixel value.
     1080
     1081
     1082    return NULL;
     1083}
  • trunk/psLib/src/image/psImageManip.h

    r3264 r3476  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-02-17 19:26:24 $
     13 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-03-22 21:52:49 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2020
    2121#include "psImage.h"
     22#include "psCoord.h"
    2223
    2324/// @addtogroup Image
     
    180181);
    181182
     183/** Transform the input image according the supplied transformation.
     184 *
     185 *  Transform the input image according the supplied transformation. In the
     186 *  event that the output is NULL, the smallest possible image capable of
     187 *  containing the entire transformed input image is to be returned; otherwise
     188 *  only the image size specified in the output image is to be used. If the
     189 *  inputMask is not NULL, those pixels in the inputMask matching inputMaskVal
     190 *  are to be ignored in the transformation. The inputMask must be of type
     191 *  psU8, and of the same size as the input, otherwise the function shall
     192 *  generate an error and return NULL. The transformation outToIn specifies
     193 *  the coordinates in the input image of a pixel in the output image - note
     194 *  that this is the reverse of what might be naively expected, but it is what
     195 *  is required in order to use psImagePixelInterpolate. If combineMask is not
     196 *  NULL, then those pixels that match combineMaskVal are not transformed.
     197 *  combineMask must be of type psU8 and of the same size as the output,
     198 *  otherwise the function shall generate an error and return NULL. This
     199 *  function must be capable of handling the following types for the input
     200 *  (with corresponding types for the output): psF32, psF64.
     201 *
     202 *  @return psImage*    The transformed image.
     203 */
     204psImage* psImageTransform(
     205    psImage *output,                   ///< psImage to recycle, or NULL
     206    const psImage *input,              ///< psImage to apply transform to
     207    const psImage *inputMask,          ///< if not NULL, mask of input psImage
     208    int inputMaskVal,                  ///< masking value for inputMask
     209    const psPlaneTransform *outToIn,   ///< the transform to apply
     210    const psImage *combineMask,        ///< if not NULL, mask of pixels not to be transformed
     211    int combineMaskVal                 ///< masking value for combineMask
     212);
     213
    182214#endif
  • trunk/psLib/src/image/psImageStats.c

    r3309 r3476  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-02-23 21:32:40 $
     11 *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-03-22 21:52:49 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6363        junkData->nalloc = in->numRows * in->numCols;
    6464        junkData->n = junkData->nalloc;
    65         junkData->data.V = in->data.V[0];      // since psImage data is contiguous...
     65        junkData->data.U8 = in->data.V[0];      // since psImage data is contiguous...
    6666    } else {
    6767        // image not necessarily contiguous
     
    7373        junkData->n = junkData->nalloc;
    7474
    75         psU8* data = junkData->data.V;
     75        psU8* data = junkData->data.U8;
    7676        for (int row = 0; row < numRows; row++) {
    7777            memcpy(data, in->data.V[row], rowSize);
     
    8787            junkMask->nalloc = mask->numRows * mask->numCols;
    8888            junkMask->n = junkMask->nalloc;
    89             junkMask->data.V = mask->data.V[0];
     89            junkMask->data.U8 = mask->data.V[0];
    9090        } else {
    9191            // image not necessarily contiguous
     
    9797            junkMask->n = junkMask->nalloc;
    9898
    99             psU8* data = junkMask->data.V;
     99            psU8* data = junkMask->data.U8;
    100100            for (int row = 0; row < numRows; row++) {
    101101                memcpy(data, mask->data.V[row], rowSize);
     
    136136        junkData->nalloc = in->numRows * in->numCols;
    137137        junkData->n = junkData->nalloc;
    138         junkData->data.V = in->data.V[0];      // since psImage data is contiguous...
     138        junkData->data.U8 = in->data.V[0];      // since psImage data is contiguous...
    139139    } else {
    140140        // image not necessarily contiguous
     
    146146        junkData->n = junkData->nalloc;
    147147
    148         psU8* data = junkData->data.V;
     148        psU8* data = junkData->data.U8;
    149149        for (int row = 0; row < numRows; row++) {
    150150            memcpy(data, in->data.V[row], rowSize);
     
    160160            junkMask->nalloc = mask->numRows * mask->numCols;
    161161            junkMask->n = junkMask->nalloc;
    162             junkMask->data.V = mask->data.V[0];
     162            junkMask->data.U8 = mask->data.V[0];
    163163        } else {
    164164            // image not necessarily contiguous
     
    170170            junkMask->n = junkMask->nalloc;
    171171
    172             psU8* data = junkMask->data.V;
     172            psU8* data = junkMask->data.U8;
    173173            for (int row = 0; row < numRows; row++) {
    174174                memcpy(data, mask->data.V[row], rowSize);
  • trunk/psLib/src/imageops/psImageStats.c

    r3309 r3476  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-02-23 21:32:40 $
     11 *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-03-22 21:52:49 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6363        junkData->nalloc = in->numRows * in->numCols;
    6464        junkData->n = junkData->nalloc;
    65         junkData->data.V = in->data.V[0];      // since psImage data is contiguous...
     65        junkData->data.U8 = in->data.V[0];      // since psImage data is contiguous...
    6666    } else {
    6767        // image not necessarily contiguous
     
    7373        junkData->n = junkData->nalloc;
    7474
    75         psU8* data = junkData->data.V;
     75        psU8* data = junkData->data.U8;
    7676        for (int row = 0; row < numRows; row++) {
    7777            memcpy(data, in->data.V[row], rowSize);
     
    8787            junkMask->nalloc = mask->numRows * mask->numCols;
    8888            junkMask->n = junkMask->nalloc;
    89             junkMask->data.V = mask->data.V[0];
     89            junkMask->data.U8 = mask->data.V[0];
    9090        } else {
    9191            // image not necessarily contiguous
     
    9797            junkMask->n = junkMask->nalloc;
    9898
    99             psU8* data = junkMask->data.V;
     99            psU8* data = junkMask->data.U8;
    100100            for (int row = 0; row < numRows; row++) {
    101101                memcpy(data, mask->data.V[row], rowSize);
     
    136136        junkData->nalloc = in->numRows * in->numCols;
    137137        junkData->n = junkData->nalloc;
    138         junkData->data.V = in->data.V[0];      // since psImage data is contiguous...
     138        junkData->data.U8 = in->data.V[0];      // since psImage data is contiguous...
    139139    } else {
    140140        // image not necessarily contiguous
     
    146146        junkData->n = junkData->nalloc;
    147147
    148         psU8* data = junkData->data.V;
     148        psU8* data = junkData->data.U8;
    149149        for (int row = 0; row < numRows; row++) {
    150150            memcpy(data, in->data.V[row], rowSize);
     
    160160            junkMask->nalloc = mask->numRows * mask->numCols;
    161161            junkMask->n = junkMask->nalloc;
    162             junkMask->data.V = mask->data.V[0];
     162            junkMask->data.U8 = mask->data.V[0];
    163163        } else {
    164164            // image not necessarily contiguous
     
    170170            junkMask->n = junkMask->nalloc;
    171171
    172             psU8* data = junkMask->data.V;
     172            psU8* data = junkMask->data.U8;
    173173            for (int row = 0; row < numRows; row++) {
    174174                memcpy(data, mask->data.V[row], rowSize);
  • trunk/psLib/src/math/psConstants.h

    r3313 r3476  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-02-24 00:19:51 $
     8 *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-03-22 21:52:49 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    191191#define PS_VECTOR_CHECK_NULL(NAME, RVAL) PS_VECTOR_CHECK_NULL_GENERAL(NAME, return RVAL)
    192192#define PS_VECTOR_CHECK_NULL_GENERAL(NAME, CLEANUP) \
    193 if (NAME == NULL || NAME->data.V == NULL) { \
     193if (NAME == NULL || NAME->data.U8 == NULL) { \
    194194    psError(PS_ERR_BAD_PARAMETER_NULL, true, \
    195195            "Unallowable operation: psVector %s or its data is NULL.", \
     
    272272    NEW_STATIC32 = psVectorRecycle(NEW_STATIC32, OLD->n, PS_TYPE_F32); \
    273273    p_psMemSetPersistent(NEW_STATIC32, true); \
    274     p_psMemSetPersistent(NEW_STATIC32->data.V, true); \
     274    p_psMemSetPersistent(NEW_STATIC32->data.U8, true); \
    275275    for (i=0; i < OLD->n ; i++) { \
    276276        NEW_STATIC32->data.F32[i] = (float) OLD->data.F64[i]; \
     
    285285    NEW_STATIC64 = psVectorRecycle(NEW_STATIC64, OLD->n, PS_TYPE_F64); \
    286286    p_psMemSetPersistent(NEW_STATIC64, true); \
    287     p_psMemSetPersistent(NEW_STATIC64->data.V, true); \
     287    p_psMemSetPersistent(NEW_STATIC64->data.U8, true); \
    288288    for (i=0; i < OLD->n ; i++) { \
    289289        NEW_STATIC64->data.F64[i] = (double) OLD->data.F32[i]; \
     
    295295VEC = psVectorRecycle(VEC, N, PS_TYPE_F32); \
    296296p_psMemSetPersistent(VEC, true); \
    297 p_psMemSetPersistent(VEC->data.V, true); \
     297p_psMemSetPersistent(VEC->data.U8, true); \
    298298for (int i=0;i<N;i++) { \
    299299    VEC->data.F32[i] = 1.0; \
     
    303303VEC = psVectorRecycle(VEC, N, PS_TYPE_F64); \
    304304p_psMemSetPersistent(VEC, true); \
    305 p_psMemSetPersistent(VEC->data.V, true); \
     305p_psMemSetPersistent(VEC->data.U8, true); \
    306306for (int i=0;i<N;i++) { \
    307307    VEC->data.F64[i] = 1.0; \
     
    311311VEC = psVectorRecycle(VEC, N, PS_TYPE_F32); \
    312312p_psMemSetPersistent(VEC, true); \
    313 p_psMemSetPersistent(VEC->data.V, true); \
     313p_psMemSetPersistent(VEC->data.U8, true); \
    314314for (int i=0;i<N;i++) { \
    315315    VEC->data.F32[i] = (float) i; \
     
    319319VEC = psVectorRecycle(VEC, N, PS_TYPE_F64); \
    320320p_psMemSetPersistent(VEC, true); \
    321 p_psMemSetPersistent(VEC->data.V, true); \
     321p_psMemSetPersistent(VEC->data.U8, true); \
    322322for (int i=0;i<N;i++) { \
    323323    VEC->data.F64[i] = (float) i; \
     
    328328NAME = psVectorRecycle(NAME, SIZE, TYPE); \
    329329p_psMemSetPersistent(NAME, true); \
    330 p_psMemSetPersistent(NAME->data.V, true); \
     330p_psMemSetPersistent(NAME->data.U8, true); \
    331331
    332332#define PS_VECTOR_DECLARE_ALLOC_STATIC(NAME, SIZE, TYPE) \
  • trunk/psLib/src/math/psMatrix.c

    r3341 r3476  
    2121 *  @author Robert DeSonia, MHPCC
    2222 *
    23  *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
    24  *  @date $Date: 2005-02-28 23:34:10 $
     23 *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
     24 *  @date $Date: 2005-03-22 21:52:49 $
    2525 *
    2626 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    216216
    217217    (*outPerm)->n = numCols;
    218     perm.data = (*outPerm)->data.V;
     218    perm.data = (psPtr)((*outPerm)->data.U8);
    219219    lu = gsl_matrix_alloc(numRows, numCols);
    220220
     
    273273    outVector->n = numCols;
    274274    perm.size = inPerm->n;
    275     perm.data = inPerm->data.V;
     275    perm.data = (psPtr)(inPerm->data.U8);
    276276
    277277    // Solve for {x} in equation: {b} = [A]{x}
     
    580580    }
    581581
    582     memcpy(outVector->data.V, inImage->data.V[0], size);
     582    memcpy(outVector->data.U8, inImage->data.U8[0], size);
    583583
    584584    return outVector;
     
    637637    PS_CHECK_DIMEN_AND_TYPE(outImage, PS_DIMEN_IMAGE, VECTORTOMATRIX_CLEANUP);
    638638
    639     memcpy(outImage->data.V[0], inVector->data.V, size);
     639    memcpy(outImage->data.U8[0], inVector->data.U8, size);
    640640
    641641    return outImage;
  • trunk/psLib/src/math/psMinimize.c

    r3264 r3476  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.106 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-02-17 19:26:23 $
     11 *  @version $Revision: 1.107 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-03-22 21:52:49 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    16081608        myParamMask = psVectorRecycle(myParamMask, params->n, PS_TYPE_U8);
    16091609        p_psMemSetPersistent(myParamMask, true);
    1610         p_psMemSetPersistent(myParamMask->data.V, true);
     1610        p_psMemSetPersistent(myParamMask->data.U8, true);
    16111611        for (i=0;i<myParamMask->n;i++) {
    16121612            myParamMask->data.U8[i] = 0;
  • trunk/psLib/src/mathtypes/psVector.c

    r3407 r3476  
    99*  @author Robert DeSonia, MHPCC
    1010*
    11 *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2005-03-11 20:38:56 $
     11*  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2005-03-22 21:52:49 $
    1313*
    1414*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3737    }
    3838
    39     psFree(psVec->data.V);
     39    psFree(psVec->data.U8);
    4040}
    4141
     
    5959
    6060    // Create vector data array
    61     psVec->data.V = psAlloc(nalloc * elementSize);
     61    psVec->data.U8 = psAlloc(nalloc * elementSize);
    6262
    6363    return psVec;
     
    8080        }
    8181        // Realloc after decrementation to avoid accessing freed array elements
    82         in->data.V = psRealloc(in->data.V, nalloc * elementSize);
     82        in->data.U8 = psRealloc(in->data.U8, nalloc * elementSize);
    8383        in->nalloc = nalloc;
    8484    }
     
    107107    // need to increase data buffer?
    108108    if (byteSize > in->nalloc*PSELEMTYPE_SIZEOF(in->type.type)) {
    109         in->data.V = psRealloc(in->data.V, byteSize);
     109        in->data.U8 = psRealloc(in->data.U8, byteSize);
    110110        in->nalloc = n;
    111111    }
     
    235235    inType = inVector->type.type;
    236236    N = inVector->n;
    237     inVec = inVector->data.V;
     237    inVec = (psPtr)inVector->data.U8;
    238238    elSize = PSELEMTYPE_SIZEOF(inType);
    239239
     
    249249    }
    250250    outVector->n = N;
    251     outVec = outVector->data.V;
     251    outVec = outVector->data.U8;
    252252
    253253    if (N == 0) {
     
    496496}
    497497
     498psF64 p_psVectorGetElementF64(psVector* vector,
     499                              int position)
     500{
     501    if (vector == NULL) {
     502        return NAN;
     503    }
     504    if (position < 0 || position >= vector->n) {
     505        return NAN;
     506    }
     507
     508    switch (vector->type.type) {
     509    case PS_TYPE_U8:
     510        return vector->data.U8[position];
     511        break;
     512    case PS_TYPE_U16:
     513        return vector->data.U16[position];
     514        break;
     515    case PS_TYPE_U32:
     516        return vector->data.U32[position];
     517        break;
     518    case PS_TYPE_U64:
     519        return vector->data.U64[position];
     520        break;
     521    case PS_TYPE_S8:
     522        return vector->data.S8[position];
     523        break;
     524    case PS_TYPE_S16:
     525        return vector->data.S16[position];
     526        break;
     527    case PS_TYPE_S32:
     528        return vector->data.S32[position];
     529        break;
     530    case PS_TYPE_S64:
     531        return vector->data.S64[position];
     532        break;
     533    case PS_TYPE_F32:
     534        return vector->data.F32[position];
     535        break;
     536    case PS_TYPE_F64:
     537        return vector->data.F64[position];
     538    default:
     539        return NAN;
     540    }
     541}
  • trunk/psLib/src/mathtypes/psVector.h

    r3407 r3476  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-03-11 20:38:56 $
     13 *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-03-22 21:52:49 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3737
    3838    union {
    39         psBool B;               ///< Boolean data.
    4039        psU8* U8;               ///< Unsigned 8-bit integer data.
    4140        psU16* U16;             ///< Unsigned 16-bit integer data.
     
    5049        psC32* C32;             ///< Single-precision complex data.
    5150        psC64* C64;             ///< Double-precision complex data.
    52         psPtr V;                ///< Pointer to data.
    5351    } data;                     ///< Union for data types.
    5452}
     
    153151);
    154152
     153/** Returns an element in the vector as a psF64 value
     154 *
     155 *  @return psF64          the value at specified position, or NAN if position is invalid.
     156 */
     157psF64 p_psVectorGetElementF64(
     158    psVector* vector,                  ///< vector to retrieve element
     159    int position                       ///< the vector position to get
     160);
     161
     162
    155163/// @}
    156164
  • trunk/psLib/src/sys/psError.c

    r3264 r3476  
    1010 *  @author Eric Van Alst, MHPCC
    1111 *
    12  *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-02-17 19:26:24 $
     12 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-03-22 21:52:49 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    103103
    104104    return code;
     105}
     106
     107void p_psWarning(const char* file,
     108                 int lineno,
     109                 const char* func,
     110                 const char* fmt,
     111                 ...)
     112{
     113    char msgName[1024];
     114
     115    snprintf(msgName,1024,"%s (%s:%d)",func,file,lineno);
     116
     117    va_list argPtr;             // variable list argument pointer
     118
     119    // Get the variable list parameters to pass to logging function
     120    va_start(argPtr, fmt);
     121
     122    psLogMsgV(msgName, PS_LOG_WARN, fmt, argPtr);
     123
     124    // Clean up stack after variable argument has been used
     125    va_end(argPtr);
     126
     127    return;
    105128}
    106129
  • trunk/psLib/src/sys/psError.h

    r3264 r3476  
    1212 *  @author Eric Van Alst, MHPCC
    1313 *
    14  *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-02-17 19:26:24 $
     14 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2005-03-22 21:52:49 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    106106#endif
    107107
     108#ifdef DOXYGEN
    108109/** Reports an error message to the logging facility
    109110 *
     
    116117 *  @return psErrorCode    the given error code
    117118 */
    118 #ifdef DOXYGEN
    119119psErrorCode psError(
    120120    psErrorCode code,                  ///< Error class code
    121121    psBool new,                        ///< true if error originates at this location
     122    const char* fmt,
     123    ...
     124);
     125
     126/** Logs a warning message.
     127 *
     128 *  This procedure logs a message to the destination set by a prior
     129 *  call to psLogSetDestination(), This is equivalent to calling
     130 *  psLogMsg with a level of PS_LOG_WARN.
     131 *
     132 */
     133void psWarning(
    122134    const char* fmt,
    123135    ...
     
    133145    ...
    134146);
     147void p_psWarning(
     148    const char* file,
     149    int lineno,
     150    const char* func,
     151    const char* fmt,
     152    ...
     153);
     154
    135155
    136156#ifndef SWIG
    137157#define psError(code,new,...) p_psError(__FILE__,__LINE__,__func__,code,new,__VA_ARGS__)
     158#define psWarning(...) p_psWarning(__FILE__,__LINE__,__func__,__VA_ARGS__)
    138159#endif
    139160
  • trunk/psLib/src/sys/psLogMsg.c

    r3264 r3476  
    1111 *  @author George Gusciora, MHPCC
    1212 *
    13  *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-02-17 19:26:24 $
     13 *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-03-22 21:52:49 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    383383    va_end(ap);
    384384}
    385 void psWarning(const char* name, const char* fmt, ...)
    386 {
    387     va_list ap;
    388 
    389     va_start(ap, fmt);
    390     psLogMsgV(name, PS_LOG_WARN, fmt, ap);
    391     va_end(ap);
    392 }
  • trunk/psLib/src/sys/psLogMsg.h

    r3264 r3476  
    1111 *  @author George Gusciora, MHPCC
    1212 *
    13  *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-02-17 19:26:24 $
     13 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-03-22 21:52:49 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    102102};
    103103
    104 /** Logs a warning message.
    105  *
    106  *  This procedure logs a message to the destination set by a prior
    107  *  call to psLogSetDestination(), This is equivalent to calling
    108  *  psLogMsg with a level of PS_LOG_WARN.
    109  *
    110  */
    111 void psWarning(
    112     const char* name,
    113     const char* fmt,
    114     ...
    115 );
    116 
    117104/// @}
    118105
  • trunk/psLib/src/sysUtils/psError.c

    r3264 r3476  
    1010 *  @author Eric Van Alst, MHPCC
    1111 *
    12  *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-02-17 19:26:24 $
     12 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-03-22 21:52:49 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    103103
    104104    return code;
     105}
     106
     107void p_psWarning(const char* file,
     108                 int lineno,
     109                 const char* func,
     110                 const char* fmt,
     111                 ...)
     112{
     113    char msgName[1024];
     114
     115    snprintf(msgName,1024,"%s (%s:%d)",func,file,lineno);
     116
     117    va_list argPtr;             // variable list argument pointer
     118
     119    // Get the variable list parameters to pass to logging function
     120    va_start(argPtr, fmt);
     121
     122    psLogMsgV(msgName, PS_LOG_WARN, fmt, argPtr);
     123
     124    // Clean up stack after variable argument has been used
     125    va_end(argPtr);
     126
     127    return;
    105128}
    106129
  • trunk/psLib/src/sysUtils/psError.h

    r3264 r3476  
    1212 *  @author Eric Van Alst, MHPCC
    1313 *
    14  *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-02-17 19:26:24 $
     14 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2005-03-22 21:52:49 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    106106#endif
    107107
     108#ifdef DOXYGEN
    108109/** Reports an error message to the logging facility
    109110 *
     
    116117 *  @return psErrorCode    the given error code
    117118 */
    118 #ifdef DOXYGEN
    119119psErrorCode psError(
    120120    psErrorCode code,                  ///< Error class code
    121121    psBool new,                        ///< true if error originates at this location
     122    const char* fmt,
     123    ...
     124);
     125
     126/** Logs a warning message.
     127 *
     128 *  This procedure logs a message to the destination set by a prior
     129 *  call to psLogSetDestination(), This is equivalent to calling
     130 *  psLogMsg with a level of PS_LOG_WARN.
     131 *
     132 */
     133void psWarning(
    122134    const char* fmt,
    123135    ...
     
    133145    ...
    134146);
     147void p_psWarning(
     148    const char* file,
     149    int lineno,
     150    const char* func,
     151    const char* fmt,
     152    ...
     153);
     154
    135155
    136156#ifndef SWIG
    137157#define psError(code,new,...) p_psError(__FILE__,__LINE__,__func__,code,new,__VA_ARGS__)
     158#define psWarning(...) p_psWarning(__FILE__,__LINE__,__func__,__VA_ARGS__)
    138159#endif
    139160
  • trunk/psLib/src/sysUtils/psLogMsg.c

    r3264 r3476  
    1111 *  @author George Gusciora, MHPCC
    1212 *
    13  *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-02-17 19:26:24 $
     13 *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-03-22 21:52:49 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    383383    va_end(ap);
    384384}
    385 void psWarning(const char* name, const char* fmt, ...)
    386 {
    387     va_list ap;
    388 
    389     va_start(ap, fmt);
    390     psLogMsgV(name, PS_LOG_WARN, fmt, ap);
    391     va_end(ap);
    392 }
  • trunk/psLib/src/sysUtils/psLogMsg.h

    r3264 r3476  
    1111 *  @author George Gusciora, MHPCC
    1212 *
    13  *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-02-17 19:26:24 $
     13 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-03-22 21:52:49 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    102102};
    103103
    104 /** Logs a warning message.
    105  *
    106  *  This procedure logs a message to the destination set by a prior
    107  *  call to psLogSetDestination(), This is equivalent to calling
    108  *  psLogMsg with a level of PS_LOG_WARN.
    109  *
    110  */
    111 void psWarning(
    112     const char* name,
    113     const char* fmt,
    114     ...
    115 );
    116 
    117104/// @}
    118105
Note: See TracChangeset for help on using the changeset viewer.