aivika-4.2: A multi-paradigm simulation library

CopyrightCopyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Simulation.Aivika.Dynamics.Memo

Description

Tested with: GHC 7.10.1

This module defines memo functions. The memoization creates such Dynamics computations, which values are cached in the integration time points. Then these values are interpolated in all other time points.

Synopsis

Documentation

memoDynamics :: Dynamics e -> Simulation (Dynamics e) Source

Memoize and order the computation in the integration time points using the interpolation that knows of the Runge-Kutta method. The values are calculated sequentially starting from starttime.

memo0Dynamics :: Dynamics e -> Simulation (Dynamics e) Source

Memoize and order the computation in the integration time points using the discreteDynamics interpolation. It consumes less memory than the memoDynamics function but it is not aware of the Runge-Kutta method. There is a subtle difference when we request for values in the intermediate time points that are used by this method to integrate. In general case you should prefer the memo0Dynamics function above memoDynamics.

iterateDynamics :: Dynamics () -> Simulation (Dynamics ()) Source

Iterate sequentially the dynamic process with side effects in the integration time points. It is equivalent to a call of the memo0Dynamics function but significantly more efficient, for the array is not created.

unzipDynamics :: Dynamics (a, b) -> Simulation (Dynamics a, Dynamics b) Source

Memoize and unzip the computation of pairs, applying the memoDynamics function.

unzip0Dynamics :: Dynamics (a, b) -> Simulation (Dynamics a, Dynamics b) Source

Memoize and unzip the computation of pairs, applying the memo0Dynamics function.