Trigivs
A Rust library for solving tridiagonal systems of linear equations using Givens rotations. This library is designed to work in both std and no_std environments, with optional heap allocation.
Features
The library supports three modes of operation, controlled by Cargo features:
| Feature | Description |
|---|---|
std |
Default mode. Uses standard heap allocation (Vec<T>). |
alloc |
Works in no_std environments but requires an allocator for heap usage. |
| None | Fully no_std mode. No heap allocation; uses fixed-size arrays only. |
Usage
Add trigivs to your Cargo.toml:
[]
= "0.2"
To use the library in no_std mode (no heap allocation):
[]
= { = "0.2", = false }
To use the library with heap allocation but without std:
[]
= { = "0.2", = false, = ["alloc"] }
Examples
use *;
Error Handling
SolverErrors:
InvalidDiagonals- The superdiagonal and subdiagonal must be equal in length and exactly one element shorter than the main diagonal.InvalidRhsSizing- The right-hand side (RHS) must match the length of the main diagonal.DivisionByZero- Division by zero was attempted during computation.
License
This project is licensed under the MIT License.