TDMS
Time Domain Maxwell Solver
All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
InterpolationScheme Class Reference

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 >
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]
 

Detailed Description

Executes an interpolation scheme.

The scheme that an instance executes is determined by the priority that is passed at construction.

Constructor & Destructor Documentation

◆ InterpolationScheme()

InterpolationScheme::InterpolationScheme ( scheme_value  value)

Construct a new interp Scheme object, by providing the scheme value.

Parameters
valueA value associtated to one of the possible schemes

Member Function Documentation

◆ get_priority()

scheme_value InterpolationScheme::get_priority ( ) const

Get the value object.

Returns
scheme_value

◆ interpolate()

template<typename T >
T InterpolationScheme::interpolate ( const T *  v,
const int  offset = 0 
) const
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.

Parameters
vSample 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]
Returns
double Interpolated value

◆ is_better_than()

bool InterpolationScheme::is_better_than ( const InterpolationScheme s) const

Determines whether another interpScheme has greater value than this one.

Parameters
sThe other interpScheme to compare against
Returns
true This scheme has greater value
false This scheme has lesser, or equal, value to s

◆ num_nonzero_coeffs()

int InterpolationScheme::num_nonzero_coeffs ( ) const

Compute the number of non-zero coefficients in the interpolation scheme.

Returns
int Number of non-zero coefficients in the interpolation scheme

The documentation for this class was generated from the following files: