Class FiniteDifferenceSurfaceView
java.lang.Object
net.finmath.finitedifference.utilities.FiniteDifferenceSurfaceView
Lightweight view on a finite-difference value surface.
The view couples a raw finite-difference value surface with its
SpaceTimeDiscretization. It provides indexed access, spatial
interpolation, and dependency-free function adapters for plotting.
- Author:
- Alessandro Gnoatto
-
Constructor Summary
ConstructorsConstructorDescriptionFiniteDifferenceSurfaceView(SpaceTimeDiscretization discretization, double[][] values) Creates a surface view. -
Method Summary
Modifier and TypeMethodDescriptionasFunction1D(int timeIndex) Performs the operation.asFunction2D(int timeIndex, int xDimension, int yDimension, double... fixedCoordinates) Performs the operation.asPlotData1D(int timeIndex) Performs the operation.asPlotData1D(int timeIndex, int numberOfPoints, String title, String xAxisLabel, String yAxisLabel) Performs the operation.asPlotData2D(int timeIndex, int xDimension, int yDimension) Performs the operation.asPlotData2D(int timeIndex, int xDimension, int yDimension, int numberOfPointsX, int numberOfPointsY, String title, String xAxisLabel, String yAxisLabel, String zAxisLabel, double... fixedCoordinates) Performs the operation.Returns the value.Returns the value.double[]getTimeSlice(int timeIndex) Returns the value.doublegetValue(int timeIndex, int... indices) Returns the value.double[][]Returns the value.doubleinterpolate(double evaluationTime, double maturity, double... coordinates) Performs the operation.doubleinterpolate(int timeIndex, double... coordinates) Performs the operation.static FiniteDifferenceSurfaceViewof(SpaceTimeDiscretization discretization, double[][] values) Performs the operation.
-
Constructor Details
-
FiniteDifferenceSurfaceView
Creates a surface view.- Parameters:
discretization- The space-time discretization.values- The value surface indexed by flattened spatial index and time index.
-
-
Method Details
-
of
public static FiniteDifferenceSurfaceView of(SpaceTimeDiscretization discretization, double[][] values) Performs the operation.- Parameters:
discretization- The value.values- The value.- Returns:
- The value.
-
getValue
public double getValue(int timeIndex, int... indices) Returns the value.- Parameters:
timeIndex- The value.indices- The value.- Returns:
- The value.
-
interpolate
public double interpolate(int timeIndex, double... coordinates) Performs the operation.- Parameters:
timeIndex- The value.coordinates- The value.- Returns:
- The value.
-
interpolate
public double interpolate(double evaluationTime, double maturity, double... coordinates) Performs the operation.- Parameters:
evaluationTime- The value.maturity- The value.coordinates- The value.- Returns:
- The value.
-
getTimeSlice
public double[] getTimeSlice(int timeIndex) Returns the value.- Parameters:
timeIndex- The value.- Returns:
- The value.
-
asFunction1D
Performs the operation.- Parameters:
timeIndex- The value.- Returns:
- The value.
-
asFunction2D
public DoubleBinaryOperator asFunction2D(int timeIndex, int xDimension, int yDimension, double... fixedCoordinates) Performs the operation.- Parameters:
timeIndex- The value.xDimension- The value.yDimension- The value.fixedCoordinates- The value.- Returns:
- The value.
-
asPlotData1D
public FiniteDifferencePlotData1D asPlotData1D(int timeIndex, int numberOfPoints, String title, String xAxisLabel, String yAxisLabel) Performs the operation.- Parameters:
timeIndex- The value.numberOfPoints- The value.title- The value.xAxisLabel- The value.yAxisLabel- The value.- Returns:
- The value.
-
asPlotData1D
Performs the operation.- Parameters:
timeIndex- The value.- Returns:
- The value.
-
asPlotData2D
public FiniteDifferencePlotData2D asPlotData2D(int timeIndex, int xDimension, int yDimension, int numberOfPointsX, int numberOfPointsY, String title, String xAxisLabel, String yAxisLabel, String zAxisLabel, double... fixedCoordinates) Performs the operation.- Parameters:
timeIndex- The value.xDimension- The value.yDimension- The value.numberOfPointsX- The value.numberOfPointsY- The value.title- The value.xAxisLabel- The value.yAxisLabel- The value.zAxisLabel- The value.fixedCoordinates- The value.- Returns:
- The value.
-
asPlotData2D
Performs the operation.- Parameters:
timeIndex- The value.xDimension- The value.yDimension- The value.- Returns:
- The value.
-
getDiscretization
-
getValues
public double[][] getValues()Returns the value.- Returns:
- The value.
-
getLayout
-