pub struct Lattice { /* private fields */ }Expand description
A positive-definite integral lattice presented by its Gram matrix.
The Gram presentation is the mathematical owner. Enumeration dispatches to
lattice-enum, whose search geometry, candidates, and norms use exact
FLINT-backed integer and rational arithmetic.
Implementations§
Source§impl Lattice
impl Lattice
Sourcepub fn from_gram(gram: Matrix<IntegerRing>) -> Result<Self, LatticeError>
pub fn from_gram(gram: Matrix<IntegerRing>) -> Result<Self, LatticeError>
Construct and validate a lattice from a symmetric positive-definite Gram matrix.
Sourcepub fn gram_matrix(&self) -> &Matrix<IntegerRing>
pub fn gram_matrix(&self) -> &Matrix<IntegerRing>
The exact integral Gram matrix.
Sourcepub fn shortest_vectors(
&self,
bound: Option<Integer>,
max_pairs: Option<usize>,
) -> Result<LatticeEnumeration, LatticeError>
pub fn shortest_vectors( &self, bound: Option<Integer>, max_pairs: Option<usize>, ) -> Result<LatticeEnumeration, LatticeError>
Enumerate one canonical representative from each ± pair up to a norm bound.
With no bound, this returns the complete shortest-vector shell. Supplying
max_pairs permits a deterministic prefix and bypasses the kernel’s
whole-ellipsoid work estimate. The returned value states whether that
prefix is complete. A rank-zero lattice accepts bounded empty-shell
queries but rejects the unbounded form because no nonzero minimum is
attained.
Sourcepub fn minimum_vector_configuration(
&self,
) -> Result<MinimumVectorConfiguration, LatticeError>
pub fn minimum_vector_configuration( &self, ) -> Result<MinimumVectorConfiguration, LatticeError>
Compute and certify the complete minimum-vector configuration.
Sourcepub fn closest_vectors(
&self,
target_numerators: &[i64],
target_denominator: i64,
max_count: Option<usize>,
) -> Result<ClosestLatticeVectors, LatticeError>
pub fn closest_vectors( &self, target_numerators: &[i64], target_denominator: i64, max_count: Option<usize>, ) -> Result<ClosestLatticeVectors, LatticeError>
Find every closest lattice vector to an exact rational target.
target_numerators / target_denominator gives coordinates in the Gram
presentation. Returned coordinates are currently word-sized; search
geometry, Gram arithmetic, distances and comparisons are exact and
arbitrary precision.
Trait Implementations§
Source§impl SemanticType for Lattice
impl SemanticType for Lattice
Source§const TYPE_ID: &'static str = "noether/linalg/Lattice@1"
const TYPE_ID: &'static str = "noether/linalg/Lattice@1"
Source§fn canonical_bytes(&self) -> Result<Vec<u8>, NoetherError>
fn canonical_bytes(&self) -> Result<Vec<u8>, NoetherError>
Source§fn describe() -> &'static TypeDescription
fn describe() -> &'static TypeDescription
impl Eq for Lattice
impl StructuralPartialEq for Lattice
Auto Trait Implementations§
impl Freeze for Lattice
impl RefUnwindSafe for Lattice
impl Send for Lattice
impl Sync for Lattice
impl Unpin for Lattice
impl UnwindSafe for Lattice
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more