![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Curve and time-series storage, interpolation, and integration. More...
Macros | |
| #define | _CRT_SECURE_NO_DEPRECATE |
Functions | |
| int | table_getNextFileEntry (TTable *table, double *x, double *y) |
| Read the next nonblank, noncomment time-series file record. | |
| int | table_parseFileLine (char *line, TTable *table, double *x, double *y) |
| Parse one mutable external time-series line, carrying forward omitted dates. | |
| double | table_interpolate (double x, double x1, double y1, double x2, double y2) |
| Linearly interpolate or extrapolate a table segment. | |
| int | table_readCurve (char *tok[], int ntoks) |
| Reads a tokenized line of data for a curve table. | |
| int | table_readTimeseries (char *tok[], int ntoks) |
| Reads a tokenized line of data for a time series table. | |
| int | table_addEntry (TTable *table, double x, double y) |
| Adds a new x/y entry to a table. | |
| void | table_deleteEntries (TTable *table) |
| Deletes all x/y entries in a table. | |
| void | table_init (TTable *table) |
| Initializes properties when table is first created. | |
| int | table_validate (TTable *table) |
| Checks that table's x-values are in ascending order. | |
| int | table_getFirstEntry (TTable *table, double *x, double *y) |
| Retrieves the first x/y entry in a table. | |
| int | table_getNextEntry (TTable *table, double *x, double *y) |
| Retrieves the next x/y entry in a table. | |
| double | table_lookup (TTable *table, double x) |
| Retrieves the y-value corresponding to an x-value in a table, using interploation if necessary. | |
| double | table_getSlope (TTable *table, double x) |
| Retrieves the slope of the curve at the line segment containing x. | |
| double | table_lookupEx (TTable *table, double x) |
| Retrieves the y-value corresponding to an x-value in a table, using interploation if necessary within the table and linear extrapolation outside of the table. | |
| double | table_intervalLookup (TTable *table, double x) |
| Retrieves the y-value corresponding to the first table entry whose x-value is > x. | |
| double | table_inverseLookup (TTable *table, double y) |
| Retrieves the x-value corresponding to an y-value in a table, using interploation if necessary. | |
| double | table_getMaxY (TTable *table, double x) |
| Finds the largest y value in the initial non-decreasing portion of a table that appear before value x. | |
| double | table_getStorageVolume (TTable *table, double x) |
| Finds volume for a given depth in a Storage Curve table. | |
| double | table_getStorageDepth (TTable *table, double v) |
| Finds depth for a given volume in a Storage Curve table. | |
| void | table_tseriesInit (TTable *table) |
| Initializes the time bracket within a time series table. | |
| double | table_tseriesLookup (TTable *table, double x, char extend) |
| Retrieves the y-value corresponding to a time series date, using interploation if necessary. | |
Curve and time-series storage, interpolation, and integration.
| #define _CRT_SECURE_NO_DEPRECATE |
| int table_addEntry | ( | TTable * | table, |
| double | x, | ||
| double | y ) |
Adds a new x/y entry to a table.
| table | Pointer to a TTable structure. | |
| [in] | x | X value. |
| [in] | y | Y value. |
| void table_deleteEntries | ( | TTable * | table | ) |
Deletes all x/y entries in a table.
| table | Pointer to a TTable structure. |
| int table_getFirstEntry | ( | TTable * | table, |
| double * | x, | ||
| double * | y ) |
Retrieves the first x/y entry in a table.
| table | Pointer to a TTable structure. | |
| [out] | x | X-value of first table entry. |
| [out] | y | Y-value of first table entry. |
| double table_getMaxY | ( | TTable * | table, |
| double | x ) |
Finds the largest y value in the initial non-decreasing portion of a table that appear before value x.
| table | Pointer to a TTable structure. | |
| [in] | x | An x-value. |
| int table_getNextEntry | ( | TTable * | table, |
| double * | x, | ||
| double * | y ) |
Retrieves the next x/y entry in a table.
| table | Pointer to a TTable structure. | |
| [out] | x | X-value of next table entry. |
| [out] | y | Y-value of next table entry. |
| int table_getNextFileEntry | ( | TTable * | table, |
| double * | x, | ||
| double * | y ) |
Read the next nonblank, noncomment time-series file record.
| [in,out] | table | Non-null borrowed table; reads/advances its open file and may update lastDate through parsing. A null file pointer returns FALSE. |
| [out] | x | Non-null caller-owned SWMM calendar date/time in decimal days. |
| [out] | y | Non-null caller-owned time-series value in the table's native units. |
| double table_getSlope | ( | TTable * | table, |
| double | x ) |
Retrieves the slope of the curve at the line segment containing x.
| table | Pointer to a TTable structure. | |
| [in] | x | An x-value. |
| double table_getStorageDepth | ( | TTable * | table, |
| double | v ) |
Finds depth for a given volume in a Storage Curve table.
| table | Pointer to a TTable structure. | |
| [in] | v | A storage volume. |
| double table_getStorageVolume | ( | TTable * | table, |
| double | x ) |
Finds volume for a given depth in a Storage Curve table.
| table | Pointer to a TTable structure. | |
| [in] | x | A depth value. |
| void table_init | ( | TTable * | table | ) |
Initializes properties when table is first created.
| table | Pointer to a TTable structure. |
| double table_interpolate | ( | double | x, |
| double | x1, | ||
| double | y1, | ||
| double | x2, | ||
| double | y2 ) |
Linearly interpolate or extrapolate a table segment.
| [in] | x | Query coordinate in the same units as x1 and x2. |
| [in] | x1 | First endpoint coordinate. |
| [in] | y1 | First endpoint value. |
| [in] | x2 | Second endpoint coordinate. |
| [in] | y2 | Second endpoint value in the same units as y1. |
| double table_intervalLookup | ( | TTable * | table, |
| double | x ) |
Retrieves the y-value corresponding to the first table entry whose x-value is > x.
| table | Pointer to a TTable structure. | |
| [in] | x | An x-value. |
| double table_inverseLookup | ( | TTable * | table, |
| double | y ) |
Retrieves the x-value corresponding to an y-value in a table, using interploation if necessary.
| table | Pointer to a TTable structure. | |
| [in] | y | A y-value. |
| double table_lookup | ( | TTable * | table, |
| double | x ) |
Retrieves the y-value corresponding to an x-value in a table, using interploation if necessary.
| table | Pointer to a TTable structure. | |
| [in] | x | An x-value. |
| double table_lookupEx | ( | TTable * | table, |
| double | x ) |
Retrieves the y-value corresponding to an x-value in a table, using interploation if necessary within the table and linear extrapolation outside of the table.
| table | Pointer to a TTable structure. | |
| [in] | x | An x-value. |
| int table_parseFileLine | ( | char * | line, |
| TTable * | table, | ||
| double * | x, | ||
| double * | y ) |
Parse one mutable external time-series line, carrying forward omitted dates.
| [in,out] | line | Non-null writable null-terminated buffer; strtok inserts terminators and uses shared tokenization state. |
| [in,out] | table | Non-null borrowed table providing lastDate for two-field records; a three-field record updates lastDate after its date parses, even if a later time/value field fails. |
| [out] | x | Non-null caller-owned date/time in SWMM decimal days, assigned on success. |
| [out] | y | Non-null caller-owned value in table units, assigned on success. |
| int table_readCurve | ( | char * | tok[], |
| int | ntoks ) |
Reads a tokenized line of data for a curve table.
| tok | Array of string tokens. | |
| [in] | ntoks | Number of tokens. |
| int table_readTimeseries | ( | char * | tok[], |
| int | ntoks ) |
Reads a tokenized line of data for a time series table.
| tok | Array of string tokens. | |
| [in] | ntoks | Number of tokens. |
| void table_tseriesInit | ( | TTable * | table | ) |
Initializes the time bracket within a time series table.
| table | Pointer to a TTable structure. |
| double table_tseriesLookup | ( | TTable * | table, |
| double | x, | ||
| char | extend ) |
Retrieves the y-value corresponding to a time series date, using interploation if necessary.
| table | Pointer to a TTable structure. | |
| [in] | x | A date/time value. |
| [in] | extend | TRUE if time series extended on either end. |