[−][src]Struct series::Series
Laurent series in a single variable up to some power
Methods
impl<Var, C: Coeff> Series<Var, C>
[src]
pub fn new(var: Var, min_pow: isize, coeffs: Vec<C>) -> Series<Var, C>
[src]
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));
pub fn with_cutoff(
var: Var,
min_pow: isize,
cutoff_pow: isize,
coeffs: Vec<C>
) -> Series<Var, C>
[src]
var: Var,
min_pow: isize,
cutoff_pow: isize,
coeffs: Vec<C>
) -> Series<Var, C>
Create a new series with a given cutoff power
Example
This creates a series in the variable "x", starting at "x"^-1 with coefficients 1, 2, 3. and vanishing coefficients up to "x"^5 .In other words, the series x^-1 + 2 + 3*x + O(x^5).
let s = series::Series::with_cutoff("x", -1, 5, vec!(1,2,3));
Panics
Panics if the cutoff power is lower than the starting power
pub fn var(&self) -> &Var
[src]
Get the expansion variable
Example
let s = series::Series::new("x", -1, vec!(1,2,3)); assert_eq!(s.var(), &"x");
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
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);
pub fn min_pow(&self) -> isize
[src]
Get the leading power of the series expansion variable
Example
let s = series::Series::new("x", -1, vec!(1,2,3)); assert_eq!(s.min_pow(), -1);
pub fn cutoff_pow(&self) -> isize
[src]
Get the power of the expansion variable where the series is truncated, that is \( N \) in a series of the form \( \sum_{n=n_0}^{N-1} a_n x^n + O(x^N), \)
Example
let s = series::Series::new("x", -1, vec!(1,2,3)); assert_eq!(s.cutoff_pow(), 2);
impl<Var, C: Coeff> Series<Var, C>
[src]
pub fn powi(self, exp: i32) -> Self where
C: DivAssign<&'a C>,
&'a C: Mul<Output = C>,
C: Clone + SubAssign + Ln<Output = C> + Div<Output = C> + Mul<Output = C>,
Series<Var, C>: Mul<C, Output = Self> + Exp<Output = Self> + MulInverse<Output = Self>,
[src]
C: DivAssign<&'a C>,
&'a C: Mul<Output = C>,
C: Clone + SubAssign + Ln<Output = C> + Div<Output = C> + Mul<Output = C>,
Series<Var, C>: Mul<C, Output = Self> + Exp<Output = Self> + MulInverse<Output = Self>,
Calculate series to some integer power
In contrast to the more general pow
method this does not require
the variable type to be convertible to the coefficient type and gives
an overall nicer output
Example
let s = series::Series::new("x", -1, vec![1.,3.,7.]); let s_to_minus_5 = series::Series::new("x", 5, vec![1.,-15.,100.]); assert_eq!(s.powi(-5), s_to_minus_5);
Trait Implementations
impl<Var, C: Coeff> Ln for Series<Var, C> where
C: DivAssign<&'a C>,
&'a C: Mul<Output = C>,
C: Clone + SubAssign + Add<Output = C> + Mul<Output = C> + Div<Output = C> + Ln<Output = C> + From<Var>,
Var: Clone,
[src]
C: DivAssign<&'a C>,
&'a C: Mul<Output = C>,
C: Clone + SubAssign + Add<Output = C> + Mul<Output = C> + Div<Output = C> + Ln<Output = C> + From<Var>,
Var: Clone,
impl<'a, Var, C: Coeff> Ln for &'a Series<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]
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,
impl<Var, C: Coeff> Exp for Series<Var, C> where
&'a C: Mul<Output = C>,
C: MulAssign<&'a C>,
C: Clone + Div<Output = C> + Mul<Output = C> + AddAssign + Exp<Output = C>,
[src]
&'a C: Mul<Output = C>,
C: MulAssign<&'a C>,
C: Clone + Div<Output = C> + Mul<Output = C> + AddAssign + Exp<Output = C>,
type Output = Self
fn exp(self) -> Self::Output
[src]
Computes the exponential of a series
Panics
Panics if the series contains negative powers of the expansion variable
impl<'a, Var, C: Coeff> Exp for &'a Series<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]
&'b C: Mul<Output = C>,
C: MulAssign<&'b C>,
Var: Clone,
C: Clone + Div<Output = C> + Mul<Output = C> + AddAssign + Exp<Output = C>,
type Output = Series<Var, C>
fn exp(self) -> Self::Output
[src]
Computes the exponential of a series
Panics
Panics if the series contains negative powers of the expansion variable
impl<Var, C: Coeff, T> Pow<T> for Series<Var, C> where
Series<Var, C>: Ln,
<Series<Var, C> as Ln>::Output: Mul<T>,
<<Series<Var, C> as Ln>::Output as Mul<T>>::Output: Exp,
[src]
Series<Var, C>: Ln,
<Series<Var, C> as Ln>::Output: Mul<T>,
<<Series<Var, C> as Ln>::Output as Mul<T>>::Output: Exp,
type Output = <<<Series<Var, C> as Ln>::Output as Mul<T>>::Output as Exp>::Output
fn pow(self, exponent: T) -> Self::Output
[src]
impl<'a, Var, C: Coeff, T> Pow<T> for &'a Series<Var, C> where
&'b Series<Var, C>: Ln<Output = Series<Var, C>>,
Series<Var, C>: Mul<T>,
<Series<Var, C> as Mul<T>>::Output: Exp,
[src]
&'b Series<Var, C>: Ln<Output = Series<Var, C>>,
Series<Var, C>: Mul<T>,
<Series<Var, C> as Mul<T>>::Output: Exp,
type Output = <<Series<Var, C> as Mul<T>>::Output as Exp>::Output
fn pow(self, exponent: T) -> Self::Output
[src]
impl<'a, Var: Clone, C: Coeff + SubAssign> MulInverse for &'a Series<Var, C> where
&'b C: Div<Output = C> + Mul<Output = C>,
[src]
&'b C: Div<Output = C> + Mul<Output = C>,
type Output = Series<Var, C>
fn mul_inverse(self) -> Self::Output
[src]
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).mul_inverse(); let one = series::Series::new("x", 0, vec!(1.,0.,0.)); assert_eq!(s * s_inv, one);
impl<Var: Clone, C: Coeff + SubAssign> MulInverse for Series<Var, C> where
&'a Series<Var, C>: MulInverse<Output = Series<Var, C>>,
[src]
&'a Series<Var, C>: MulInverse<Output = Series<Var, C>>,
type Output = Series<Var, C>
fn mul_inverse(self) -> Self::Output
[src]
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);
impl<Var: PartialOrd, C: PartialOrd + Coeff> PartialOrd<Series<Var, C>> for Series<Var, C>
[src]
fn partial_cmp(&self, other: &Series<Var, C>) -> Option<Ordering>
[src]
fn lt(&self, other: &Series<Var, C>) -> bool
[src]
fn le(&self, other: &Series<Var, C>) -> bool
[src]
fn gt(&self, other: &Series<Var, C>) -> bool
[src]
fn ge(&self, other: &Series<Var, C>) -> bool
[src]
impl<Var: PartialEq, C: PartialEq + Coeff> PartialEq<Series<Var, C>> for Series<Var, C>
[src]
impl<Var, C: Coeff> From<Series<Var, C>> for SeriesParts<Var, C>
[src]
impl<Var, C: Coeff> From<SeriesParts<Var, C>> for Series<Var, C>
[src]
fn from(parts: SeriesParts<Var, C>) -> Self
[src]
impl<Var: Clone, C: Clone + Coeff> Clone for Series<Var, C>
[src]
fn clone(&self) -> Series<Var, C>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<Var: Ord, C: Ord + Coeff> Ord for Series<Var, C>
[src]
fn cmp(&self, other: &Series<Var, C>) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl<Var: Eq, C: Eq + Coeff> Eq for Series<Var, C>
[src]
impl<Var: Display, C: Coeff + Display> Display for Series<Var, C>
[src]
impl<Var: Debug, C: Debug + Coeff> Debug for Series<Var, C>
[src]
impl<Var: Hash, C: Hash + Coeff> Hash for Series<Var, C>
[src]
fn hash<__HVarC: Hasher>(&self, state: &mut __HVarC)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'a, Var: Clone, C: Coeff + Clone, Rhs> Add<Rhs> for &'a Series<Var, C> where
Series<Var, C>: AddAssign<Rhs>,
[src]
Series<Var, C>: AddAssign<Rhs>,
type Output = Series<Var, C>
The resulting type after applying the +
operator.
fn add(self, other: Rhs) -> Self::Output
[src]
impl<Var: Clone, C: Coeff + Clone, Rhs> Add<Rhs> for Series<Var, C> where
Series<Var, C>: AddAssign<Rhs>,
[src]
Series<Var, C>: AddAssign<Rhs>,
type Output = Series<Var, C>
The resulting type after applying the +
operator.
fn add(self, other: Rhs) -> Self::Output
[src]
impl<'a, Var, C: Coeff, T> Sub<T> for &'a Series<Var, C> where
Series<Var, C>: Clone + SubAssign<T>,
[src]
Series<Var, C>: Clone + SubAssign<T>,
type Output = Series<Var, C>
The resulting type after applying the -
operator.
fn sub(self, other: T) -> Self::Output
[src]
impl<Var, C: Coeff, T> Sub<T> for Series<Var, C> where
Series<Var, C>: SubAssign<T>,
[src]
Series<Var, C>: SubAssign<T>,
type Output = Series<Var, C>
The resulting type after applying the -
operator.
fn sub(self, other: T) -> Self::Output
[src]
impl<'a, Var, C: Coeff, T> Mul<T> for &'a Series<Var, C> where
Series<Var, C>: Clone + MulAssign<T>,
[src]
Series<Var, C>: Clone + MulAssign<T>,
type Output = Series<Var, C>
The resulting type after applying the *
operator.
fn mul(self, other: T) -> Self::Output
[src]
impl<Var, C: Coeff, T> Mul<T> for Series<Var, C> where
Series<Var, C>: MulAssign<T>,
[src]
Series<Var, C>: MulAssign<T>,
type Output = Series<Var, C>
The resulting type after applying the *
operator.
fn mul(self, other: T) -> Self::Output
[src]
impl<'a, Var, C: Coeff, T> Div<T> for &'a Series<Var, C> where
Series<Var, C>: Clone + DivAssign<T>,
[src]
Series<Var, C>: Clone + DivAssign<T>,
type Output = Series<Var, C>
The resulting type after applying the /
operator.
fn div(self, other: T) -> Self::Output
[src]
impl<Var, C: Coeff, T> Div<T> for Series<Var, C> where
Series<Var, C>: DivAssign<T>,
[src]
Series<Var, C>: DivAssign<T>,
type Output = Series<Var, C>
The resulting type after applying the /
operator.
fn div(self, other: T) -> Self::Output
[src]
impl<Var, C: Coeff + Neg<Output = C>> Neg for Series<Var, C>
[src]
type Output = Series<Var, C>
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
Compute -s for a series s
Example
let s = series::Series::new("x", -3, vec!(1.,0.,-3.)); let minus_s = series::Series::new("x", -3, vec!(-1.,0.,3.)); assert_eq!(-s, minus_s);
impl<'a, Var: Clone, C: Coeff> Neg for &'a Series<Var, C> where
&'c C: Neg<Output = C>,
[src]
&'c C: Neg<Output = C>,
type Output = Series<Var, C>
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
Compute -s for a series s
Example
let s = series::Series::new("x", -3, vec!(1.,0.,-3.)); let minus_s = series::Series::new("x", -3, vec!(-1.,0.,3.)); assert_eq!(-&s, minus_s);
impl<'a, Var: PartialEq + Debug, C: Coeff + Clone> AddAssign<&'a Series<Var, C>> for Series<Var, C> where
C: AddAssign<&'c C>,
[src]
C: AddAssign<&'c C>,
fn add_assign(&mut self, other: &'a Series<Var, C>)
[src]
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.
impl<Var, C: Coeff> AddAssign<Series<Var, C>> for Series<Var, C> where
C: AddAssign<&'c C>,
Var: PartialEq + Debug,
[src]
C: AddAssign<&'c C>,
Var: PartialEq + Debug,
fn add_assign(&mut self, other: Series<Var, C>)
[src]
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.
impl<Var, C: Coeff + Clone> AddAssign<C> for Series<Var, C> where
C: AddAssign<C>,
[src]
C: AddAssign<C>,
fn add_assign(&mut self, rhs: C)
[src]
impl<'a, Var, C: Coeff> SubAssign<&'a Series<Var, C>> for Series<Var, C> where
&'c Series<Var, C>: Neg<Output = Series<Var, C>>,
Series<Var, C>: AddAssign<Series<Var, C>>,
[src]
&'c Series<Var, C>: Neg<Output = Series<Var, C>>,
Series<Var, C>: AddAssign<Series<Var, C>>,
fn sub_assign(&mut self, other: &'a Series<Var, C>)
[src]
impl<Var, C: Coeff> SubAssign<Series<Var, C>> for Series<Var, C> where
Series<Var, C>: AddAssign + Neg<Output = Series<Var, C>>,
[src]
Series<Var, C>: AddAssign + Neg<Output = Series<Var, C>>,
fn sub_assign(&mut self, other: Series<Var, C>)
[src]
impl<Var, C: Coeff + Clone> SubAssign<C> for Series<Var, C> where
C: Neg<Output = C> + SubAssign<C>,
[src]
C: Neg<Output = C> + SubAssign<C>,
fn sub_assign(&mut self, rhs: C)
[src]
impl<'a, Var: PartialEq + Debug, C: Coeff + Clone + AddAssign> MulAssign<&'a Series<Var, C>> for Series<Var, C> where
&'b C: Mul<Output = C>,
[src]
&'b C: Mul<Output = C>,
fn mul_assign(&mut self, other: &'a Series<Var, C>)
[src]
impl<Var, C: Coeff> MulAssign<Series<Var, C>> for Series<Var, C> where
Series<Var, C>: MulAssign<&'a Series<Var, C>>,
[src]
Series<Var, C>: MulAssign<&'a Series<Var, C>>,
fn mul_assign(&mut self, other: Series<Var, C>)
[src]
impl<'a, Var, C: Coeff> MulAssign<&'a C> for Series<Var, C> where
C: MulAssign<&'a C>,
[src]
C: MulAssign<&'a C>,
fn mul_assign(&mut self, rhs: &'a C)
[src]
impl<Var, C: Coeff> MulAssign<C> for Series<Var, C> where
Series<Var, C>: MulAssign<&'a C>,
[src]
Series<Var, C>: MulAssign<&'a C>,
fn mul_assign(&mut self, rhs: C)
[src]
impl<'a, Var: Clone, C: Coeff + SubAssign> DivAssign<&'a Series<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]
Series<Var, C>: MulAssign,
&'b C: Div<Output = C> + Mul<Output = C>,
&'c Series<Var, C>: MulInverse<Output = Series<Var, C>>,
fn div_assign(&mut self, other: &'a Series<Var, C>)
[src]
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>>,
&'b C: Div<Output = C> + Mul<Output = C>,
[src]
Series<Var, C>: MulAssign + MulInverse<Output = Series<Var, C>>,
&'b C: Div<Output = C> + Mul<Output = C>,
fn div_assign(&mut self, other: Series<Var, C>)
[src]
impl<'a, Var, C: Coeff> DivAssign<&'a C> for Series<Var, C> where
C: DivAssign<&'a C>,
[src]
C: DivAssign<&'a C>,
fn div_assign(&mut self, rhs: &'a C)
[src]
impl<Var, C: Coeff> DivAssign<C> for Series<Var, C> where
Series<Var, C>: DivAssign<&'a C>,
[src]
Series<Var, C>: DivAssign<&'a C>,
fn div_assign(&mut self, rhs: C)
[src]
Auto Trait Implementations
impl<Var, C> Send for Series<Var, C> where
C: Send,
Var: Send,
C: Send,
Var: Send,
impl<Var, C> Sync for Series<Var, C> where
C: Sync,
Var: Sync,
C: Sync,
Var: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,