Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

psLookupTable.h File Reference


Detailed Description

This file defines the structure and functions for table lookups.

Author:
Ross Harman, MHPCC
Version:
Revision
1.12
Name
rel7
Date:
Date
2005/08/30 01:14:13
Copyright 2004 Maui High Performance Computing Center, University of Hawaii

Definition in file psLookupTable.h.

#include "psType.h"
#include "psVector.h"
#include "psArray.h"

Include dependency graph for psLookupTable.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  psLookupStatusType { PS_LOOKUP_SUCCESS = 0x0000, PS_LOOKUP_PAST_TOP = 0x0101, PS_LOOKUP_PAST_BOTTOM = 0x0102, PS_LOOKUP_ERROR = 0x0104 }
 Lookup table lookup status and error conditions. More...
enum  psParseErrorType { PS_PARSE_SUCCESS = 0x0000, PS_PARSE_ERROR_TYPE = 0x0101, PS_PARSE_ERROR_VALUE = 0x0102, PS_PARSE_ERROR_GENERAL = 0x0104 }
 Lookup table parse status and error conditions. More...

Functions

bool psMemCheckLookupTable (psPtr ptr)
 Checks the type of a particular pointer.
psLookupTablepsLookupTableAlloc (const char *filename, const char *format, long indexCol)
 Allocator for psLookupTable struct.
psArraypsVectorsReadFromFile (const char *filename, const char *format)
 Read vectors from file.
psLookupTablepsLookupTableImport (psLookupTable *table, const psArray *vectors, long indexCol)
 Import arrays of vectors into a table.
long psLookupTableRead (psLookupTable *table)
 Read lookup table.
double psLookupTableInterpolate (const psLookupTable *table, double index, long column)
 Lookup and interpolate value from table.
psVectorpsLookupTableInterpolateAll (const psLookupTable *table, double index)
 Lookup and interpolate all values from table.


Enumeration Type Documentation

enum psLookupStatusType
 

Lookup table lookup status and error conditions.

Success, failure, and status conditions for table lookups.

Enumeration values:
PS_LOOKUP_SUCCESS  Table lookup succeeded.
PS_LOOKUP_PAST_TOP  Lookup off top of table.
PS_LOOKUP_PAST_BOTTOM  Lookup off bottom of table.
PS_LOOKUP_ERROR  Any other type of lookup error.

Definition at line 45 of file psLookupTable.h.

enum psParseErrorType
 

Lookup table parse status and error conditions.

Success, failure, and status conditions for table parsing.

Enumeration values:
PS_PARSE_SUCCESS  Table lookup succeeded.
PS_PARSE_ERROR_TYPE  Error parsing type.
PS_PARSE_ERROR_VALUE  Error parsing numerical value.
PS_PARSE_ERROR_GENERAL  Any other type of lookup error.

Definition at line 56 of file psLookupTable.h.


Function Documentation

psLookupTable* psLookupTableAlloc const char *  filename,
const char *  format,
long  indexCol
 

Allocator for psLookupTable struct.

Allocates a new psLookupTable struct.

Returns:
psLookupTable* New psLookupTable struct.
Parameters:
filename  Name of file to read
format  scanf-like format string
indexCol  Column of the index vector (starting at zero)

psLookupTable* psLookupTableImport psLookupTable table,
const psArray vectors,
long  indexCol
 

Import arrays of vectors into a table.

Import array of vectors read from text file into a table structure

Returns:
psLookupTable* Lookup table structure with array vector data
Parameters:
table  Lookup table into which to import
vectors  Array of vectors
indexCol  Index of the index vector in the array of vectors

double psLookupTableInterpolate const psLookupTable table,
double  index,
long  column
 

Lookup and interpolate value from table.

Interpolates value from table. Sets status bit for success or one of several possible failure conditions.

Returns:
double Interpolation value at index
Parameters:
table  Table with data
index  Value to be interpolated
column  Column in table to be interpolated

psVector* psLookupTableInterpolateAll const psLookupTable table,
double  index
 

Lookup and interpolate all values from table.

Interpolates all values from table. Sets status bit for success or one of several possible failure conditions.

Returns:
psVector* Interpolation values calculated at index
Parameters:
table  Table with data
index  Value to be interpolated

long psLookupTableRead psLookupTable table  ) 
 

Read lookup table.

Reads a lookup table and fills corresponding psLookupTable struct.

Returns:
long: Number of valid lines read
Parameters:
table  Table to read

bool psMemCheckLookupTable psPtr  ptr  ) 
 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psLookupTable structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

psArray* psVectorsReadFromFile const char *  filename,
const char *  format
 

Read vectors from file.

Read numeric vectors from ASCII text file

Returns:
psArray* New array of psVectors corresponding to the columns of the table
Parameters:
filename  File to be read
format  scanf-like format string


Generated on Wed Sep 14 10:43:18 2005 for Pan-STARRS Foundation Library by  doxygen 1.4.2