InterpolationFunction

FunctionWithCachingFunction
[IoId("00000000-3D08-4B4E-83B6-6168413571D9")] public sealed class InterpolationFunction : FunctionWithCaching
Represents an immutable interpolated equation.

Constructors

InterpolationFunction

#
public InterpolationFunction()

InterpolationFunction

#
public InterpolationFunction(InterpolationAlgorithm algorithm, IEnumerable<Point2d> points)
Create a new interpolated equation from a collection of points.
algorithm (InterpolationAlgorithm)Algorithm to use.
points (IEnumerable<Point2d>)Sampling points.

InterpolationFunction

#
public InterpolationFunction(IReader reader)
reader (IReader)

Properties

Algorithm

#
public InterpolationAlgorithm Algorithm { get; }
Gets the interpolation algorithm for this equation.

Derivative

public sealed override Function Derivative { get; }
Gets a function which is the derivative of this function. The returned function may be either analytic or approximate.
inherited fromFunctionWithCaching

Integral

public sealed override Function Integral { get; }
Gets a function which is the indefinite integral of this function. The returned function may be analytic or approximate. Note that numeric approximation of indefinite integrals is a slow and not particularly high quality process.
inherited fromFunctionWithCaching

IsLimited

#
public bool IsLimited { get; }
Gets whether this interpolation is limited to only inside the x-range.

MaximumX

#
public double MaximumX { get; }
Gets the highest x-coordinate of all samples.

MinimumX

#
public double MinimumX { get; }
Gets the lowest x-coordinate of all samples.

Nomen

public sealed override Nomen Nomen { get; }
Gets a description of this function.
inherited fromFunctionWithCaching
Function.Nomen

Notation

public override string Notation { get; }
Gets the notation for this function. Notation is aimed at humans and does not need to return a parseable string.
inherited fromFunctionWithCaching

Samples

#
public Point2d[] Samples { get; }
Gets the samples for this interpolation.

Ui

#
public override FunctionUi Ui { get; }
Function.Ui

Methods

Asymptotes

public virtual Line[] Asymptotes()
Returns an array of *all* the non-vertical asymptotes for this function. This property may return both null and empty arrays, implying no asymptotes. Due to the nature of non-vertical asymptotes, there can only be a finite amount of them.
inherited fromFunction

AutoCoDomain

protected void AutoCoDomain(double x0, double x1, out double y0, out double y1, int samples = 100)
Compute the automatic codomain for a given domain.
inherited fromFunction
x0 (double)Domain start.
x1 (double)Domain end.
y0 (out double)Lowest value in codomain.
y1 (out double)Highest value in codomain.
samples (int = 100)Samples.

ComputeMonotoneCubicDerivatives

#
public static double[] ComputeMonotoneCubicDerivatives(double[] x, double[] y)
Compute the derivatives for monotonic hermite cubic interpolation.
x (double[])Sorted x values.
y (double[])Associated y values.
Array of derivatives.

DomainEstimate

#
public override void DomainEstimate(out double x0, out double x1, out double y0, out double y1)
x0 (out double)
x1 (out double)
y0 (out double)
y1 (out double)

EmitDerivative

protected virtual Function EmitDerivative()
Override this method to provide an analytic derivative.
inherited fromFunctionWithCaching

EmitIntegral

protected virtual Function EmitIntegral()
Override this method to provide an analytic indefinite integral.
inherited fromFunctionWithCaching

Holes

#
public override Interval[] Holes(double x0, double x1)
Returns a collection of domains for which this function is not defined. This method may return null or an empty array, implying no undefined domains. This method may also return domains outside of the specified interval.
x0 (double)Lower limit of query domain.
x1 (double)Upper limit of query domain.
Function.Holes

Integrate

#
public override double Integrate(double x0, double x1)
x0 (double)
x1 (double)

Poles

#
public override Pole[] Poles(double x0, double x1)
Returns an array of all the poles (i.e. vertical asymptotes) within a domain. This method may return both null and empty arrays, implying no poles. Furthermore this method may choose to return poles which fall outside of the given domain.
x0 (double)Lower limit of query domain.
x1 (double)Upper limit of query domain.
Function.Poles

Store

#
public override void Store(IWriter writer)
writer (IWriter)

Y

#
public override double Y(double x)
x (double)
Function.Y

YYYY

public double[] YYYY(double[] x)
Evaluate a large amount of values. Functions may choose to use multiple threads to perform this calculation. This method should not throw, instead every failed evaluation will be represented by a NaN value.
inherited fromFunction
x (double[])Value to evaluate.
Evaluation results. Array will contain double.NaN entries for failed evaluations.