IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 8, 2004, 2:38:14 PM (22 years ago)
Author:
harman
Message:

Added psLookupTable code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataIO/psLookupTable.h

    r2195 r2302  
    77*  @author Ross Harman, MHPCC
    88*
    9 *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2004-10-26 00:37:15 $
     9*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2004-11-09 00:38:14 $
    1111*
    1212*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1515#ifndef PS_LOOKUPTABLE_H
    1616#define PS_LOOKUPTABLE_H
     17
     18#include "psType.h"
     19#include "psVector.h"
     20#include "psArray.h"
    1721
    1822
     
    2428typedef struct
    2529{
     30    const char *fileName;              ///< Name of file with table
     31    psU64 numRows;                     ///< Number of table rows
     32    psU64 numCols;                     ///< Number of table columns
     33    psF64 validFrom;                   ///< Lower bound for rable read
     34    psF64 validTo;                     ///< Upper bound for table read
    2635    psVector *index;                   ///< Vector of independent index values
    27     psArray *values;                   ///< Array of dependent table values corresponding to index values.
     36    psArray *values;                   ///< Array of dependent table values corresponding to index values
    2837}
    2938psLookupTable;
    3039
    3140
    32 /** Lookup error conditions
     41/** Lookup table lookup status and error conditions
    3342 *
    34  *  Success and failure conditions for table lookups.
     43 *  Success, failure, and status conditions for table lookups.
    3544 */
    3645typedef enum {
    37     PS_LOOKUP_SUCCESS = 0x000,         ///< Table lookup succeeded.
    38     PS_LOOKUP_TOP     = 0x0001,        ///< Lookup off top of table.
    39     PS_LOOKUP_BOTTOM  = 0x0002,        ///< Lookup off bottom of table.
    40     PS_LOOKUP_ERROR   = 0x0003,        ///< Any other type of lookup error.
    41 } psLookupErrorType;
     46    PS_LOOKUP_SUCCESS             = 0x0000,        ///< Table lookup succeeded
     47    PS_LOOKUP_PAST_TOP            = 0x0101,        ///< Lookup off top of table
     48    PS_LOOKUP_PAST_BOTTOM         = 0x0102,        ///< Lookup off bottom of table
     49    PS_LOOKUP_ERROR               = 0x0104         ///< Any other type of lookup error
     50} psLookupStatusType;
     51
     52/** Lookup table parse status and error conditions
     53 *
     54 *  Success, failure, and status conditions for table parsing.
     55 */
     56typedef enum {
     57    PS_PARSE_SUCCESS              = 0x0000,        ///< Table lookup succeeded
     58    PS_PARSE_ERROR_TYPE           = 0x0101,        ///< Error parsing type
     59    PS_PARSE_ERROR_VALUE          = 0x0102,        ///< Error parsing numerical value
     60    PS_PARSE_ERROR_GENERAL        = 0x0104         ///< Any other type of lookup error
     61}psParseErrorType;
    4262
    4363/** Allocator for psLookupTable struct
     
    4868 */
    4969psLookupTable* psLookupTableAlloc(
    50     psU64 numRows,                  ///< Number of rows
    51     psU64 numCols                   ///< number of columns
     70    const char *fileName,           ///< Name of file to read
     71    psF64 validFrom,                ///< Lower bound for rable read
     72    psF64 validTo                   ///< Upper bound for table read
    5273);
    5374
     
    5980 */
    6081psLookupTable* psLookupTableRead(
    61     char *fileName                  ///< Name of file to read
     82    psLookupTable *table            ///< Table to read
    6283);
    6384
     
    6788 *  conditions.
    6889 *
    69  *  @return psLookupTable*     New psLookupTable struct.
     90 *  @return psLookupTable*     New psLookupTable struct
    7091 */
    7192psF64 psLookupTableInterpolate(
    7293    psLookupTable *table,           ///< Table with data
    7394    psF64 index,                    ///< Value to be interpolated
    74     psMaskType *status              ///< Status of lookup.
     95    psU64 column,                   ///< Column in table to be interpolated
     96    psLookupStatusType *status      ///< Status of lookup
    7597);
    7698
     
    80102 *  conditions.
    81103 *
    82  *  @return psLookupTable*     New psLookupTable struct.
     104 *  @return psLookupTable*     New psLookupTable struct
    83105 */
    84 psVector* psLookupTableInterpolate(
     106psVector* psLookupTableInterpolateAll(
    85107    psLookupTable *table,           ///< Table with data
    86108    psF64 index,                    ///< Value to be interpolated
    87     psMaskType *status              ///< Status of lookup.
     109    psVector *stats                 ///< Vector of status for each lookup
    88110);
    89111
Note: See TracChangeset for help on using the changeset viewer.