/// Removes and returns the element at position index within the `PartitionVec<T>`,
/// shifting all elements after it to the left.
///
/// This will take `O(n + m)` time where `m` is the size of the set that `index` belongs to.
///
/// # Panics
///
/// Panics if `index` is out of bounds.
///
/// # Examples
///
/// ```
/// # #[macro_use]
/// # extern crate partitions;
/// #
/// # fn main() {
/// let mut partition_vec = partition_vec![
///     0 => 0,
///     1 => 1,
///     2 => 0,
///     3 => 2,
/// ];
///
/// assert!(partition_vec.remove(2) == 2);
///
/// assert!(partition_vec[2] == 3);
/// assert!(partition_vec.amount_of_sets() == 3);
/// # }
/// ```
Removes and returns the element at position index within the `PartitionVec`,
shifting all elements after it to the left.


Removes and returns the element at position index within the ` PartitionVec ` shifting all elements after it to the left .
pub fn remove(&mut self, index: usize) -> T {
        self.make_singleton(index);
        self.meta.remove(index);
        // We lower all values that point above the index.
        for i in 0 .. self.meta.len() {
            let parent = self.meta[i].parent();
            if parent > index {
                self.meta[i].set_parent(parent - 1);
            }
            let link = self.meta[i].link();
            if link > index {
                self.meta[i].set_link(link - 1);
            }
        }
        self.data.remove(index)
    }
pub fn remove ( & mut self , index : usize ) -> T { self . make_singleton ( index ) ; self . meta . remove ( index ) ; // We lower all values that point above the index. for i in 0 .. self . meta . len ( ) { let parent = self . meta [ i ] . parent ( ) ; if parent > index { self . meta [ i ] . set_parent ( parent - 1 ) ; } let link = self . meta [ i ] . link ( ) ; if link > index { self . meta [ i ] . set_link ( link - 1 ) ; } } self . data . remove ( index ) }
Removes and returns the element at position index within the `PartitionVec<T>`,
shifting all elements after it to the left.
Removes and returns the element at position index within the ` PartitionVec<T > ` shifting all elements after it to the left .
&mut self
index
usize
panics
Panics if `index` is out of bounds.
Panics if ` index ` is out of bounds .
examples
None
#[macro_use]
None
extern crate partitions;
None
fn main() {


assert!(partition_vec.remove(2) == 2).

assert!(partition_vec[2] == 3);
assert!(partition_vec.amount_of_sets() == 3).
assert! ( partition_vec . remove ( 2 ) == 2 ) . assert! ( partition_vec [ 2 ] == 3 ) ; assert! ( partition_vec . amount_of_sets () == 3 ) .
}
None