Class FiniteDifferenceSurfaceView

java.lang.Object
net.finmath.finitedifference.utilities.FiniteDifferenceSurfaceView

public final class FiniteDifferenceSurfaceView extends Object
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 Details

    • FiniteDifferenceSurfaceView

      public FiniteDifferenceSurfaceView(SpaceTimeDiscretization discretization, double[][] values)
      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

      public DoubleUnaryOperator asFunction1D(int timeIndex)
      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

      public FiniteDifferencePlotData1D asPlotData1D(int timeIndex)
      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

      public FiniteDifferencePlotData2D asPlotData2D(int timeIndex, int xDimension, int yDimension)
      Performs the operation.
      Parameters:
      timeIndex - The value.
      xDimension - The value.
      yDimension - The value.
      Returns:
      The value.
    • getDiscretization

      public SpaceTimeDiscretization getDiscretization()
      Returns the value.
      Returns:
      The value.
    • getValues

      public double[][] getValues()
      Returns the value.
      Returns:
      The value.
    • getLayout

      public FiniteDifferenceGridLayout getLayout()
      Returns the value.
      Returns:
      The value.