I defined a convenience interpolator as an interpolation algorithm wrapped in a transform function. These interpolators follow this template:
Do you want to add this to the framework?
class WrappedInterpolator
{
Func<double,double> _func;
Func<double,double> _inverse;
IIntepolation _underlyingInterp;
Func<IEnumerable<double>, IEnumerable<double>, IIntepolation> _interpCreator;
WrappedInterpolator(IEnumerable<double> sampleX, IEnumerable<double> sampleY)
{
var transformY = sampleY.Select(i => _func(i));
_underlyingInterp = _interpCreator(sampleX, transformY);
}
double Interpolate(double t)
{
return _inverse(_underlyingInterp(t));
}
}
An example would be the LogLinear interpolator.Do you want to add this to the framework?