use-linear
Install
[]
= "0.0.5"
= "0.0.5"
= "0.0.5"
Foundation
use-linear provides a deliberately small linear-algebra surface focused on
algorithms that compose the primitive crates. The current slice includes
solve_2x2 plus LinearError for explicit handling of singular or non-finite
systems. Matrix primitives live in use-matrix, and vector primitives live in
use-vector.
| Helper group | Primary items | Best fit |
|---|---|---|
| Solves and error handling | solve_2x2, LinearError |
Small systems where singular behavior should stay explicit |
| Neighbor primitives | use-matrix, use-vector |
Call sites that want focused matrix and vector ownership boundaries |
When to use directly
Choose use-linear directly when solve-oriented helpers are the only linear
surface you need and you want primitive ownership to stay in neighboring crates.
| Scenario | Use use-linear directly? |
Why |
|---|---|---|
| You need explicit handling of singular 2×2 solves | Yes | The API keeps solve failures visible through LinearError |
| You want matrix and vector types to stay in focused crates | Yes | use-linear composes use-matrix and use-vector instead of redefining them |
| You also need geometry, calculus, or other math domains | Usually no | use-math can compose the concrete surfaces behind features |
Scope
use-matrixowns matrix primitives and direct matrix operations.use-vectorowns vector primitives and vector operations.use-linearowns higher-level linear algorithms over those primitives.- The crate intentionally does not define its own matrix/vector types, geometry transforms, or decomposition frameworks.
Examples
Solving a 2x2 system
use solve_2x2;
use Matrix2;
use Vector2;
let matrix = new;
let rhs = new;
assert_eq!;
# Ok::
Handling singular systems
use ;
use Matrix2;
use Vector2;
let matrix = new;
let rhs = new;
assert_eq!;
Status
use-linear is a concrete pre-1.0 crate in the RustUse math workspace. The
API remains intentionally small while use-matrix and use-vector own the
primitive surface and adjacent crates continue to grow around them.