Lc

Struct Lc 

Source
pub struct Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,
{ /* private fields */ }

Implementations§

Source§

impl<X, R> Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source

pub fn new() -> Self

Source

pub fn clean(&mut self)

Source

pub fn nterms(&self) -> usize

Source

pub fn any_term(&self) -> Option<(&X, &R)>

Source

pub fn gens(&self) -> impl Iterator<Item = &X>

Source

pub fn is_gen(&self) -> bool

Source

pub fn as_gen(&self) -> Option<X>

Source

pub fn coeff(&self, x: &X) -> &R

Source

pub fn iter(&self) -> impl Iterator<Item = (&X, &R)>

Source

pub fn map<Y, S, F>(&self, f: F) -> Lc<Y, S>
where Y: Gen, S: Ring, for<'x> &'x S: RingOps<S>, F: Fn(&X, &R) -> (Y, S),

Source

pub fn into_map<Y, S, F>(self, f: F) -> Lc<Y, S>
where Y: Gen, S: Ring, for<'x> &'x S: RingOps<S>, F: Fn(X, R) -> (Y, S),

Source

pub fn map_coeffs<S, F>(&self, f: F) -> Lc<X, S>
where S: Ring, for<'x> &'x S: RingOps<S>, F: Fn(&R) -> S,

Source

pub fn into_map_coeffs<S, F>(self, f: F) -> Lc<X, S>
where S: Ring, for<'x> &'x S: RingOps<S>, F: Fn(R) -> S,

Source

pub fn map_gens<Y, F>(&self, f: F) -> Lc<Y, R>
where Y: Gen, F: Fn(&X) -> Y,

Source

pub fn into_map_gens<Y, F>(self, f: F) -> Lc<Y, R>
where Y: Gen, F: Fn(X) -> Y,

Source

pub fn filter_gens<F>(&self, f: F) -> Self
where F: Fn(&X) -> bool,

Source

pub fn into_filter_gens<F>(self, f: F) -> Self
where F: Fn(&X) -> bool,

Source

pub fn apply<F>(&self, f: F) -> Self
where F: Fn(&X) -> Lc<X, R>,

Source

pub fn sort_terms_by<F>(&self, cmp: F) -> impl Iterator<Item = (&X, &R)>
where F: Fn(&X, &X) -> Ordering,

Source

pub fn combine<Y, Z, F>(&self, other: &Lc<Y, R>, x_map: F) -> Lc<Z, R>
where Y: Gen, Z: Gen, F: Fn(&X, &Y) -> Z,

Source

pub fn to_string_by<F>(&self, cmp: F, descending: bool) -> String
where F: Fn(&X, &X) -> Ordering,

Source§

impl<X, R> Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source

pub fn add_pair(&mut self, rhs: (X, R))

Source

pub fn add_pair_ref(&mut self, rhs: (&X, &R))

Trait Implementations§

Source§

impl<X, R> Add<&Lc<X, R>> for &Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>, Lc<X, R>: Clone,

Source§

type Output = Lc<X, R>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Lc<X, R>) -> Self::Output

Performs the + operation. Read more
Source§

impl<X, R> Add<&Lc<X, R>> for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

type Output = Lc<X, R>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Lc<X, R>) -> Self::Output

Performs the + operation. Read more
Source§

impl<X, R> Add<Lc<X, R>> for &Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>, Lc<X, R>: Clone,

Source§

type Output = Lc<X, R>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Lc<X, R>) -> Self::Output

Performs the + operation. Read more
Source§

impl<X, R> Add for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

type Output = Lc<X, R>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Lc<X, R>) -> Self::Output

Performs the + operation. Read more
Source§

impl<X, R> AddAssign<&Lc<X, R>> for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn add_assign(&mut self, rhs: &Self)

Performs the += operation. Read more
Source§

impl<X, R> AddAssign for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn add_assign(&mut self, rhs: Lc<X, R>)

Performs the += operation. Read more
Source§

impl<X, R> AddMon for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn sum<A, I>(itr: I) -> Self
where Self: AddAssign<A>, I: IntoIterator<Item = A>,

Source§

impl<X, R> Clone for Lc<X, R>
where X: Gen + Clone, R: Ring + Clone, for<'x> &'x R: RingOps<R>,

Source§

fn clone(&self) -> Lc<X, R>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<X, R> Debug for Lc<X, R>
where X: Gen + Debug, R: Ring + Debug, for<'x> &'x R: RingOps<R>,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<X, R> Default for Lc<X, R>
where X: Gen + Default, R: Ring + Default, for<'x> &'x R: RingOps<R>,

Source§

fn default() -> Lc<X, R>

Returns the “default value” for a type. Read more
Source§

impl<X, R> Display for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<X, R> Elem for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

impl<X, R> From<(X, R)> for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn from(value: (X, R)) -> Self

Converts to this type from the input type.
Source§

impl<X, R> From<HashMap<X, R>> for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn from(value: HashMap<X, R>) -> Self

Converts to this type from the input type.
Source§

impl<X, R> From<Lc<X, R>> for PolyBase<X, R>
where X: Mono, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn from(data: Lc<X, R>) -> Self

Converts to this type from the input type.
Source§

impl<X, R> From<PolyBase<X, R>> for Lc<X, R>
where X: Mono, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn from(poly: PolyBase<X, R>) -> Self

Converts to this type from the input type.
Source§

impl<X, R> From<X> for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn from(x: X) -> Self

Converts to this type from the input type.
Source§

impl<X, R> FromIterator<(X, R)> for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn from_iter<T: IntoIterator<Item = (X, R)>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<X, R> IntoIterator for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

type Item = (X, R)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<X, R>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<X, R> Mul<&Lc<X, R>> for Lc<X, R>
where X: Gen + Mul<Output = X>, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

type Output = Lc<X, R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Lc<X, R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<X, R> Mul<&R> for &Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>, Lc<X, R>: Clone,

Source§

type Output = Lc<X, R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &R) -> Self::Output

Performs the * operation. Read more
Source§

impl<X, R> Mul<&R> for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

type Output = Lc<X, R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &R) -> Self::Output

Performs the * operation. Read more
Source§

impl<X, R> Mul<Lc<X, R>> for &Lc<X, R>
where X: Gen + Mul<Output = X>, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

type Output = Lc<X, R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Lc<X, R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<X, R> Mul<R> for &Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>, Lc<X, R>: Clone,

Source§

type Output = Lc<X, R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Self::Output

Performs the * operation. Read more
Source§

impl<X, R> Mul<R> for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

type Output = Lc<X, R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Self::Output

Performs the * operation. Read more
Source§

impl<X, R> Mul for &Lc<X, R>
where X: Gen + Mul<Output = X>, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

type Output = Lc<X, R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl<X, R> Mul for Lc<X, R>
where X: Gen + Mul<Output = X>, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

type Output = Lc<X, R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Lc<X, R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<X, R> MulAssign<&Lc<X, R>> for Lc<X, R>
where X: Gen + Mul<Output = X>, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn mul_assign(&mut self, rhs: &Lc<X, R>)

Performs the *= operation. Read more
Source§

impl<X, R> MulAssign<&R> for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn mul_assign(&mut self, rhs: &R)

Performs the *= operation. Read more
Source§

impl<X, R> MulAssign<R> for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn mul_assign(&mut self, rhs: R)

Performs the *= operation. Read more
Source§

impl<X, R> MulAssign for Lc<X, R>
where X: Gen + Mul<Output = X>, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn mul_assign(&mut self, rhs: Lc<X, R>)

Performs the *= operation. Read more
Source§

impl<X, R> Neg for &Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

type Output = Lc<X, R>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<X, R> Neg for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

type Output = Lc<X, R>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<X, R> PartialEq for Lc<X, R>
where X: Gen + PartialEq, R: Ring + PartialEq, for<'x> &'x R: RingOps<R>,

Source§

fn eq(&self, other: &Lc<X, R>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<X, R> RMod for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

type R = R

Source§

impl<X, R> Sub<&Lc<X, R>> for &Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>, Lc<X, R>: Clone,

Source§

type Output = Lc<X, R>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Lc<X, R>) -> Self::Output

Performs the - operation. Read more
Source§

impl<X, R> Sub<&Lc<X, R>> for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

type Output = Lc<X, R>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Lc<X, R>) -> Self::Output

Performs the - operation. Read more
Source§

impl<X, R> Sub<Lc<X, R>> for &Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>, Lc<X, R>: Clone,

Source§

type Output = Lc<X, R>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Lc<X, R>) -> Self::Output

Performs the - operation. Read more
Source§

impl<X, R> Sub for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

type Output = Lc<X, R>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Lc<X, R>) -> Self::Output

Performs the - operation. Read more
Source§

impl<X, R> SubAssign<&Lc<X, R>> for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn sub_assign(&mut self, rhs: &Self)

Performs the -= operation. Read more
Source§

impl<X, R> SubAssign for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn sub_assign(&mut self, rhs: Lc<X, R>)

Performs the -= operation. Read more
Source§

impl<X, R> Zero for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

impl<X, R> AddGrp for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

impl<X, R> AddGrpOps<Lc<X, R>> for &Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

impl<X, R> AddGrpOps for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

impl<X, R> AddMonOps<Lc<X, R>> for &Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

impl<X, R> AddMonOps for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

impl<X, R> Eq for Lc<X, R>
where X: Gen + Eq, R: Ring + Eq, for<'x> &'x R: RingOps<R>,

Source§

impl<X, R> RModOps<R, Lc<X, R>> for &Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

impl<X, R> RModOps<R, Lc<X, R>> for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

impl<X, R> StructuralPartialEq for Lc<X, R>
where X: Gen, R: Ring, for<'x> &'x R: RingOps<R>,

Auto Trait Implementations§

§

impl<X, R> Freeze for Lc<X, R>
where &'x R: for<'x> Sized, R: Freeze,

§

impl<X, R> RefUnwindSafe for Lc<X, R>
where &'x R: for<'x> Sized, R: RefUnwindSafe, X: RefUnwindSafe,

§

impl<X, R> Send for Lc<X, R>
where &'x R: for<'x> Sized,

§

impl<X, R> Sync for Lc<X, R>
where &'x R: for<'x> Sized,

§

impl<X, R> Unpin for Lc<X, R>
where &'x R: for<'x> Sized, R: Unpin, X: Unpin,

§

impl<X, R> UnwindSafe for Lc<X, R>
where &'x R: for<'x> Sized, R: UnwindSafe, X: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneAnd for T
where T: Clone,

Source§

fn clone_and<F>(&self, f: F) -> Self
where F: FnOnce(&mut Self),

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ElemBase for T
where T: Default + PartialEq + Eq + Clone + Send + Sync + Display + Debug + 'static,