net.finmath.time
Interface TimeDiscretizationInterface
-
- All Superinterfaces:
- java.lang.Iterable<java.lang.Double>
- All Known Implementing Classes:
- Tenor, TimeDiscretization
public interface TimeDiscretizationInterface extends java.lang.Iterable<java.lang.Double>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description java.util.ArrayList<java.lang.Double>getAsArrayList()Return a clone of this time discretization asArrayList<Double>.double[]getAsDoubleArray()Return a clone of this time discretization asdouble[].intgetNumberOfTimes()intgetNumberOfTimeSteps()doublegetTime(int timeIndex)Returns the time for the given time index.intgetTimeIndex(double time)Returns the time index for the given time.intgetTimeIndexNearestGreaterOrEqual(double time)Returns the time index for the time in the time discretization which is the nearest to the given time, being greater or equal (i.e.intgetTimeIndexNearestLessOrEqual(double time)Returns the time index for the time in the time discretization which is the nearest to the given time, being less or equal (i.e.TimeDiscretizationInterfacegetTimeShiftedTimeDiscretization(double timeShift)Return a new time discretization where all time points have been shifted by a given time shift.doublegetTimeStep(int timeIndex)Returns the time step from the given time index to the next one.
-
-
-
Method Detail
-
getNumberOfTimes
int getNumberOfTimes()
- Returns:
- Returns the number of time discretization points.
-
getNumberOfTimeSteps
int getNumberOfTimeSteps()
- Returns:
- Returns the number of time steps (= number of discretization points-1).
-
getTime
double getTime(int timeIndex)
Returns the time for the given time index.- Parameters:
timeIndex- Time index- Returns:
- Returns the time for a given time index.
-
getTimeStep
double getTimeStep(int timeIndex)
Returns the time step from the given time index to the next one.- Parameters:
timeIndex- Time index- Returns:
- Returns the time step
-
getTimeIndex
int getTimeIndex(double time)
Returns the time index for the given time. If the given time is not in the time discretization the method returns a negative number being (-insertionPoint-1).- Parameters:
time- The time.- Returns:
- Returns the time index for a given time.
-
getTimeIndexNearestLessOrEqual
int getTimeIndexNearestLessOrEqual(double time)
Returns the time index for the time in the time discretization which is the nearest to the given time, being less or equal (i.e. max(i : timeDiscretization[i] ≤ time where timeDiscretization[i] ≤ timeDiscretization[j]).- Parameters:
time- Given time.- Returns:
- Returns a time index
-
getTimeIndexNearestGreaterOrEqual
int getTimeIndexNearestGreaterOrEqual(double time)
Returns the time index for the time in the time discretization which is the nearest to the given time, being greater or equal (i.e. min(i : timeDiscretization[i] ≥ time where timeDiscretization[i] ≤ timeDiscretization[j]).- Parameters:
time- Given time.- Returns:
- Returns a time index
-
getAsDoubleArray
double[] getAsDoubleArray()
Return a clone of this time discretization asdouble[].- Returns:
- The time discretization as
double[]
-
getAsArrayList
java.util.ArrayList<java.lang.Double> getAsArrayList()
Return a clone of this time discretization asArrayList<Double>. Note that this method is costly in terms of performance.- Returns:
- The time discretization as
ArrayList<Double>
-
getTimeShiftedTimeDiscretization
TimeDiscretizationInterface getTimeShiftedTimeDiscretization(double timeShift)
Return a new time discretization where all time points have been shifted by a given time shift.- Parameters:
timeShift- A time shift applied to all discretization points.- Returns:
- A new time discretization where all time points have been shifted by the given time shift.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG