optionstratlib-math
Generic numerical containers and algorithms of
OptionStratLib: 2D curves,
3D surfaces, and the construction, interpolation, arithmetic and metric
machinery they share. Nothing here knows about option chains, Greeks, pricing
or plotting; the crate depends only on optionstratlib-core and general
numeric crates.
| Module | Contents |
|---|---|
curves |
Curve, Point2D, Curvable, StatisticalCurve, CurveSpline |
surfaces |
Surface, Point3D, Surfacable |
geometrics |
Construction, linear / bilinear / cubic / spline interpolation, arithmetic, metric extraction |
error |
CurveError, SurfaceError, InterpolationError, MetricsError |
Coordinates are rust_decimal::Decimal, and arithmetic on them is checked.
Place in the workspace
- Depends on
optionstratlib-core. - Must not depend on
optionstratlib-pricing,-simulation,-market,-analytics,-strategies,-backtestand-visualization;make check-graphenforces the layering (ADR-0001 D9). - In the facade:
optionstratlib::{curves, surfaces, geometrics}and the math errors inoptionstratlib::error, under the facade featuremath. The facade paths are the same types as the paths here; the ownership map lists every one with its feature.
Moving from 0.21? The 0.22 architecture and adoption guide maps each redesign to its replacement workflow; 0.22 keeps no compatibility with 0.21.
Minimal example
use ;
use BTreeSet;
Runnable example
A runnable program that depends on this crate directly, with the smallest
dependency set and no facade, is osl-example-direct-math; make tree-example-direct-math
asserts its resolved graph.
Features
| Feature | Default | Effect |
|---|---|---|
schema |
no | Derives utoipa::ToSchema on math types and enables optionstratlib-core/schema |
Option-specific projections (BasicCurves, BasicSurfaces) live in the
analytics layer and plotting in visualization; most users get all of it
through the optionstratlib facade.
License
MIT