TDMS
Time Domain Maxwell Solver
|
Executes an interpolation scheme. More...
#include <interpolation_methods.h>
Public Member Functions | |
InterpolationScheme (scheme_value value) | |
Construct a new interp Scheme object, by providing the scheme value. | |
scheme_value | get_priority () const |
Get the value object. | |
int | num_nonzero_coeffs () const |
Compute the number of non-zero coefficients in the interpolation scheme. | |
template<typename T > | |
T | interpolate (const T *v, const int offset=0) const |
Executes the interpolation scheme on the data provided. | |
bool | is_better_than (const InterpolationScheme &s) const |
Determines whether another interpScheme has greater value than this one. | |
Public Attributes | |
int | number_of_datapoints_to_left |
int | first_nonzero_coeff |
int | last_nonzero_coeff |
Private Attributes | |
scheme_value | priority |
double | scheme_coeffs [8] |
Executes an interpolation scheme.
The scheme that an instance executes is determined by the priority that is passed at construction.
InterpolationScheme::InterpolationScheme | ( | scheme_value | value | ) |
Construct a new interp Scheme object, by providing the scheme value.
value | A value associtated to one of the possible schemes |
scheme_value InterpolationScheme::get_priority | ( | ) | const |
Get the value object.
|
inline |
Executes the interpolation scheme on the data provided.
The interpolation schemes are all of the form interpolated_value = \sum_{i=0}^{7} scheme_coeffs[i] * v[i], so provided that the coefficients have been set correctly in construction (and the data gathered appropriately), we can run the same for loop for each interpolation scheme.
For slight speedup, the actual sum performed loops over those i such that 0 <= first_nonzero_coeff <= i <= last_nonzero_coeff <= 7.
v | Sample datapoints to use in interpolation; v[0] should be the first of 8 values |
offset | [Default 0] Read buffer from v[offset] rather than v[0] |
bool InterpolationScheme::is_better_than | ( | const InterpolationScheme & | s | ) | const |
Determines whether another interpScheme has greater value than this one.
s | The other interpScheme to compare against |
int InterpolationScheme::num_nonzero_coeffs | ( | ) | const |
Compute the number of non-zero coefficients in the interpolation scheme.