Struct sprs::stack::DStack [−][src]
pub struct DStack<I> { /* fields omitted */ }
A double stack of fixed capacity, growing from the left to the right or conversely.
Used in sparse triangular / sparse vector solves, where it is guaranteed that the two parts of the stack cannot overlap.
Methods
impl<I> DStack<I> where
I: Copy,
[src]
impl<I> DStack<I> where
I: Copy,
pub fn with_capacity(n: usize) -> DStack<I> where
I: Default,
[src]
pub fn with_capacity(n: usize) -> DStack<I> where
I: Default,
Create a new double stacked suited for containing at most n elements
pub fn capacity(&self) -> usize
[src]
pub fn capacity(&self) -> usize
Capacity of the dstack
pub fn is_left_empty(&self) -> bool
[src]
pub fn is_left_empty(&self) -> bool
Test whether the left stack is empty
pub fn is_right_empty(&self) -> bool
[src]
pub fn is_right_empty(&self) -> bool
Test whether the right stack is empty
pub fn push_left(&mut self, value: I)
[src]
pub fn push_left(&mut self, value: I)
Push a value on the left stack
pub fn push_right(&mut self, value: I)
[src]
pub fn push_right(&mut self, value: I)
Push a value on the right stack
pub fn pop_left(&mut self) -> Option<I>
[src]
pub fn pop_left(&mut self) -> Option<I>
Pop a value from the left stack
pub fn pop_right(&mut self) -> Option<I>
[src]
pub fn pop_right(&mut self) -> Option<I>
Pop a value from the right stack
pub fn len_right(&self) -> usize
[src]
pub fn len_right(&self) -> usize
Number of right elements this double stack contains
pub fn clear_right(&mut self)
[src]
pub fn clear_right(&mut self)
Clear the right stack
pub fn clear_left(&mut self)
[src]
pub fn clear_left(&mut self)
Clear the left stack
pub fn iter_right<'a>(&'a self) -> Iter<'a, I>
[src]
pub fn iter_right<'a>(&'a self) -> Iter<'a, I>
Iterates along the right stack without removing items
pub fn push_left_on_right(&mut self)
[src]
pub fn push_left_on_right(&mut self)
Push the values of the left stack onto the right stack.
pub fn push_right_on_left(&mut self)
[src]
pub fn push_right_on_left(&mut self)
Push the values of the right stack onto the left stack.
Trait Implementations
impl<I: Debug> Debug for DStack<I>
[src]
impl<I: Debug> Debug for DStack<I>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<I: Clone> Clone for DStack<I>
[src]
impl<I: Clone> Clone for DStack<I>