Mathematics
Crates with a mathematical aspect.
For most general-purpose math needs, nalgebra
⮳ (linear algebra) and rand
⮳ (random numbers) are excellent starting points. For graphics or game development, glam
⮳ is often preferred. For statistics, statrs
⮳ is comprehensive.If you're doing numerical computing, ndarray
⮳. There are also specific crates available for specialized areas like number theory or units of measurement.
Trigonometry
Recipe | Crates | Categories |
---|---|---|
Calculate the Side Length of a Triangle | ||
Verify that tan is Equal to sin Divided by cos | ||
Calculate the Distance Between two Points on Earth |
Linear Algebra
Vectors, matrices, eigenvalues, and eigenvectors. Key crates include:
nalgebra
⮳: A widely used and mature linear algebra library. Excellent for general-purpose linear algebra.glam
⮳: A fast and ergonomic linear algebra library designed for graphics and games. Often preferred in those contexts.ultraviolet
⮳: Another linear algebra library, with a focus on graphics.ndarray
⮳: For N-dimensional arrays.Essential for numerical computation and data analysis.nalgebra-lapack
⮳ provides LAPACK bindings for linear algebra operations.
Recipe | Crates | Categories |
---|---|---|
Calculate Vector Norms | ||
Add Matrices | ||
Multiply Matrices | ||
Multiply a Scalar with a Vector and a Matrix | ||
Invert a Matrix | ||
Compare Vectors | ||
(De)serialize a Matrix |
Probability and Statistics
Random variables, distributions, and hypothesis testing. Probabilistic models, stochastic processes, and statistical inference.
statrs
⮳: A comprehensive statistics library.rand
⮳: While primarily for random number generation,rand
⮳ also provides some statistical distributions and functions.
Recipe | Crates | Categories |
---|---|---|
Calculate Measures of Central Tendency | ||
Compute the Standard Deviation |
Random Number Generation
Generating random numbers for simulations, cryptography, etc.
rand
⮳: A popular and widely used random number generator crate.
Additional Numeric Types
num-bigint
⮳ for arbitrary-precision integers.num-rational
⮳ for rational numbers.num
⮳: A crate that provides numeric traits and other utilities.
Recipe | Crates | Categories |
---|---|---|
Abstract over Different Number Types | ||
Use Big Integers | ||
Use Big Decimals | ||
Sort Floats | ||
num-bigint | ||
num | ||
rug | ||
typenum |
Complex Numbers
num-complex
⮳ for working with complex numbers.
Recipe | Crates | Categories |
---|---|---|
Create Complex Numbers | ||
Add Complex Numbers | ||
Use Mathematical Functions on Complex Numbers |
Numerical Analysis
Numerical integration, differentiation, and root-finding.
rust-num
: numerical traits and operations.ndarray
⮳: numerical computations.
Optimization
Linear, nonlinear, and integer programming. Convex analysis. Game theory and decision-making models.
argmin
: A pure Rust optimization library.rust-lp
: linear programming.
Differential Equations
Ordinary and partial differential equations and dynamical systems. Stability analysis, chaos theory, and control systems.
ode
(solvers for ordinary differential equations).
Graph Theory
Graphs, networks, and shortest paths.
petgraph
⮳ (graph data structures and algorithms).
Discrete Mathematics
Combinatorics, set theory, and logic.
bit-set
(bit manipulation),regex
⮳ (pattern matching).
Units of Measurement
uom
⮳: A type-safe dimensional analysis library.
Related Topics
- Algorithms.
- Cryptography.
- Plotting and Graphing: Visualization.
- Randomness.
- Sorting.
Applications
- Classical Machine Learning.
- Deep Learning.
- Science.
- Geoscience
- Neuroscience.
- Robotics.
- Search.
- Simulation.