https://github.com/edgarbarrantes/field-matrix
A small Rust library to handle matrices made from elements of finite fields
https://github.com/edgarbarrantes/field-matrix
arkworks arkworks-rs matrix rust
Last synced: about 2 months ago
JSON representation
A small Rust library to handle matrices made from elements of finite fields
- Host: GitHub
- URL: https://github.com/edgarbarrantes/field-matrix
- Owner: EdgarBarrantes
- Created: 2023-03-04T06:59:15.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-13T22:47:25.000Z (about 2 years ago)
- Last Synced: 2025-03-14T23:47:49.501Z (about 2 months ago)
- Topics: arkworks, arkworks-rs, matrix, rust
- Language: Rust
- Homepage:
- Size: 19.5 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://crates.io/crates/field-matrix-utils)
# field-matrix-utils
Simple matrix library for Rust.
Used for use with Finite fields.Not safe for production use.
It was only done for educational purposes.## Example
```rust
// Arkworks has a macro to generate the modulus and generator for a finite field.
// Type F is field element for use in our matrix.
// You should be able to use any. This is just an example.
use ark_ff::{Fp64, MontBackend};
#[derive(ark_ff::MontConfig)]
#[modulus = "127"]
#[generator = "6"]
pub struct F127Config;
type F = Fp64>;// The good stuff starts here.
let a: Matrix = Matrix::new(vec![
vec![F::from(1), F::from(2)],
vec![F::from(3), F::from(4)],
]);
let b: Matrix = a.transpose();
let c: Matrix = a + b;
let d: Matrix = a * b;
let det: F = a.determinant();
...
```## Features:
- Addition
- Subtraction
- Multiplication
- Transpose
- Determinant
- Inverse
- Is square
- Adjoint
- LU decomposition
- Scalar multiplication
- Vector multiplication
- Sumation
- Get element at index
- Set element at index
- Is identity
- Equality
- Display
- Linear equations Ax = b for x solution