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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
//! # one-indexed-vec
//!
//! Scientific computing library with 1-based indexing.
//!
//! Built on the [`Vec1`] type — a `Vec`-like container whose first element
//! lives at index `1`, matching mathematical notation and the conventions
//! of Fortran, MATLAB, and Julia.
//!
//! ## Modules
//!
//! | Module | Feature | Description |
//! |--------|---------|-------------|
//! | [`vec1_core`] | always | The 1-based container and [`Index1`] |
//! | [`math`] | `math` | Sequences, series, Fourier analysis, orthogonal polynomials |
//! | [`numerical`] | `numerical` | Basic numeric ops, integration, ODEs, root finding |
//! | [`linear`] | `linear` | Matrices, decompositions, eigenvalues |
//! | [`signal`] | `signal` | Filters, window functions, correlation |
//! | [`stats`] | `stats` | Descriptive statistics, regression, distributions |
//! | [`physics`] | `physics` | Quantum mechanics, thermodynamics, optics |
//! | [`chemistry`] | `chemistry` | Atomic data, kinetics, thermodynamics |
//!
//! ## Quick start
//!
//! ```rust
//! use one_indexed_vec::{Vec1, vec1};
//!
//! let v = vec1![1.0, 2.0, 3.0, 4.0, 5.0];
//! assert_eq!(v[1], 1.0);
//! assert_eq!(v.sum(), 15.0);
//! assert_eq!(v.mean(), 3.0);
//! ```
//!
//! ## Migration from 0.1.x
//!
//! In `0.1.x` the container was called `VecIndexFromOne<T>`. As of `0.2.0`,
//! the canonical name is [`Vec1`]. The old name is retained as a deprecated
//! type alias for backward compatibility.
//!
//! ```rust
//! #![allow(deprecated)]
//! use one_indexed_vec::VecIndexFromOne;
//!
//! let v = VecIndexFromOne::from(vec![1, 2, 3]);
//! assert_eq!(v[1], 1);
//! ```
//!
//! Numeric algorithms that previously lived under `one_indexed_vec::ops`
//! are now available as methods on [`Vec1`], grouped under the disciplinary
//! modules. The [`ops`] module is kept as an empty deprecated placeholder.
/* #[cfg(feature = "std")]
extern crate std; */
extern crate alloc;
// ============================================================================
// Modules
// ============================================================================
/// Core container: [`Vec1<T>`], the 1-based [`Index1`], and fundamental
/// numeric operations (`sum`, `mean`, `dot_product`, ...).
/// Mathematical formulas and algorithms: sequences, series, Fourier
/// analysis, orthogonal polynomials, FFT, combinatorics.
/// Numerical algorithms: integration, ODEs, root finding, optimization,
/// window operations, finite differences, sliding statistics.
/// Linear algebra: matrices, LU/QR/Cholesky decompositions, eigenvalues,
/// Gaussian elimination.
/// Signal processing: FIR/IIR filters, window functions, convolution,
/// correlation.
/// Statistics: descriptive statistics, correlation, regression,
/// probability distributions.
/// Physics: quantum mechanics, thermodynamics, optics.
/// Chemistry: atomic data, reaction kinetics, thermodynamics.
// ============================================================================
// Canonical names
// ============================================================================
pub use Vec1;
pub use Index1;
// `vec1!` is automatically exported at the crate root by `#[macro_export]`.
// ============================================================================
// Deprecated re-exports (0.1.x → 0.2.0)
// ============================================================================
/// Deprecated alias for [`Vec1`].
///
/// The container was renamed in `0.2.0`. Update your code to use [`Vec1`].
/// The alias will be removed in `1.0`.
pub type VecIndexFromOne<T> = ;
/// Deprecated re-export of numeric algorithms.
///
/// In `0.1.x`, all numeric algorithms lived under `one_indexed_vec::ops`.
/// They have been reorganized as methods on [`Vec1`] under the disciplinary
/// modules:
///
/// | Old location | New location |
/// |--------------|--------------|
/// | `ops::prefix_sum` | [`Vec1::prefix_sum`] |
/// | `ops::moving_average` | [`Vec1::moving_average`] |
/// | `ops::sliding_window_max` | [`Vec1::sliding_window_max`] |
/// | `ops::mean` | [`Vec1::mean`] |
/// | `ops::convolve` | [`Vec1::convolve`] |
///
/// This module is intentionally empty. It is kept only so that
/// `use one_indexed_vec::ops::*;` continues to compile without error.
/// New code should import [`Vec1`] directly — all methods are available on
/// the container.
// ============================================================================
// Crate-level tests
// ============================================================================