public final class GridSurfaceInterpolator extends Object implements SurfaceInterpolator, org.joda.beans.ImmutableBean, Serializable
The surface parameters are divided into rows and columns based on the x-values and y-values. There must be at least two y-values for each x-value. In most cases, the parameters will form a rectangular grid.
The interpolation operates in two stages. First, the parameters are grouped into sets, each with the same x value. Second, the y curve interpolator is used on each set of y values. Finally, the x curve interpolator is used on the results of the y interpolation.
There should be at least two different y-values for each x-value. If there is only one, then the associated z-value will always be returned.
| Modifier and Type | Class and Description |
|---|---|
static class |
GridSurfaceInterpolator.Meta
The meta-bean for
GridSurfaceInterpolator. |
| Modifier and Type | Method and Description |
|---|---|
BoundSurfaceInterpolator |
bind(DoubleArray xValues,
DoubleArray yValues,
DoubleArray zValues)
Binds this interpolator to a surface.
|
boolean |
equals(Object obj) |
CurveExtrapolator |
getXExtrapolatorLeft()
Gets the x-value left extrapolator.
|
CurveExtrapolator |
getXExtrapolatorRight()
Gets the x-value right extrapolator.
|
CurveInterpolator |
getXInterpolator()
Gets the x-value interpolator.
|
CurveExtrapolator |
getYExtrapolatorLeft()
Gets the y-value left extrapolator.
|
CurveExtrapolator |
getYExtrapolatorRight()
Gets the y-value right extrapolator.
|
CurveInterpolator |
getYInterpolator()
Gets the y-value interpolator.
|
int |
hashCode() |
static GridSurfaceInterpolator.Meta |
meta()
The meta-bean for
GridSurfaceInterpolator. |
GridSurfaceInterpolator.Meta |
metaBean() |
static GridSurfaceInterpolator |
of(CurveInterpolator xInterpolator,
CurveExtrapolator xExtrapolatorLeft,
CurveExtrapolator xExtrapolatorRight,
CurveInterpolator yInterpolator,
CurveExtrapolator yExtrapolatorLeft,
CurveExtrapolator yExtrapolatorRight)
Obtains an instance from the specified interpolators and extrapolators.
|
static GridSurfaceInterpolator |
of(CurveInterpolator xInterpolator,
CurveExtrapolator xExtrapolator,
CurveInterpolator yInterpolator,
CurveExtrapolator yExtrapolator)
Obtains an instance from the specified interpolators and extrapolators.
|
static GridSurfaceInterpolator |
of(CurveInterpolator xInterpolator,
CurveInterpolator yInterpolator)
Obtains an instance from the specified interpolators, using flat extrapolation.
|
String |
toString() |
public static GridSurfaceInterpolator of(CurveInterpolator xInterpolator, CurveInterpolator yInterpolator)
xInterpolator - the x-value interpolatoryInterpolator - the y-value interpolatorIllegalArgumentException - if the name is not knownpublic static GridSurfaceInterpolator of(CurveInterpolator xInterpolator, CurveExtrapolator xExtrapolator, CurveInterpolator yInterpolator, CurveExtrapolator yExtrapolator)
xInterpolator - the x-value interpolatorxExtrapolator - the x-value extrapolatoryInterpolator - the y-value interpolatoryExtrapolator - the y-value extrapolatorIllegalArgumentException - if the name is not knownpublic static GridSurfaceInterpolator of(CurveInterpolator xInterpolator, CurveExtrapolator xExtrapolatorLeft, CurveExtrapolator xExtrapolatorRight, CurveInterpolator yInterpolator, CurveExtrapolator yExtrapolatorLeft, CurveExtrapolator yExtrapolatorRight)
xInterpolator - the x-value interpolatorxExtrapolatorLeft - the x-value left extrapolatorxExtrapolatorRight - the x-value right extrapolatoryInterpolator - the y-value interpolatoryExtrapolatorLeft - the y-value left extrapolatoryExtrapolatorRight - the y-value right extrapolatorIllegalArgumentException - if the name is not knownpublic BoundSurfaceInterpolator bind(DoubleArray xValues, DoubleArray yValues, DoubleArray zValues)
SurfaceInterpolatorThe bind process takes the definition of the interpolator and combines it with the x-y-z values. This allows implementations to optimize interpolation calculations.
bind in interface SurfaceInterpolatorxValues - the x-values of the surface, must be sorted from low to highyValues - the y-values of the surface, must be sorted from low to high within xzValues - the z-values of the surfacepublic static GridSurfaceInterpolator.Meta meta()
GridSurfaceInterpolator.public GridSurfaceInterpolator.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic CurveInterpolator getXInterpolator()
public CurveExtrapolator getXExtrapolatorLeft()
public CurveExtrapolator getXExtrapolatorRight()
public CurveInterpolator getYInterpolator()
public CurveExtrapolator getYExtrapolatorLeft()
public CurveExtrapolator getYExtrapolatorRight()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.