|
|
| LookupTable1D () noexcept |
| | Default constructor. Creates a table without any entries.
|
| |
|
virtual | ~LookupTable1D () noexcept=default |
| | Destructor (does nothing).
|
| |
|
void | reset () noexcept |
| | Reset everything.
|
| |
| template<size_t M, typename... Ts> |
| LookupTable1D< T, M, I > | slice (const Ts &... a_columns) const noexcept |
| | Slice this table, keeping only the user-specified columns.
|
| |
| template<typename... Ts> |
| void | addData (const Ts &... x) noexcept |
| | Add entry.
|
| |
| void | addData (const std::array< T, N+1 > &x) noexcept |
| | Add entry.
|
| |
| void | swap (size_t a_columnOne, size_t a_columnTwo) noexcept |
| | Utility function for swapping columns.
|
| |
| template<size_t K> |
| void | scale (const T &a_scale) noexcept |
| | Utility function which scales one of the columns (either dependent or independent variable)
|
| |
| void | truncate (const T &a_min, const T &a_max, size_t a_column) noexcept |
| | Utility function for truncating raw data along one of the variables (either dependent or independent).
|
| |
| void | setRangeStrategyLo (const LookupTable::OutOfRangeStrategy &a_strategy) noexcept |
| | Set the out-of-range strategy on the low end.
|
| |
| void | setRangeStrategyHi (const LookupTable::OutOfRangeStrategy &a_strategy) noexcept |
| | Set the out-of-range strategy on the high end.
|
| |
| void | prepareTable (const size_t &a_independentVariable, const size_t &a_numPoints, const LookupTable::Spacing &a_spacing) |
| | Turn the raw data into uniform data for fast lookup.
|
| |
| template<size_t K> |
| T | interpolate (const T &a_x) const |
| | Interpolation function for specific dependent variable K.
|
| |
| std::array< T, N+1 > | interpolate (const T &x) const |
| | Interpolate whole table.
|
| |
| std::vector< std::array< T, N+1 > > & | getRawData () noexcept |
| | Access function for raw data.
|
| |
| std::vector< std::array< T, N+1 > > & | getStructuredData () noexcept |
| | Access function for structured data.
|
| |
| const std::vector< std::array< T, N+1 > > & | getRawData () const noexcept |
| | Access function for raw data.
|
| |
| const std::vector< std::array< T, N+1 > > & | getStructuredData () const noexcept |
| | Access function for structured data.
|
| |
| void | writeRawData (const std::string &a_file) const noexcept |
| | Dump raw table data to file.
|
| |
| void | writeStructuredData (const std::string &a_file) const noexcept |
| | Dump structured table data to file.
|
| |
| void | outputRawData (std::ostream &a_ostream=std::cout) const noexcept |
| | Dump raw table data to output stream.
|
| |
| void | outputStructuredData (std::ostream &a_ostream=std::cout) const noexcept |
| | Dump structured table data to file.
|
| |
|
|
bool | m_isGood |
| | Check if data can be interpolated.
|
| |
|
LookupTable::OutOfRangeStrategy | m_rangeStrategyLo |
| | Out-of-range strategy on low end.
|
| |
|
LookupTable::OutOfRangeStrategy | m_rangeStrategyHi |
| | Out-of-range strategy on high end.
|
| |
|
std::tuple< LookupTable::Spacing, size_t, T, T, T > | m_grid |
| | Underlying 1D grid. This is populated when calling prepareTable.
|
| |
|
std::vector< std::array< T, N+1 > > | m_rawData |
| | Raw data.
|
| |
|
std::vector< std::array< T, N+1 > > | m_structuredData |
| | Structured data. This is populated when calling prepareTable.
|
| |
template<typename T = Real, size_t N = 1, typename I = std::enable_if_t<std::is_floating_point<T>::value>>
class LookupTable1D< T, N, I >
Class for interpolation of f = f(x) data in one independent variable x.
N is the number of additional dependent variables. T must be a floating point type (e.g., float, double)
template<typename T , size_t N, typename I >
template<size_t M, typename... Ts>
Slice this table, keeping only the user-specified columns.
This returns a new table with a reduced number of columns.
- Parameters
-
| [in] | a_columns | Column indices to include in the sliced table |
- Returns
- Sliced lookup table
template<typename T , size_t N, typename I >
| void LookupTable1D< T, N, I >::truncate |
( |
const T & |
a_min, |
|
|
const T & |
a_max, |
|
|
size_t |
a_column |
|
) |
| |
|
inlinenoexcept |
Utility function for truncating raw data along one of the variables (either dependent or independent).
This will discard (from the raw data) all data that fall outside the input interval. This is done on the raw data – the user will need to call prepareTable if the result should propagate into the resampled/structured data.
- Parameters
-
| [in] | a_min | Minimum value represented. |
| [in] | a_max | Maximum value represented. |
| [in] | a_column | Description |