|
| 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. More...
|
|
template<typename... Ts> |
void | addData (const Ts &... x) noexcept |
| Add entry. More...
|
|
void | addData (const std::array< T, N+1 > &x) noexcept |
| Add entry. More...
|
|
void | swap (const size_t a_columnOne, const size_t a_columnTwo) noexcept |
| Utility function for swapping columns. More...
|
|
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, const size_t a_column) noexcept |
| Utility function for truncating raw data along one of the variables (either dependent or independent). More...
|
|
void | setRangeStrategyLo (const LookupTable::OutOfRangeStrategy &a_strategy) noexcept |
| Set the out-of-range strategy on the low end. More...
|
|
void | setRangeStrategyHi (const LookupTable::OutOfRangeStrategy &a_strategy) noexcept |
| Set the out-of-range strategy on the high end. More...
|
|
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. More...
|
|
template<size_t K> |
T | interpolate (const T &a_x) const |
| Interpolation function for specific dependent variable K. More...
|
|
std::array< T, N+1 > | interpolate (const T &x) const |
| Interpolate whole table. More...
|
|
std::vector< std::array< T, N+1 > > & | getRawData () noexcept |
| Access function for raw data. More...
|
|
std::vector< std::array< T, N+1 > > & | getStructuredData () noexcept |
| Access function for structured data. More...
|
|
const std::vector< std::array< T, N+1 > > & | getRawData () const noexcept |
| Access function for raw data. More...
|
|
const std::vector< std::array< T, N+1 > > & | getStructuredData () const noexcept |
| Access function for structured data. More...
|
|
void | writeRawData (const std::string &a_file) const noexcept |
| Dump raw table data to file. More...
|
|
void | writeStructuredData (const std::string &a_file) const noexcept |
| Dump structured table data to file. More...
|
|
void | outputRawData (std::ostream &a_ostream=std::cout) const noexcept |
| Dump raw table data to output stream. More...
|
|
void | outputStructuredData (std::ostream &a_ostream=std::cout) const noexcept |
| Dump structured table data to file. More...
|
|
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
-
template<typename T , size_t N, typename I >
void LookupTable1D< T, N, I >::swap |
( |
const size_t |
a_columnOne, |
|
|
const size_t |
a_columnTwo |
|
) |
| |
|
inlinenoexcept |
Utility function for swapping columns.
This is done on the raw data – if the user wants to swap columns in the resampled/structured data then he needs to call this function first and then resample the table through prepareTable
- Parameters
-
[in] | a_columnOne | Column to swap. |
[in] | a_columnTwo | Column to swap. |
template<typename T , size_t N, typename I >
void LookupTable1D< T, N, I >::truncate |
( |
const T & |
a_min, |
|
|
const T & |
a_max, |
|
|
const 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. |