Do a 1D table lookup: Does some semi-expensive O(N) error checking first. If query value fall out of the domain, then the value at the corresponding edge of the domain is returned.
- Parameters
-
| [in] | domain | The domain, or set of x values |
| [in] | range | The range, or set of y values |
| [in] | value | The point in the domain to query, x |
- Returns
- A linearly interpolated value y, corresponding to the query, x
- Exceptions
-
| std::domain_error | If domain or range is empty |
| std::domain_error | If range is not the same size as domain |
| std::domain_error | If domain is not sorted |
| std::domain_error | If value is not finite (NAN or INF) |
- Template Parameters
-
| T | The type of the function, must be interpolatable |