1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! The abstract numerical-method (lattice) interface.
//!
//! Port of `ql/numericalmethod.hpp` (the `Lattice` base class). A `Lattice` owns
//! a [`TimeGrid`] and drives a [`DiscretizedAsset`] backward through it. The
//! concrete tree lattice (`TreeLattice`) lands in a follow-up ticket and
//! implements this trait.
//!
//! Divergence from QuantLib, all deliberate:
//! - The C++ methods return `void`/`Real`; here every driver method returns
//! [`QlResult`] so a lattice can surface a failure (unset state, out-of-range
//! rollback target) as an error rather than an assertion (D4/D10).
//! - The mutation direction is unchanged: the lattice mutates the asset, so the
//! asset is passed as `&mut dyn DiscretizedAsset`.
use crateDiscretizedAsset;
use crateQlResult;
use crateArray;
use crateTimeGrid;
use crate;
/// Lattice (tree, finite-differences) base interface (`numericalmethod.hpp:37`).
///
/// Implementors drive a [`DiscretizedAsset`] backward over the owned
/// [`TimeGrid`]. Users are advised to call the corresponding
/// [`DiscretizedAsset`] methods rather than these directly.