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 classGridSurfaceInterpolator.MetaThe meta-bean forGridSurfaceInterpolator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BoundSurfaceInterpolatorbind(DoubleArray xValues, DoubleArray yValues, DoubleArray zValues)Binds this interpolator to a surface.booleanequals(Object obj)CurveExtrapolatorgetXExtrapolatorLeft()Gets the x-value left extrapolator.CurveExtrapolatorgetXExtrapolatorRight()Gets the x-value right extrapolator.CurveInterpolatorgetXInterpolator()Gets the x-value interpolator.CurveExtrapolatorgetYExtrapolatorLeft()Gets the y-value left extrapolator.CurveExtrapolatorgetYExtrapolatorRight()Gets the y-value right extrapolator.CurveInterpolatorgetYInterpolator()Gets the y-value interpolator.inthashCode()static GridSurfaceInterpolator.Metameta()The meta-bean forGridSurfaceInterpolator.GridSurfaceInterpolator.MetametaBean()static GridSurfaceInterpolatorof(CurveInterpolator xInterpolator, CurveExtrapolator xExtrapolatorLeft, CurveExtrapolator xExtrapolatorRight, CurveInterpolator yInterpolator, CurveExtrapolator yExtrapolatorLeft, CurveExtrapolator yExtrapolatorRight)Obtains an instance from the specified interpolators and extrapolators.static GridSurfaceInterpolatorof(CurveInterpolator xInterpolator, CurveExtrapolator xExtrapolator, CurveInterpolator yInterpolator, CurveExtrapolator yExtrapolator)Obtains an instance from the specified interpolators and extrapolators.static GridSurfaceInterpolatorof(CurveInterpolator xInterpolator, CurveInterpolator yInterpolator)Obtains an instance from the specified interpolators, using flat extrapolation.StringtoString()
-
-
-
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:SurfaceInterpolatorBinds 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:
bindin 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:
metaBeanin 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
-
-