pub struct FractionalIdeal { /* private fields */ }Expand description
A nonzero fractional ideal of an exact number-field order.
The ideal is stored as a canonical row-Hermite rational lattice in the
ambient field’s distinguished power basis. Construction from generators
forms their NumberFieldOrder-span; equality therefore compares ideals,
not the supplied generator list.
Implementations§
Source§impl FractionalIdeal
impl FractionalIdeal
Sourcepub fn new(
order: NumberFieldOrder,
generators: &[NumberFieldElement],
) -> Result<Self, FractionalIdealError>
pub fn new( order: NumberFieldOrder, generators: &[NumberFieldElement], ) -> Result<Self, FractionalIdealError>
Construct the fractional ideal generated over order by exact field elements.
Sourcepub fn order(&self) -> &NumberFieldOrder
pub fn order(&self) -> &NumberFieldOrder
The coefficient order of this ideal.
Sourcepub fn basis(&self) -> Vec<NumberFieldElement>
pub fn basis(&self) -> Vec<NumberFieldElement>
Canonical Z-basis of this fractional ideal.
Sourcepub fn contains(&self, element: &NumberFieldElement) -> bool
pub fn contains(&self, element: &NumberFieldElement) -> bool
Whether an exact field element lies in this fractional ideal.
Sourcepub fn is_integral(&self) -> bool
pub fn is_integral(&self) -> bool
Whether this fractional ideal is contained in its coefficient order.
Sourcepub fn as_ideal(&self) -> Result<Ideal<NumberFieldOrder>, FractionalIdealError>
pub fn as_ideal(&self) -> Result<Ideal<NumberFieldOrder>, FractionalIdealError>
View this value as a generic integral ideal when it lies in its order.
Sourcepub fn add(&self, other: &Self) -> Result<Self, FractionalIdealError>
pub fn add(&self, other: &Self) -> Result<Self, FractionalIdealError>
Sum of two fractional ideals of the same order.
Sourcepub fn mul(&self, other: &Self) -> Result<Self, FractionalIdealError>
pub fn mul(&self, other: &Self) -> Result<Self, FractionalIdealError>
Product of two fractional ideals of the same order.
Sourcepub fn norm(&self) -> Rational
pub fn norm(&self) -> Rational
Exact absolute ideal norm, extended multiplicatively to fractional ideals.
Sourcepub fn valuation(
&self,
prime: &PrimeIdeal<NumberFieldOrder>,
) -> Result<i64, IdealFactorizationError>
pub fn valuation( &self, prime: &PrimeIdeal<NumberFieldOrder>, ) -> Result<i64, IdealFactorizationError>
The signed P-adic valuation of this fractional ideal.
Sourcepub fn factor(
&self,
) -> Result<Vec<(PrimeIdeal<NumberFieldOrder>, i64)>, IdealFactorizationError>
pub fn factor( &self, ) -> Result<Vec<(PrimeIdeal<NumberFieldOrder>, i64)>, IdealFactorizationError>
Complete signed prime-ideal factorization in this maximal order.
The result is reconstructed exactly after moving negative powers to the left side, so no unchecked factor list can escape this method.
Sourcepub fn to_json(&self) -> Result<String, NoetherError>
pub fn to_json(&self) -> Result<String, NoetherError>
Serialize this exact ideal to canonical JSON.
Sourcepub fn from_json(value: &str) -> Result<Self, NoetherError>
pub fn from_json(value: &str) -> Result<Self, NoetherError>
Restore and validate an exact fractional ideal from canonical JSON.
Trait Implementations§
Source§impl Add<&FractionalIdeal> for &FractionalIdeal
impl Add<&FractionalIdeal> for &FractionalIdeal
Source§type Output = Result<FractionalIdeal, FractionalIdealError>
type Output = Result<FractionalIdeal, FractionalIdealError>
+ operator.Source§impl Clone for FractionalIdeal
impl Clone for FractionalIdeal
Source§fn clone(&self) -> FractionalIdeal
fn clone(&self) -> FractionalIdeal
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FractionalIdeal
impl Debug for FractionalIdeal
Source§impl<'de> Deserialize<'de> for FractionalIdeal
impl<'de> Deserialize<'de> for FractionalIdeal
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl Display for FractionalIdeal
impl Display for FractionalIdeal
Source§impl Mul<&FractionalIdeal> for &FractionalIdeal
impl Mul<&FractionalIdeal> for &FractionalIdeal
Source§type Output = Result<FractionalIdeal, FractionalIdealError>
type Output = Result<FractionalIdeal, FractionalIdealError>
* operator.Source§impl PartialEq for FractionalIdeal
impl PartialEq for FractionalIdeal
Source§impl SemanticType for FractionalIdeal
impl SemanticType for FractionalIdeal
Source§const TYPE_ID: &'static str = "noether/numthy/FractionalIdeal@1"
const TYPE_ID: &'static str = "noether/numthy/FractionalIdeal@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
Source§impl Serialize for FractionalIdeal
impl Serialize for FractionalIdeal
impl Eq for FractionalIdeal
Auto Trait Implementations§
impl !Freeze for FractionalIdeal
impl RefUnwindSafe for FractionalIdeal
impl Send for FractionalIdeal
impl Sync for FractionalIdeal
impl Unpin for FractionalIdeal
impl UnwindSafe for FractionalIdeal
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