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
//! Allocation-free, `#![no_std]` streaming technical indicators.
//!
//! `wickra-embed-core` runs the Wickra indicator math where there is no operating
//! system and no heap — microcontrollers, FPGA soft-cores, HFT co-processors.
//! Every [`Indicator`] update is O(1) with a bounded worst case, keeps its state
//! inline in fixed-capacity buffers (no allocation), and produces the
//! **byte-for-byte identical** value the std [`wickra-core`] library produces on
//! a server.
//!
//! [`wickra-core`]: https://crates.io/crates/wickra-core
//!
//! # Design
//!
//! - **No heap.** Windowed indicators store their history in a const-generic
//! [`Ring`](ring::Ring) or a fixed array; nothing touches an allocator. The
//! window length is the const parameter `N` (e.g. [`Sma<20>`](Sma)).
//! - **No panics in the update path.** A panic on a microcontroller is a reset,
//! so the core never uses `unwrap`/`expect`/`unreachable!` on the hot path;
//! warmup and undefined states are expressed as `None`.
//! - **Deterministic to the bit.** The floating-point work is done in the exact
//! same order as `wickra-core` (rolling-sum add/subtract order, the periodic
//! reseed, the final `sum / period` division), so the result is identical on
//! `thumbv7em-none-eabihf`, `thumbv6m-none-eabi` and an x86-64 host alike. The
//! few transcendental ops (`abs`, `max`, fused multiply-add) route through a
//! single [`math`] switch point — std on a host, `libm` on bare metal — whose
//! two implementations are IEEE-754 identical.
//!
//! # Example
//!
//! ```
//! use wickra_embed_core::{Indicator, Sma};
//!
//! let mut sma = Sma::<3>::new();
//! let mut last = None;
//! for i in 0..10 {
//! last = sma.update(100.0 + f64::from(i));
//! }
//! assert!(last.is_some());
//! ```
pub use ;
pub use Candle;
pub use Indicator;
/// Crate version string (`CARGO_PKG_VERSION`), for the C ABI and diagnostics.