pub struct Series<Var, C: Coeff> { /* private fields */ }
Expand description
Laurent series in a single variable up to some power
Implementations
sourceimpl<Var, C: Coeff> Series<Var, C>
impl<Var, C: Coeff> Series<Var, C>
sourcepub fn new(var: Var, min_pow: isize, coeffs: Vec<C>) -> Series<Var, C>
pub fn new(var: Var, min_pow: isize, coeffs: Vec<C>) -> Series<Var, C>
Create a new series
Example
This creates a series in the variable “x”, starting at “x”^-1 with coefficients 1, 2, 3. In other words, the series x^-1 + 2 + 3*x + O(x^2).
let s = series::Series::new("x", -1, vec!(1,2,3));
sourcepub fn var(&self) -> &Var
pub fn var(&self) -> &Var
Get the expansion variable
Example
let s = series::Series::new("x", -1, vec!(1,2,3));
assert_eq!(s.var(), &"x");
sourcepub fn coeff(&self, pow: isize) -> Option<&C>
pub fn coeff(&self, pow: isize) -> Option<&C>
Get the series coefficient of the expansion variable to the given power.
Returns None if the requested power is above the highest known power. Coefficients below the leading power are zero.
Example
let s = series::Series::new("x", -1, vec!(1,2,3));
assert_eq!(s.coeff(-5), Some(&0));
assert_eq!(s.coeff(-2), Some(&0));
assert_eq!(s.coeff(-1), Some(&1));
assert_eq!(s.coeff(0), Some(&2));
assert_eq!(s.coeff(1), Some(&3));
assert_eq!(s.coeff(2), None);
assert_eq!(s.coeff(5), None);
Trait Implementations
sourceimpl<'a, Var: Clone, C: Coeff + Clone, Rhs> Add<Rhs> for &'a Series<Var, C>where
Series<Var, C>: AddAssign<Rhs>,
impl<'a, Var: Clone, C: Coeff + Clone, Rhs> Add<Rhs> for &'a Series<Var, C>where
Series<Var, C>: AddAssign<Rhs>,
sourceimpl<Var: Clone, C: Coeff + Clone, Rhs> Add<Rhs> for Series<Var, C>where
Series<Var, C>: AddAssign<Rhs>,
impl<Var: Clone, C: Coeff + Clone, Rhs> Add<Rhs> for Series<Var, C>where
Series<Var, C>: AddAssign<Rhs>,
sourceimpl<'a, Var: PartialEq + Debug, C: Coeff + Clone> AddAssign<&'a Series<Var, C>> for Series<Var, C>where
for<'c> C: AddAssign<&'c C>,
impl<'a, Var: PartialEq + Debug, C: Coeff + Clone> AddAssign<&'a Series<Var, C>> for Series<Var, C>where
for<'c> C: AddAssign<&'c C>,
sourcefn add_assign(&mut self, other: &'a Series<Var, C>)
fn add_assign(&mut self, other: &'a Series<Var, C>)
Set s = s + t for two series s and t
Example
use series::Series;
let mut s = Series::new("x", -3, vec!(1.,0.,-3.));
let t = Series::new("x", -1, vec!(3., 4., 5.));
let res = Series::new("x", -3, vec!(1.,0.,0.));
s += &t;
assert_eq!(res, s);
Panics
Panics if the series have different expansion variables.
sourceimpl<Var, C: Coeff + Clone> AddAssign<C> for Series<Var, C>where
C: AddAssign<C>,
impl<Var, C: Coeff + Clone> AddAssign<C> for Series<Var, C>where
C: AddAssign<C>,
sourcefn add_assign(&mut self, rhs: C)
fn add_assign(&mut self, rhs: C)
Performs the
+=
operation. Read moresourceimpl<Var, C: Coeff> AddAssign<Series<Var, C>> for Series<Var, C>where
for<'c> C: AddAssign<&'c C>,
Var: PartialEq + Debug,
impl<Var, C: Coeff> AddAssign<Series<Var, C>> for Series<Var, C>where
for<'c> C: AddAssign<&'c C>,
Var: PartialEq + Debug,
sourcefn add_assign(&mut self, other: Series<Var, C>)
fn add_assign(&mut self, other: Series<Var, C>)
Set s = s + t for two series s and t
Example
use series::Series;
let mut s = Series::new("x", -3, vec!(1.,0.,-3.));
let t = Series::new("x", -1, vec!(3., 4., 5.));
let res = Series::new("x", -3, vec!(1.,0.,0.));
s += t;
assert_eq!(res, s);
Panics
Panics if the series have different expansion variables.
sourceimpl<'a, Var, C: Coeff, T> Div<T> for &'a Series<Var, C>where
Series<Var, C>: Clone + DivAssign<T>,
impl<'a, Var, C: Coeff, T> Div<T> for &'a Series<Var, C>where
Series<Var, C>: Clone + DivAssign<T>,
sourceimpl<'a, Var, C: Coeff> DivAssign<&'a C> for Series<Var, C>where
C: DivAssign<&'a C>,
impl<'a, Var, C: Coeff> DivAssign<&'a C> for Series<Var, C>where
C: DivAssign<&'a C>,
sourcefn div_assign(&mut self, rhs: &'a C)
fn div_assign(&mut self, rhs: &'a C)
Performs the
/=
operation. Read moresourceimpl<'a, Var: Clone, C: Coeff + SubAssign> DivAssign<&'a Series<Var, C>> for Series<Var, C>where
Series<Var, C>: MulAssign,
for<'b> &'b C: Div<Output = C> + Mul<Output = C>,
for<'c> &'c Series<Var, C>: MulInverse<Output = Series<Var, C>>,
impl<'a, Var: Clone, C: Coeff + SubAssign> DivAssign<&'a Series<Var, C>> for Series<Var, C>where
Series<Var, C>: MulAssign,
for<'b> &'b C: Div<Output = C> + Mul<Output = C>,
for<'c> &'c Series<Var, C>: MulInverse<Output = Series<Var, C>>,
sourcefn div_assign(&mut self, other: &'a Series<Var, C>)
fn div_assign(&mut self, other: &'a Series<Var, C>)
sourceimpl<Var, C: Coeff> DivAssign<C> for Series<Var, C>where
for<'a> Series<Var, C>: DivAssign<&'a C>,
impl<Var, C: Coeff> DivAssign<C> for Series<Var, C>where
for<'a> Series<Var, C>: DivAssign<&'a C>,
sourcefn div_assign(&mut self, rhs: C)
fn div_assign(&mut self, rhs: C)
Performs the
/=
operation. Read moresourceimpl<'a, Var: Clone, C: Coeff + SubAssign> DivAssign<Series<Var, C>> for Series<Var, C>where
Series<Var, C>: MulAssign + MulInverse<Output = Series<Var, C>>,
for<'b> &'b C: Div<Output = C> + Mul<Output = C>,
impl<'a, Var: Clone, C: Coeff + SubAssign> DivAssign<Series<Var, C>> for Series<Var, C>where
Series<Var, C>: MulAssign + MulInverse<Output = Series<Var, C>>,
for<'b> &'b C: Div<Output = C> + Mul<Output = C>,
sourcefn div_assign(&mut self, other: Series<Var, C>)
fn div_assign(&mut self, other: Series<Var, C>)
sourceimpl<'a, Var, C: Coeff> Exp for &'a Series<Var, C>where
for<'b> &'b C: Mul<Output = C>,
for<'b> C: MulAssign<&'b C>,
Var: Clone,
C: Clone + From<i32> + Div<Output = C> + Mul<Output = C> + AddAssign + Exp<Output = C>,
impl<'a, Var, C: Coeff> Exp for &'a Series<Var, C>where
for<'b> &'b C: Mul<Output = C>,
for<'b> C: MulAssign<&'b C>,
Var: Clone,
C: Clone + From<i32> + Div<Output = C> + Mul<Output = C> + AddAssign + Exp<Output = C>,
sourceimpl<Var, C: Coeff> Exp for Series<Var, C>where
for<'a> &'a C: Mul<Output = C>,
for<'a> C: MulAssign<&'a C>,
C: Clone + From<i32> + Div<Output = C> + Mul<Output = C> + AddAssign + Exp<Output = C>,
impl<Var, C: Coeff> Exp for Series<Var, C>where
for<'a> &'a C: Mul<Output = C>,
for<'a> C: MulAssign<&'a C>,
C: Clone + From<i32> + Div<Output = C> + Mul<Output = C> + AddAssign + Exp<Output = C>,
sourceimpl<'a, Var, C: Coeff> Ln for &'a Series<Var, C>where
for<'b> C: Div<&'b C, Output = C>,
for<'b> &'b C: Mul<Output = C> + Ln<Output = C>,
C: Clone + From<i32> + SubAssign + Add<Output = C> + Mul<Output = C> + Div<Output = C> + From<Var>,
Var: Clone,
impl<'a, Var, C: Coeff> Ln for &'a Series<Var, C>where
for<'b> C: Div<&'b C, Output = C>,
for<'b> &'b C: Mul<Output = C> + Ln<Output = C>,
C: Clone + From<i32> + SubAssign + Add<Output = C> + Mul<Output = C> + Div<Output = C> + From<Var>,
Var: Clone,
sourceimpl<Var, C: Coeff> Ln for Series<Var, C>where
for<'a> C: DivAssign<&'a C>,
for<'a> &'a C: Mul<Output = C>,
C: Clone + From<i32> + SubAssign + Add<Output = C> + Mul<Output = C> + Div<Output = C> + Ln<Output = C> + From<Var>,
Var: Clone,
impl<Var, C: Coeff> Ln for Series<Var, C>where
for<'a> C: DivAssign<&'a C>,
for<'a> &'a C: Mul<Output = C>,
C: Clone + From<i32> + SubAssign + Add<Output = C> + Mul<Output = C> + Div<Output = C> + Ln<Output = C> + From<Var>,
Var: Clone,
sourceimpl<'a, Var, C: Coeff, T> Mul<T> for &'a Series<Var, C>where
Series<Var, C>: Clone + MulAssign<T>,
impl<'a, Var, C: Coeff, T> Mul<T> for &'a Series<Var, C>where
Series<Var, C>: Clone + MulAssign<T>,
sourceimpl<'a, Var, C: Coeff> MulAssign<&'a C> for Series<Var, C>where
C: MulAssign<&'a C>,
impl<'a, Var, C: Coeff> MulAssign<&'a C> for Series<Var, C>where
C: MulAssign<&'a C>,
sourcefn mul_assign(&mut self, rhs: &'a C)
fn mul_assign(&mut self, rhs: &'a C)
Performs the
*=
operation. Read moresourceimpl<'a, Var: PartialEq + Debug, C: Coeff + Clone + AddAssign> MulAssign<&'a Series<Var, C>> for Series<Var, C>where
for<'b> &'b C: Mul<Output = C>,
impl<'a, Var: PartialEq + Debug, C: Coeff + Clone + AddAssign> MulAssign<&'a Series<Var, C>> for Series<Var, C>where
for<'b> &'b C: Mul<Output = C>,
sourcefn mul_assign(&mut self, other: &'a Series<Var, C>)
fn mul_assign(&mut self, other: &'a Series<Var, C>)
sourceimpl<Var, C: Coeff> MulAssign<C> for Series<Var, C>where
for<'a> Series<Var, C>: MulAssign<&'a C>,
impl<Var, C: Coeff> MulAssign<C> for Series<Var, C>where
for<'a> Series<Var, C>: MulAssign<&'a C>,
sourcefn mul_assign(&mut self, rhs: C)
fn mul_assign(&mut self, rhs: C)
Performs the
*=
operation. Read moresourceimpl<Var, C: Coeff> MulAssign<Series<Var, C>> for Series<Var, C>where
for<'a> Series<Var, C>: MulAssign<&'a Series<Var, C>>,
impl<Var, C: Coeff> MulAssign<Series<Var, C>> for Series<Var, C>where
for<'a> Series<Var, C>: MulAssign<&'a Series<Var, C>>,
sourcefn mul_assign(&mut self, other: Series<Var, C>)
fn mul_assign(&mut self, other: Series<Var, C>)
sourceimpl<'a, Var: Clone, C: Coeff + SubAssign> MulInverse for &'a Series<Var, C>where
for<'b> &'b C: Div<Output = C> + Mul<Output = C>,
impl<'a, Var: Clone, C: Coeff + SubAssign> MulInverse for &'a Series<Var, C>where
for<'b> &'b C: Div<Output = C> + Mul<Output = C>,
sourceimpl<Var: Clone, C: Coeff + SubAssign> MulInverse for Series<Var, C>where
for<'a> &'a Series<Var, C>: MulInverse<Output = Series<Var, C>>,
impl<Var: Clone, C: Coeff + SubAssign> MulInverse for Series<Var, C>where
for<'a> &'a Series<Var, C>: MulInverse<Output = Series<Var, C>>,
sourcefn mul_inverse(self) -> Self::Output
fn mul_inverse(self) -> Self::Output
Compute 1/s for a series s
Example
use series::MulInverse;
let s = series::Series::new("x", -1, vec!(1.,2.,3.));
let s_inv = s.clone().mul_inverse();
let one = series::Series::new("x", 0, vec!(1.,0.,0.));
assert_eq!(s * s_inv, one);
type Output = Series<Var, C>
sourceimpl<'a, Var: Clone, C: Coeff> Neg for &'a Series<Var, C>where
for<'c> &'c C: Neg<Output = C>,
impl<'a, Var: Clone, C: Coeff> Neg for &'a Series<Var, C>where
for<'c> &'c C: Neg<Output = C>,
sourceimpl<Var: Ord, C: Ord + Coeff> Ord for Series<Var, C>
impl<Var: Ord, C: Ord + Coeff> Ord for Series<Var, C>
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<Var: PartialEq, C: PartialEq + Coeff> PartialEq<Series<Var, C>> for Series<Var, C>
impl<Var: PartialEq, C: PartialEq + Coeff> PartialEq<Series<Var, C>> for Series<Var, C>
sourceimpl<Var: PartialOrd, C: PartialOrd + Coeff> PartialOrd<Series<Var, C>> for Series<Var, C>
impl<Var: PartialOrd, C: PartialOrd + Coeff> PartialOrd<Series<Var, C>> for Series<Var, C>
sourcefn partial_cmp(&self, other: &Series<Var, C>) -> Option<Ordering>
fn partial_cmp(&self, other: &Series<Var, C>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl<'a, 'b, Var, C: Coeff> Pow<&'a Series<Var, C>> for &'b Series<Var, C>where
for<'c> &'c Series<Var, C>: Ln<Output = Series<Var, C>> + Mul<Series<Var, C>, Output = Series<Var, C>>,
Series<Var, C>: Exp<Output = Series<Var, C>>,
impl<'a, 'b, Var, C: Coeff> Pow<&'a Series<Var, C>> for &'b Series<Var, C>where
for<'c> &'c Series<Var, C>: Ln<Output = Series<Var, C>> + Mul<Series<Var, C>, Output = Series<Var, C>>,
Series<Var, C>: Exp<Output = Series<Var, C>>,
sourceimpl<'a, Var, C: Coeff> Pow<&'a Series<Var, C>> for Series<Var, C>where
for<'b> &'b Series<Var, C>: Mul<Series<Var, C>, Output = Series<Var, C>>,
Series<Var, C>: Ln<Output = Self> + Exp<Output = Self>,
impl<'a, Var, C: Coeff> Pow<&'a Series<Var, C>> for Series<Var, C>where
for<'b> &'b Series<Var, C>: Mul<Series<Var, C>, Output = Series<Var, C>>,
Series<Var, C>: Ln<Output = Self> + Exp<Output = Self>,
sourceimpl<'a, Var, C: Coeff> Pow<Series<Var, C>> for &'a Series<Var, C>where
for<'b> &'b Series<Var, C>: Ln<Output = Series<Var, C>>,
Series<Var, C>: Exp<Output = Series<Var, C>> + Mul<Output = Series<Var, C>>,
impl<'a, Var, C: Coeff> Pow<Series<Var, C>> for &'a Series<Var, C>where
for<'b> &'b Series<Var, C>: Ln<Output = Series<Var, C>>,
Series<Var, C>: Exp<Output = Series<Var, C>> + Mul<Output = Series<Var, C>>,
sourceimpl<Var, C: Coeff> Pow<Series<Var, C>> for Series<Var, C>where
Series<Var, C>: Ln<Output = Self> + Exp<Output = Self> + Mul<Output = Self>,
impl<Var, C: Coeff> Pow<Series<Var, C>> for Series<Var, C>where
Series<Var, C>: Ln<Output = Self> + Exp<Output = Self> + Mul<Output = Self>,
sourceimpl<'a, Var, C: Coeff, T> Sub<T> for &'a Series<Var, C>where
Series<Var, C>: Clone + SubAssign<T>,
impl<'a, Var, C: Coeff, T> Sub<T> for &'a Series<Var, C>where
Series<Var, C>: Clone + SubAssign<T>,
sourceimpl<'a, Var, C: Coeff> SubAssign<&'a Series<Var, C>> for Series<Var, C>where
for<'c> &'c Series<Var, C>: Neg<Output = Series<Var, C>>,
Series<Var, C>: AddAssign<Series<Var, C>>,
impl<'a, Var, C: Coeff> SubAssign<&'a Series<Var, C>> for Series<Var, C>where
for<'c> &'c Series<Var, C>: Neg<Output = Series<Var, C>>,
Series<Var, C>: AddAssign<Series<Var, C>>,
sourcefn sub_assign(&mut self, other: &'a Series<Var, C>)
fn sub_assign(&mut self, other: &'a Series<Var, C>)
sourceimpl<Var, C: Coeff + Clone> SubAssign<C> for Series<Var, C>where
C: Neg<Output = C> + SubAssign<C>,
impl<Var, C: Coeff + Clone> SubAssign<C> for Series<Var, C>where
C: Neg<Output = C> + SubAssign<C>,
sourcefn sub_assign(&mut self, rhs: C)
fn sub_assign(&mut self, rhs: C)
Performs the
-=
operation. Read moresourceimpl<Var, C: Coeff> SubAssign<Series<Var, C>> for Series<Var, C>where
Series<Var, C>: AddAssign + Neg<Output = Series<Var, C>>,
impl<Var, C: Coeff> SubAssign<Series<Var, C>> for Series<Var, C>where
Series<Var, C>: AddAssign + Neg<Output = Series<Var, C>>,
sourcefn sub_assign(&mut self, other: Series<Var, C>)
fn sub_assign(&mut self, other: Series<Var, C>)
impl<Var: Eq, C: Eq + Coeff> Eq for Series<Var, C>
impl<Var, C: Coeff> StructuralEq for Series<Var, C>
impl<Var, C: Coeff> StructuralPartialEq for Series<Var, C>
Auto Trait Implementations
impl<Var, C> RefUnwindSafe for Series<Var, C>where
C: RefUnwindSafe,
Var: RefUnwindSafe,
impl<Var, C> Send for Series<Var, C>where
C: Send,
Var: Send,
impl<Var, C> Sync for Series<Var, C>where
C: Sync,
Var: Sync,
impl<Var, C> Unpin for Series<Var, C>where
C: Unpin,
Var: Unpin,
impl<Var, C> UnwindSafe for Series<Var, C>where
C: UnwindSafe,
Var: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more