Struct IterBinomial

pub struct IterBinomial<T> { /* private fields */ }

An iterator over binomial coefficients.

Implementations

impl<T> IterBinomial<T> where T: Integer,

fn new(n: T) -> IterBinomial<T>

For a given n, iterate over all binomial coefficients binomial(n, k), for k=0...n.

Note that this might overflow, depending on T. For the primitive integer types, the following n are the largest ones for which there will be no overflow:

type n
u8 10
i8 9
u16 18
i16 17
u32 34
i32 33
u64 67
i64 66

For larger n, T should be a bigint type.

Trait Implementations

impl<T> Iterator for IterBinomial<T> where T: Integer + Clone,

type Item = T;
fn next(&mut self) -> Option<T>

Auto Trait Implementations

impl<T> Freeze for IterBinomial<T> where T: Freeze + Freeze + Freeze,

impl<T> RefUnwindSafe for IterBinomial<T> where T: RefUnwindSafe + RefUnwindSafe + RefUnwindSafe,

impl<T> Send for IterBinomial<T> where T: Send + Send + Send,

impl<T> Sync for IterBinomial<T> where T: Sync + Sync + Sync,

impl<T> Unpin for IterBinomial<T> where T: Unpin + Unpin + Unpin,

impl<T> UnsafeUnpin for IterBinomial<T> where T: UnsafeUnpin + UnsafeUnpin + UnsafeUnpin,

impl<T> UnwindSafe for IterBinomial<T> where T: UnwindSafe + UnwindSafe + UnwindSafe,

Blanket Implementations

impl<I> IntoIterator for IterBinomial<T> where I: Iterator,

type Item = <I as Iterator>::Item;
type IntoIter = I;
fn into_iter(self) -> I

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> From<T> for IterBinomial<T>

fn from(t: T) -> T

Returns the argument unchanged.

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

fn into(self) -> U

Calls U::from(self).

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

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

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