pub struct RationalMatrix<const N: usize> { /* private fields */ }Expand description
Matrix with exact rational entries
Used to represent Weyl group elements as matrices. All operations use exact rational arithmetic (no floating point).
From certified Python implementation: ExactMatrix class
Implementations§
Source§impl<const N: usize> RationalMatrix<N>
impl<const N: usize> RationalMatrix<N>
Sourcepub fn identity() -> Self
pub fn identity() -> Self
Create identity matrix
§Examples
use atlas_embeddings::arithmetic::{RationalMatrix, Rational};
let id = RationalMatrix::<2>::identity();
assert_eq!(id.get(0, 0), Rational::new(1, 1));
assert_eq!(id.get(0, 1), Rational::new(0, 1));Sourcepub fn reflection(root: &RationalVector<N>) -> Self
pub fn reflection(root: &RationalVector<N>) -> Self
Create reflection matrix from root vector
Implements: R_α = I - 2(α ⊗ α)/⟨α,α⟩
This is the matrix representation of the reflection through the hyperplane perpendicular to α. Uses exact rational arithmetic.
From certified Python implementation: simple_reflection() method
§Panics
Panics if root has norm² = 0
Sourcepub fn multiply(&self, other: &Self) -> Self
pub fn multiply(&self, other: &Self) -> Self
Matrix multiplication (exact rational arithmetic)
Computes C = A × B where all operations are exact. This is the composition operation for Weyl group elements.
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Check if this is the identity matrix
Trait Implementations§
Source§impl<const N: usize> Clone for RationalMatrix<N>
impl<const N: usize> Clone for RationalMatrix<N>
Source§fn clone(&self) -> RationalMatrix<N>
fn clone(&self) -> RationalMatrix<N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const N: usize> Debug for RationalMatrix<N>
impl<const N: usize> Debug for RationalMatrix<N>
Source§impl<const N: usize> Display for RationalMatrix<N>
impl<const N: usize> Display for RationalMatrix<N>
Source§impl<const N: usize> Hash for RationalMatrix<N>
impl<const N: usize> Hash for RationalMatrix<N>
Source§impl<const N: usize> PartialEq for RationalMatrix<N>
impl<const N: usize> PartialEq for RationalMatrix<N>
impl<const N: usize> Eq for RationalMatrix<N>
impl<const N: usize> StructuralPartialEq for RationalMatrix<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for RationalMatrix<N>
impl<const N: usize> RefUnwindSafe for RationalMatrix<N>
impl<const N: usize> Send for RationalMatrix<N>
impl<const N: usize> Sync for RationalMatrix<N>
impl<const N: usize> Unpin for RationalMatrix<N>
impl<const N: usize> UnwindSafe for RationalMatrix<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more