pub struct Marking<T: Ord + Copy> { /* private fields */ }Expand description
Hollow usize vector sorted with generic indices
Allow manipulation of big vector which contains a lot of zeroes. This type of vector is very useful to represent the connection between locations and transitions in order to avoid creating a matrix mainly filled with zeros.
Implementations§
Source§impl<T> Marking<T>
impl<T> Marking<T>
Sourcepub fn iter(&self) -> Iter<'_, (T, usize)>
pub fn iter(&self) -> Iter<'_, (T, usize)>
Return a iterator over all present elements in the marking
Sourcepub fn iter_with<'m>(&'m self, other: &'m Self) -> DualMarkingIterator<'m, T>
pub fn iter_with<'m>(&'m self, other: &'m Self) -> DualMarkingIterator<'m, T>
Return an iterator over two marking at same time. Useful to compare marking with a complexity of O(2n) instead of O(2nln(n))
Sourcepub fn insert_or_add(&mut self, index: T, weight: usize)
pub fn insert_or_add(&mut self, index: T, weight: usize)
Increment the value contained in the marking by weight.
If the tag does not contain a value associated with the index, weight is inserted into the index.
Sourcepub fn insert_or_min(&mut self, index: T, weight: usize)
pub fn insert_or_min(&mut self, index: T, weight: usize)
Keeps the minimum value between that contained in the marking and weight.
If the tag does not contain a value associated with the index, weight is inserted into the index.
Sourcepub fn insert_or_max(&mut self, index: T, weight: usize)
pub fn insert_or_max(&mut self, index: T, weight: usize)
Keeps the maximum value between that contained in the marking and weight.
If the tag does not contain a value associated with the index, weight is inserted into the index.