pub struct PowerSeries<R: CommutativeRing> { /* private fields */ }Expand description
A fixed-truncation power series carrying its complete context.
Supported one-variable coefficient contexts keep an immutable FLINT polynomial as their primary representation. Clones share that storage, and the canonical sparse term view is materialized lazily only for inspection, serialization, or a generic algorithm. Multivariate and unsupported contexts retain the sparse truncation-aware representation.
Implementations§
Source§impl<R> PowerSeries<R>where
R: CommutativeRing + Display,
impl<R> PowerSeries<R>where
R: CommutativeRing + Display,
Sourcepub fn monomial_substitution(
&self,
monomial_map: &MonomialMap,
) -> Result<Self, SemilinearSubstitutionError>
pub fn monomial_substitution( &self, monomial_map: &MonomialMap, ) -> Result<Self, SemilinearSubstitutionError>
Substitute monomials and discard transformed terms outside the fixed cap.
Sourcepub fn semilinear_substitution<M>(
&self,
coefficient_map: &M,
monomial_map: &MonomialMap,
) -> Result<PowerSeries<M::Target>, SemilinearSubstitutionError>where
M: CoefficientMap<Source = R>,
pub fn semilinear_substitution<M>(
&self,
coefficient_map: &M,
monomial_map: &MonomialMap,
) -> Result<PowerSeries<M::Target>, SemilinearSubstitutionError>where
M: CoefficientMap<Source = R>,
Fuse monomial capping and coefficient mapping in one source-term stream.
A transformed exponent is rejected before its coefficient map is applied.
Sourcepub fn frobenius_lift(
&self,
exponent: u64,
) -> Result<Self, SemilinearSubstitutionError>where
R: CoefficientFrobeniusContext,
pub fn frobenius_lift(
&self,
exponent: u64,
) -> Result<Self, SemilinearSubstitutionError>where
R: CoefficientFrobeniusContext,
Apply coefficient Frobenius and x_i -> x_i^(p^exponent) with early capping.
Source§impl<R: CommutativeRing> PowerSeries<R>
impl<R: CommutativeRing> PowerSeries<R>
Sourcepub fn ring(&self) -> &PowerSeriesRing<R>
pub fn ring(&self) -> &PowerSeriesRing<R>
Exact power-series context carried by this value.
Sourcepub fn terms(&self) -> impl Iterator<Item = (&[u64], &R::Element)>
pub fn terms(&self) -> impl Iterator<Item = (&[u64], &R::Element)>
Nonzero terms in deterministic lexicographic exponent order.
Sourcepub fn map_coefficients<M>(
&self,
map: &M,
) -> Result<PowerSeries<M::Target>, CoefficientMappingError>where
M: CoefficientMap<Source = R>,
R: Display,
pub fn map_coefficients<M>(
&self,
map: &M,
) -> Result<PowerSeries<M::Target>, CoefficientMappingError>where
M: CoefficientMap<Source = R>,
R: Display,
Apply one checked scalar map to every retained coefficient while preserving variables, truncation identity, and exponents.
Sourcepub fn coefficient(
&self,
exponent: &[u64],
) -> Result<R::Element, PowerSeriesError>
pub fn coefficient( &self, exponent: &[u64], ) -> Result<R::Element, PowerSeriesError>
Coefficient at a retained exponent position.
Asking beyond the context’s precision is an error, not a zero coefficient claim.
Sourcepub fn constant_coefficient(&self) -> R::Element
pub fn constant_coefficient(&self) -> R::Element
Constant coefficient.
Sourcepub fn nonzero_term_count(&self) -> usize
pub fn nonzero_term_count(&self) -> usize
Number of stored nonzero coefficients.
Sourcepub fn to_json(&self) -> Result<String, NoetherError>
pub fn to_json(&self) -> Result<String, NoetherError>
Serialize this series with its complete fixed-precision context and terms.
Sourcepub fn from_json(value: &str) -> Result<Self, NoetherError>
pub fn from_json(value: &str) -> Result<Self, NoetherError>
Deserialize and revalidate the context, exponent region, and coefficients.
Sourcepub fn pow(&self, exponent: u64) -> Result<Self, ContextMismatchError>
pub fn pow(&self, exponent: u64) -> Result<Self, ContextMismatchError>
Raise this series to a nonnegative power in its fixed context.
Sourcepub fn scalar_mul(&self, scalar: &R::Element) -> Result<Self, PowerSeriesError>
pub fn scalar_mul(&self, scalar: &R::Element) -> Result<Self, PowerSeriesError>
Multiply every coefficient by one value from the coefficient ring.
Sourcepub fn derivative(&self, variable: usize) -> Result<Self, PowerSeriesError>
pub fn derivative(&self, variable: usize) -> Result<Self, PowerSeriesError>
Formal derivative with respect to one variable.
Sourcepub fn compose(&self, images: &[Self]) -> Result<Self, PowerSeriesError>
pub fn compose(&self, images: &[Self]) -> Result<Self, PowerSeriesError>
Substitute one image for each variable when the images preserve the truncation ideal.
Sourcepub fn inverse(&self) -> Result<Self, UnitError>where
R: UnitInversion,
pub fn inverse(&self) -> Result<Self, UnitError>where
R: UnitInversion,
Invert a series exactly when its constant coefficient is a unit.
Sourcepub fn exact_div(&self, divisor: &Self) -> Result<Self, PowerSeriesError>where
R: UnitInversion,
pub fn exact_div(&self, divisor: &Self) -> Result<Self, PowerSeriesError>where
R: UnitInversion,
Return the canonical exact quotient by a monomial times a unit series.
Fixed truncation makes division by a nonunit nonunique: coefficients
beyond the dividend’s retained region cannot be recovered. For a
divisor x^a u, with u(0) a unit, this method chooses the unique
quotient obtained by shifting the retained dividend by a, filling
the newly unknown boundary coefficients with zero, and dividing by
u. It verifies the result by multiplication in this exact quotient
ring. More general divisors are rejected rather than choosing a hidden
term order or quotient lift.
Sourcepub fn restrict_truncation(
&self,
target: SeriesTruncation,
) -> Result<Self, PowerSeriesError>
pub fn restrict_truncation( &self, target: SeriesTruncation, ) -> Result<Self, PowerSeriesError>
Enter an explicitly coarser truncation context.
Trait Implementations§
Source§impl<R: CommutativeRing> Add<&PowerSeries<R>> for &PowerSeries<R>
impl<R: CommutativeRing> Add<&PowerSeries<R>> for &PowerSeries<R>
Source§type Output = Result<PowerSeries<R>, ContextMismatchError>
type Output = Result<PowerSeries<R>, ContextMismatchError>
+ operator.Source§impl<R: Clone + CommutativeRing> Clone for PowerSeries<R>
impl<R: Clone + CommutativeRing> Clone for PowerSeries<R>
Source§fn clone(&self) -> PowerSeries<R>
fn clone(&self) -> PowerSeries<R>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<R: CommutativeRing> Debug for PowerSeries<R>
impl<R: CommutativeRing> Debug for PowerSeries<R>
Source§impl<'de, R> Deserialize<'de> for PowerSeries<R>
impl<'de, R> Deserialize<'de> for PowerSeries<R>
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<R: CommutativeRing> Display for PowerSeries<R>
impl<R: CommutativeRing> Display for PowerSeries<R>
Source§impl<R: CommutativeRing> Mul<&PowerSeries<R>> for &PowerSeries<R>
impl<R: CommutativeRing> Mul<&PowerSeries<R>> for &PowerSeries<R>
Source§type Output = Result<PowerSeries<R>, ContextMismatchError>
type Output = Result<PowerSeries<R>, ContextMismatchError>
* operator.Source§impl<R: CommutativeRing> Neg for &PowerSeries<R>
impl<R: CommutativeRing> Neg for &PowerSeries<R>
Source§impl<R: CommutativeRing> PartialEq for PowerSeries<R>
impl<R: CommutativeRing> PartialEq for PowerSeries<R>
Source§impl<R: CommutativeRing> SemanticType for PowerSeries<R>
impl<R: CommutativeRing> SemanticType for PowerSeries<R>
Source§const TYPE_ID: &'static str = "noether/commalg/PowerSeries@1"
const TYPE_ID: &'static str = "noether/commalg/PowerSeries@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<R> Serialize for PowerSeries<R>
impl<R> Serialize for PowerSeries<R>
Source§impl<R: CommutativeRing> Sub<&PowerSeries<R>> for &PowerSeries<R>
impl<R: CommutativeRing> Sub<&PowerSeries<R>> for &PowerSeries<R>
Source§type Output = Result<PowerSeries<R>, ContextMismatchError>
type Output = Result<PowerSeries<R>, ContextMismatchError>
- operator.impl<R: CommutativeRing> Eq for PowerSeries<R>
Auto Trait Implementations§
impl<R> Freeze for PowerSeries<R>where
R: Freeze,
impl<R> RefUnwindSafe for PowerSeries<R>
impl<R> Send for PowerSeries<R>
impl<R> Sync for PowerSeries<R>
impl<R> Unpin for PowerSeries<R>where
R: Unpin,
impl<R> UnwindSafe for PowerSeries<R>
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