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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! # nolan (`hyperjet`) — forward-mode automatic differentiation with const-generic jets
//!
//! Forward-mode automatic differentiation built around const-generic,
//! stack-allocated hyperdual numbers (*jets*): [`Jet1<N>`] for gradients,
//! [`Jet2<N, H>`] for full Hessians, and [`Jet3<N, H, T>`] for third-order
//! tensors. No `Vec`, no `Box`, no heap. The same function body type-checks
//! against `f64` (no derivatives), [`Jet1`] (gradients), [`Jet2`] (Hessians),
//! or [`Jet3`] (third-order tensors).
//!
//! ```
//! use hyperjet::jets::Jet1;
//!
//! let x = Jet1::<2>::variable(1.5, 0);
//! let y = Jet1::<2>::variable(2.0, 1);
//! let f = x * x + y;
//! assert_eq!(f.value, 4.25);
//! assert_eq!(f.grad, [3.0, 1.0]); // df/dx = 2x = 3, df/dy = 1
//! ```
//!
//! ## What's in the box
//!
//! - [`jets`] — `Jet1<N>` / `Jet2<N, H>` / `Jet3<N, H, T>` types and operator
//! impls. Stack-allocated, const-generic over parameter count.
//! - [`traits`] — `Differentiable`, `FirstOrder`, `SecondOrder`, `ThirdOrder`,
//! `DifferentiableMath`, `AutoDiff` — write functions once, run with any
//! jet order.
//! - [`differentiate`] — convenience wrappers (`differentiate1`,
//! `differentiate2_6`, `differentiate3_9`, runtime-dispatched
//! `differentiate_dyn_*`) that hide the jet seeding + extraction
//! boilerplate.
//! - [`linalg`] — stack-allocated generic matrix operations (`mat_solve`,
//! `mat_inv`, `mat_cholesky`, eigendecomposition, condition number,
//! covariance regularization) that compose with any jet order.
//! - [`statistics`] — multivariate Gaussian primitives (sigma points,
//! Gaussian-mixture splitting, sample statistics) and scalar distributions
//! (`ln_gamma`, `chi2_sf`, etc.).
//! - [`grids`] — `linspace`, `logspace`, `linear_clamped`.
//! - [`angles`] — `wrap_pi`, `wrap_2pi`, `wrap_180`, `wrap_360`.
//!
//! Built for astrodynamics (orbit determination, covariance propagation,
//! close-approach sensitivity analysis), but the core types are
//! domain-agnostic and useful anywhere exact stack-allocated forward-mode
//! derivatives matter: optimization, robotics inverse kinematics, physics
//! simulation, ML gradient checking, sensitivity analysis.
//!
//! [`Jet1`]: jets::Jet1
//! [`Jet2`]: jets::Jet2
//! [`Jet3`]: jets::Jet3
//! [`Jet1<N>`]: jets::Jet1
//! [`Jet2<N, H>`]: jets::Jet2
//! [`Jet3<N, H, T>`]: jets::Jet3
// Validate that every ```rust block in README.md compiles as a doctest.
// Blocks that reference undefined identifiers should be marked with
// `no_run` or `ignore`; blocks that are intended to be runnable are
// exercised by `cargo test --doc`.
;
/// Returns the full version string, e.g. "1.0.0+a3f7b2c" or "1.0.1-dev+f82c1a0-dirty".
///
/// Source builds inside the repo get the git-described version from `build.rs`.
/// Builds from the published crates.io tarball — which intentionally does not
/// ship `build.rs` — fall back to the static `CARGO_PKG_VERSION` so that
/// `hyperjet::version()` reports a clean release identifier (e.g. `"1.7.1"`)
/// to downstream callers.