[][src]Struct series::slice::SeriesSlice

pub struct SeriesSlice<'a, Var, C: Coeff> { /* fields omitted */ }

View into a Laurent series

Methods

impl<'a, Var, C: Coeff> SeriesSlice<'a, Var, C>[src]

pub fn min_pow(&self) -> isize[src]

Get the leading power of the series expansion variable

Example

use series::AsSlice;

let s = series::Series::new("x", -1, vec![1,2,3]);
assert_eq!(s.as_slice(..).min_pow(), -1);
assert_eq!(s.as_slice(0..).min_pow(), 0);

pub fn cutoff_pow(&self) -> isize[src]

Get the power of the expansion variable where the slice is truncated.

Example

use series::AsSlice;

let s = series::Series::new("x", -1, vec!(1,2,3));
assert_eq!(s.as_slice(..).cutoff_pow(), 2);
assert_eq!(s.as_slice(..1).cutoff_pow(), 1);

pub fn coeff(&self, pow: isize) -> Option<&C>[src]

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

use series::AsSlice;

let s = series::Series::new("x", -1, vec!(1,2,3));
let slice = s.as_slice(..);
assert_eq!(slice.coeff(-5), Some(&0));
assert_eq!(slice.coeff(-2), Some(&0));
assert_eq!(slice.coeff(-1), Some(&1));
assert_eq!(slice.coeff(0), Some(&2));
assert_eq!(slice.coeff(1), Some(&3));
assert_eq!(slice.coeff(2), None);
assert_eq!(slice.coeff(5), None);

pub fn iter(&self) -> Iter<C>[src]

Iterator over the series powers and coefficients.

Example

use series::AsSlice;

let s = series::Series::new("x", -1, vec!(1,2,3));
let slice = s.as_slice(..);
let mut iter = slice.iter();
assert_eq!(iter.next(), Some((-1, &1)));
assert_eq!(iter.next(), Some((0, &2)));
assert_eq!(iter.next(), Some((1, &3)));
assert_eq!(iter.next(), None);

pub fn split_at(&self, pos: isize) -> (Self, Self)[src]

Split a series slice into two at the given power of the expansion variable.

Example

use series::AsSlice;

let s = series::Series::new("x", -1, vec!(1,2,3));
let (lower, upper) = s.as_slice(..).split_at(0);
assert_eq!(lower.min_pow(), -1);
assert_eq!(upper.min_pow(), 0);

pub fn as_poly(&self) -> PolynomialSlice<'a, Var, C>[src]

View as polynomial slice

Example

use series::AsSlice;

let s = series::Series::new("x", -1, vec!(1,2,3));
let slice = s.as_slice(..).as_poly();
let p = series::Polynomial::from(s.clone());
assert_eq!(slice, p.as_slice(..));

Trait Implementations

impl<'a, Var: Clone, C: Coeff + Clone, Rhs> Add<Rhs> for SeriesSlice<'a, Var, C> where
    Series<Var, C>: AddAssign<Rhs>, 
[src]

type Output = Series<Var, C>

The resulting type after applying the + operator.

impl<'a, Var: PartialEq + Debug, C: Coeff + Clone> AddAssign<SeriesSlice<'a, Var, C>> for Series<Var, C> where
    C: AddAssign<&'c C>, 
[src]

impl<'a, Var, C: Coeff> Clone for SeriesSlice<'a, Var, C>[src]

impl<'a, Var, C: Coeff> Copy for SeriesSlice<'a, Var, C>[src]

impl<'a, Var: Debug, C: Debug + Coeff> Debug for SeriesSlice<'a, Var, C>[src]

impl<'a, Var: Display, C: Coeff + Display> Display for SeriesSlice<'a, Var, C>[src]

impl<'a, Var, C: Coeff, T> Div<T> for SeriesSlice<'a, Var, C> where
    Var: Clone,
    C: Clone,
    Series<Var, C>: DivAssign<T>, 
[src]

type Output = Series<Var, C>

The resulting type after applying the / operator.

impl<'a, Var: Clone, C: Coeff + SubAssign> DivAssign<SeriesSlice<'a, Var, C>> for Series<Var, C> where
    Series<Var, C>: MulAssign,
    &'b C: Div<Output = C> + Mul<Output = C>,
    &'c Series<Var, C>: MulInverse<Output = Series<Var, C>>, 
[src]

impl<'a, Var: Eq, C: Eq + Coeff> Eq for SeriesSlice<'a, Var, C>[src]

impl<'a, Var, C: Coeff> Exp for SeriesSlice<'a, Var, C> where
    &'b C: Mul<Output = C>,
    C: MulAssign<&'b C>,
    Var: Clone,
    C: Clone + Div<Output = C> + Mul<Output = C> + AddAssign + Exp<Output = C>, 
[src]

type Output = Series<Var, C>

impl<'a, Var: Clone, C: Coeff + Clone> From<SeriesSlice<'a, Var, C>> for Series<Var, C>[src]

impl<'a, Var: Hash, C: Hash + Coeff> Hash for SeriesSlice<'a, Var, C>[src]

impl<'a, Var, C: Coeff> Index<isize> for SeriesSlice<'a, Var, C>[src]

type Output = C

The returned type after indexing.

impl<'a, Var, C: Coeff> Ln for SeriesSlice<'a, Var, C> where
    C: Div<&'b C, Output = C>,
    &'b C: Mul<Output = C> + Ln<Output = C>,
    C: Clone + SubAssign + Add<Output = C> + Mul<Output = C> + Div<Output = C> + From<Var>,
    Var: Clone
[src]

type Output = Series<Var, C>

fn ln(self) -> Self::Output[src]

Computes the logarithm of a series

Panics

Panics if the series has no (non-zero) coefficients

impl<'a, 'b, Var, C: Coeff> Mul<&'b C> for SeriesSlice<'a, Var, C> where
    Var: Clone,
    &'c C: Mul<Output = C>, 
[src]

type Output = Series<Var, C>

The resulting type after applying the * operator.

impl<'a, 'b, Var, C: Coeff> Mul<&'b Series<Var, C>> for SeriesSlice<'a, Var, C> where
    C: Clone,
    Var: Clone,
    Series<Var, C>: Mul<SeriesSlice<'c, Var, C>, Output = Series<Var, C>>, 
[src]

type Output = Series<Var, C>

The resulting type after applying the * operator.

impl<'a, Var, C: Coeff> Mul<C> for SeriesSlice<'a, Var, C> where
    Var: Clone,
    &'c C: Mul<Output = C>, 
[src]

type Output = Series<Var, C>

The resulting type after applying the * operator.

impl<'a, Var, C: Coeff> Mul<Series<Var, C>> for SeriesSlice<'a, Var, C> where
    Var: Clone,
    C: Clone,
    Series<Var, C>: MulAssign<Series<Var, C>>, 
[src]

type Output = Series<Var, C>

The resulting type after applying the * operator.

impl<'a, Var, C: Coeff> Mul<SeriesSlice<'a, Var, C>> for Series<Var, C> where
    Series<Var, C>: MulAssign<SeriesSlice<'a, Var, C>>, 
[src]

type Output = Series<Var, C>

The resulting type after applying the * operator.

impl<'a, Var, C: Coeff> Mul<SeriesSlice<'a, Var, C>> for SeriesSlice<'a, Var, C> where
    Var: Clone,
    C: Clone,
    Series<Var, C>: Mul<SeriesSlice<'a, Var, C>, Output = Series<Var, C>>, 
[src]

type Output = Series<Var, C>

The resulting type after applying the * operator.

impl<'a, Var, C> MulAssign<SeriesSlice<'a, Var, C>> for Series<Var, C> where
    Var: PartialEq + Debug,
    &'b C: Mul<Output = C>,
    C: MulAssign<&'a C> + Coeff + Clone + AddAssign
[src]

impl<'a, Var, C> MulInverse for SeriesSlice<'a, Var, C> where
    Var: Clone,
    C: Coeff + SubAssign,
    &'b C: Div<Output = C> + Mul<Output = C>, 
[src]

type Output = Series<Var, C>

impl<'a, Var: Clone, C: Coeff> Neg for SeriesSlice<'a, Var, C> where
    &'c C: Neg<Output = C>, 
[src]

type Output = Series<Var, C>

The resulting type after applying the - operator.

impl<'a, Var: Ord, C: Ord + Coeff> Ord for SeriesSlice<'a, Var, C>[src]

impl<'a, Var: PartialEq, C: PartialEq + Coeff> PartialEq<SeriesSlice<'a, Var, C>> for SeriesSlice<'a, Var, C>[src]

impl<'a, Var: PartialOrd, C: PartialOrd + Coeff> PartialOrd<SeriesSlice<'a, Var, C>> for SeriesSlice<'a, Var, C>[src]

impl<'a, Var, C: Coeff, T> Pow<T> for SeriesSlice<'a, Var, C> where
    SeriesSlice<'b, Var, C>: Ln<Output = Series<Var, C>>,
    Series<Var, C>: Mul<T>,
    <Series<Var, C> as Mul<T>>::Output: Exp
[src]

type Output = <<Series<Var, C> as Mul<T>>::Output as Exp>::Output

impl<'a, Var, C: Coeff> StructuralEq for SeriesSlice<'a, Var, C>[src]

impl<'a, Var, C: Coeff> StructuralPartialEq for SeriesSlice<'a, Var, C>[src]

impl<'a, Var, C: Coeff, T> Sub<T> for SeriesSlice<'a, Var, C> where
    C: Clone,
    Var: Clone,
    Series<Var, C>: SubAssign<T>, 
[src]

type Output = Series<Var, C>

The resulting type after applying the - operator.

impl<'a, Var, C: Coeff> SubAssign<SeriesSlice<'a, Var, C>> for Series<Var, C> where
    SeriesSlice<'c, Var, C>: Neg<Output = Series<Var, C>>,
    Series<Var, C>: AddAssign<Series<Var, C>>, 
[src]

Auto Trait Implementations

impl<'a, Var, C> RefUnwindSafe for SeriesSlice<'a, Var, C> where
    C: RefUnwindSafe,
    Var: RefUnwindSafe

impl<'a, Var, C> Send for SeriesSlice<'a, Var, C> where
    C: Sync,
    Var: Sync

impl<'a, Var, C> Sync for SeriesSlice<'a, Var, C> where
    C: Sync,
    Var: Sync

impl<'a, Var, C> Unpin for SeriesSlice<'a, Var, C>

impl<'a, Var, C> UnwindSafe for SeriesSlice<'a, Var, C> where
    C: RefUnwindSafe,
    Var: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

impl<T, Base> RefNum<Base> for T where
    T: NumOps<Base, Base> + NumOps<&'r Base, Base>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.