Changeset 11710
- Timestamp:
- Feb 8, 2007, 11:57:02 AM (19 years ago)
- Location:
- trunk/psLib/src/types
- Files:
-
- 2 edited
-
psLookupTable.c (modified) (5 diffs)
-
psLookupTable.h (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/types/psLookupTable.c
r11674 r11710 7 7 * @author Ross Harman, MHPCC 8 8 * 9 * @version $Revision: 1.4 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2007-02-0 7 01:15:50$9 * @version $Revision: 1.48 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2007-02-08 21:57:02 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 285 285 286 286 287 psLookupTable* psLookupTableAlloc(const char *filename, 288 const char *format, 289 long indexCol) 287 psLookupTable* p_psLookupTableAlloc(const char *file, 288 unsigned int lineno, 289 const char *func, 290 const char *filename, 291 const char *format, 292 long indexCol) 290 293 { 291 294 // Can't read table if you don't know its name … … 298 301 299 302 // Allocate lookup table 300 outTable = (psLookupTable*)p sAlloc(sizeof(psLookupTable));303 outTable = (psLookupTable*)p_psAlloc(file, lineno, func, sizeof(psLookupTable)); 301 304 302 305 // Set deallocator … … 608 611 } 609 612 610 psLookupTable *psLookupTableImport(psLookupTable *table, 611 const psArray *vectors, 612 long indexCol) 613 psLookupTable *p_psLookupTableImport(const char *file, 614 unsigned int lineno, 615 const char *func, 616 psLookupTable *table, 617 const psArray *vectors, 618 long indexCol) 613 619 { 614 620 psLookupTable* outputTable = NULL; … … 618 624 619 625 // Check for NULL input table 626 // XXX table/outputtable should be allocated if NULL 620 627 PS_ASSERT_PTR_NON_NULL(table,NULL); 621 628 -
trunk/psLib/src/types/psLookupTable.h
r11248 r11710 6 6 * @author Ross Harman, MHPCC 7 7 * 8 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-0 1-23 22:47:23$8 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-02-08 21:57:02 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 53 53 } psLookupStatusType; 54 54 55 55 56 /** Lookup table parse status and error conditions 56 57 * … … 64 65 }psParseErrorType; 65 66 67 66 68 /** Checks the type of a particular pointer. 67 69 * 68 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 70 * Uses the appropriate deallocation function in psMemBlock to check the ptr 71 * datatype. 69 72 * 70 * @return bool: True if the pointer matches a psLookupTable structure, false otherwise. 73 * @return bool: True if the pointer matches a psLookupTable structure, 74 * false otherwise. 71 75 */ 72 76 bool psMemCheckLookupTable( … … 81 85 * @return psLookupTable* New psLookupTable struct. 82 86 */ 87 #ifdef DOXYGEN 83 88 psLookupTable* psLookupTableAlloc( 84 89 const char *filename, ///< Name of file to read … … 86 91 long indexCol ///< Column of the index vector (starting at zero) 87 92 ); 93 #else // ifdef DOXYGEN 94 psLookupTable* p_psLookupTableAlloc( 95 const char *file, ///< File of caller 96 unsigned int lineno, ///< Line number of caller 97 const char *func, ///< Function name of caller 98 const char *filename, ///< Name of file to read 99 const char *format, ///< scanf-like format string 100 long indexCol ///< Column of the index vector (starting at zero) 101 ); 102 #define psLookupTableAlloc(filename, format, indexCol) \ 103 p_psLookupTableAlloc(__FILE__, __LINE__, __func__, filename, format, indexCol) 104 #endif // ifdef DOXYGEN 105 88 106 89 107 /** Read vectors from file … … 98 116 ); 99 117 118 100 119 /** Import arrays of vectors into a table 101 120 * … … 104 123 * @return psLookupTable* Lookup table structure with array vector data 105 124 */ 125 #ifdef DOXYGEN 106 126 psLookupTable *psLookupTableImport( 107 127 psLookupTable *table, ///< Lookup table into which to import … … 109 129 long indexCol ///< Index of the index vector in the array of vectors 110 130 ); 131 #else // ifdef DOXYGEN 132 psLookupTable *p_psLookupTableImport( 133 const char *file, ///< File of caller 134 unsigned int lineno, ///< Line number of caller 135 const char *func, ///< Function name of caller 136 psLookupTable *table, ///< Lookup table into which to import 137 const psArray *vectors, ///< Array of vectors 138 long indexCol ///< Index of the index vector in the array of vectors 139 ); 140 #define psLookupTableImport(table, vectors, indexCol) \ 141 p_psLookupTableImport(__FILE__, __LINE__, __func__, table, vectors, indexCol) 142 #endif // ifdef DOXYGEN 143 111 144 112 145 /** Read lookup table … … 120 153 ); 121 154 155 122 156 /** Lookup and interpolate value from table. 123 157 * 124 * Interpolates value from table. Sets status bit for success or one of several possible failure125 * conditions.158 * Interpolates value from table. Sets status bit for success or one of 159 * several possible failure conditions. 126 160 * 127 161 * @return double Interpolation value at index … … 133 167 ); 134 168 169 135 170 /** Lookup and interpolate all values from table. 136 171 * 137 * Interpolates all values from table. Sets status bit for success or one of several possible failure138 * conditions.172 * Interpolates all values from table. Sets status bit for success or one of 173 * several possible failure conditions. 139 174 * 140 175 * @return psVector* Interpolation values calculated at index … … 145 180 ); 146 181 182 147 183 /// @} 148 184 #endif // #ifndef PS_LOOKUPTABLE_H
Note:
See TracChangeset
for help on using the changeset viewer.
