Skip to main content

Crate one_indexed_vec

Crate one_indexed_vec 

Source
Expand description

§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

ModuleFeatureDescription
vec1_corealwaysThe 1-based container and Index1
mathmathSequences, series, Fourier analysis, orthogonal polynomials
numericalnumericalBasic numeric ops, integration, ODEs, root finding
linearlinearMatrices, decompositions, eigenvalues
signalsignalFilters, window functions, correlation
statsstatsDescriptive statistics, regression, distributions
physicsphysicsQuantum mechanics, thermodynamics, optics
chemistrychemistryAtomic data, kinetics, thermodynamics

§Quick start

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.

#![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.

Re-exports§

pub use vec1_core::Vec1;
pub use vec1_core::index1::Index1;

Modules§

chemistry
Chemistry: atomic data, reaction kinetics, thermodynamics. Chemistry: atomic data, kinetics, thermodynamics.
linear
Linear algebra: matrices, LU/QR/Cholesky decompositions, eigenvalues, Gaussian elimination. Linear algebra: matrices, decompositions, eigenvalues, solvers.
math
Mathematical formulas and algorithms: sequences, series, Fourier analysis, orthogonal polynomials, FFT, combinatorics. Mathematical formulas and algorithms with 1-based indexing.
numerical
Numerical algorithms: integration, ODEs, root finding, optimization, window operations, finite differences, sliding statistics.
opsDeprecated
Deprecated re-export of numeric algorithms.
physics
Physics: quantum mechanics, thermodynamics, optics. Physical formulas and constants with 1-based indexing.
signal
Signal processing: FIR/IIR filters, window functions, convolution, correlation. Signal processing: filters, window functions, correlation.
stats
Statistics: descriptive statistics, correlation, regression, probability distributions. Statistics: descriptive statistics, correlation, regression, distributions.
vec1_core
Core container: Vec1<T>, the 1-based Index1, and fundamental numeric operations (sum, mean, dot_product, …). Core container: Vec1<T> — a 1-based Vec.

Macros§

vec1
Creates a Vec1 containing the given elements.

Type Aliases§

VecIndexFromOneDeprecated
Deprecated alias for Vec1.