Class GridSurfaceInterpolator
- java.lang.Object
-
- com.opengamma.strata.market.surface.interpolator.GridSurfaceInterpolator
-
- All Implemented Interfaces:
SurfaceInterpolator
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class GridSurfaceInterpolator extends Object implements SurfaceInterpolator, org.joda.beans.ImmutableBean, Serializable
A surface interpolator that is based on two curve interpolators.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.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GridSurfaceInterpolator.Meta
The meta-bean forGridSurfaceInterpolator
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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 forGridSurfaceInterpolator
.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()
-
-
-
Method Detail
-
of
public static GridSurfaceInterpolator of(CurveInterpolator xInterpolator, CurveInterpolator yInterpolator)
Obtains an instance from the specified interpolators, using flat extrapolation.- Parameters:
xInterpolator
- the x-value interpolatoryInterpolator
- the y-value interpolator- Returns:
- the index
- Throws:
IllegalArgumentException
- if the name is not known
-
of
public static GridSurfaceInterpolator of(CurveInterpolator xInterpolator, CurveExtrapolator xExtrapolator, CurveInterpolator yInterpolator, CurveExtrapolator yExtrapolator)
Obtains an instance from the specified interpolators and extrapolators.- Parameters:
xInterpolator
- the x-value interpolatorxExtrapolator
- the x-value extrapolatoryInterpolator
- the y-value interpolatoryExtrapolator
- the y-value extrapolator- Returns:
- the index
- Throws:
IllegalArgumentException
- if the name is not known
-
of
public static GridSurfaceInterpolator of(CurveInterpolator xInterpolator, CurveExtrapolator xExtrapolatorLeft, CurveExtrapolator xExtrapolatorRight, CurveInterpolator yInterpolator, CurveExtrapolator yExtrapolatorLeft, CurveExtrapolator yExtrapolatorRight)
Obtains an instance from the specified interpolators and extrapolators.- Parameters:
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 extrapolator- Returns:
- the index
- Throws:
IllegalArgumentException
- if the name is not known
-
bind
public BoundSurfaceInterpolator bind(DoubleArray xValues, DoubleArray yValues, DoubleArray zValues)
Description copied from interface:SurfaceInterpolator
Binds this interpolator to a surface.The bind process takes the definition of the interpolator and combines it with the x-y-z values. This allows implementations to optimize interpolation calculations.
- Specified by:
bind
in interfaceSurfaceInterpolator
- Parameters:
xValues
- 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 surface- Returns:
- the bound interpolator
-
meta
public static GridSurfaceInterpolator.Meta meta()
The meta-bean forGridSurfaceInterpolator
.- Returns:
- the meta-bean, not null
-
metaBean
public GridSurfaceInterpolator.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getXInterpolator
public CurveInterpolator getXInterpolator()
Gets the x-value interpolator.- Returns:
- the value of the property
-
getXExtrapolatorLeft
public CurveExtrapolator getXExtrapolatorLeft()
Gets the x-value left extrapolator.- Returns:
- the value of the property
-
getXExtrapolatorRight
public CurveExtrapolator getXExtrapolatorRight()
Gets the x-value right extrapolator.- Returns:
- the value of the property
-
getYInterpolator
public CurveInterpolator getYInterpolator()
Gets the y-value interpolator.- Returns:
- the value of the property
-
getYExtrapolatorLeft
public CurveExtrapolator getYExtrapolatorLeft()
Gets the y-value left extrapolator.- Returns:
- the value of the property
-
getYExtrapolatorRight
public CurveExtrapolator getYExtrapolatorRight()
Gets the y-value right extrapolator.- Returns:
- the value of the property
-
-