Class WIntegrator

java.lang.Object
com.polytechnik.freemoney.WIntegrator
Direct Known Subclasses:
WIntegratorLaguerre, WIntegratorLegendreShifted, WIntegratorMonomials

public abstract class WIntegrator extends Object
A simple accumulator with integration. Subclasses contain recurrent code for fast calculation of the moments. Basis recurrence relations used in WIntegratorMonomials correspond to QVMData, WIntegratorLaguerre correspond to QVMDataL, and WIntegratorLegendreShifted correspond to QVMDataP.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final double
    Time scale of integration measure.
    long
    The time the moments are calculated on.
    final double[][]
    Integration moments.
    final int
    Timeseries number.
    final int
    The number of moments <fQk> to calculate, k=0 … ntm-1.
    final double[]
    The sum[i] is the sum of all posted Fdt[i].
  • Constructor Summary

    Constructors
    Constructor
    Description
    WIntegrator(int ntm, double atau, int nobservables)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addSingleObservation(long currenttime, long t, double[] Fdt)
    Add a single observation at time t to all stored series.
    abstract void
    addSingleObservationToSomeObservables(long currenttime, long t, double[] Fdt, int staringSerieIndex)
    Add a single observation at time t to a range of stored series.
    abstract double
    getXFromTime(long currenttime, long t)
    Used internally to calculate basis function argument.
    abstract void
    The method shifts basis functions offset as the time progresses.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • currenttime_previous

      public long currenttime_previous
      The time the moments are calculated on.
    • ntm

      public final int ntm
      The number of moments <fQk> to calculate, k=0 … ntm-1.
    • nobservables

      public final int nobservables
      Timeseries number.
    • atau

      public final double atau
      Time scale of integration measure.
    • integration_moments

      public final double[][] integration_moments
      Integration moments. The integration_moments[i][k] is the Fdt[i]--th moments <F[i]Qk>.
    • sum

      public final double[] sum
      The sum[i] is the sum of all posted Fdt[i].
  • Constructor Details

    • WIntegrator

      public WIntegrator(int ntm, double atau, int nobservables)
      Parameters:
      ntm - The number of moments to caclucate.
      atau - Time scale.
      nobservables - The number of observables.
  • Method Details

    • getXFromTime

      public abstract double getXFromTime(long currenttime, long t)
      Used internally to calculate basis function argument.
    • updateSavedMomentsToNewTimeReference

      public abstract void updateSavedMomentsToNewTimeReference(long currenttime)
      The method shifts basis functions offset as the time progresses.
    • addSingleObservation

      public void addSingleObservation(long currenttime, long t, double[] Fdt)
      Add a single observation at time t to all stored series. No basis time-shift is performed, the updateSavedMomentsToNewTimeReference(long) should be called separately.
      Parameters:
      currenttime - Current time.
      t - Event time.
      Fdt - All observables, array dimension must be equal to the nobservables.
    • addSingleObservationToSomeObservables

      public abstract void addSingleObservationToSomeObservables(long currenttime, long t, double[] Fdt, int staringSerieIndex)
      Add a single observation at time t to a range of stored series. No basis time-shift is performed, the updateSavedMomentsToNewTimeReference(long) should be called separately.
      Parameters:
      currenttime - Current time.
      t - Event time.
      Fdt - The observables, to be added starting with staringSerieIndex (inclusive).
      staringSerieIndex - The serie index, the data will be added to integration_moments[staringSerieIndex]..integration_moments[staringSerieIndex+Fdt.length-1].