pub struct SparseIncidenceMatrix {
pub place_count: usize,
pub trans_count: usize,
pub consumed: Vec<Vec<(usize, i64)>>,
pub produced: Vec<Vec<(usize, i64)>>,
pub deltas: Vec<Vec<(usize, i64)>>,
}Fields§
§place_count: usize§trans_count: usize§consumed: Vec<Vec<(usize, i64)>>For each transition, list of (place_idx, tokens_consumed)
produced: Vec<Vec<(usize, i64)>>For each transition, list of (place_idx, tokens_produced)
deltas: Vec<Vec<(usize, i64)>>Net delta per transition: list of (place_idx, delta)
Implementations§
Source§impl SparseIncidenceMatrix
impl SparseIncidenceMatrix
Sourcepub fn from_dense(
d: &[Vec<i64>],
place_count: usize,
trans_count: usize,
) -> Self
pub fn from_dense( d: &[Vec<i64>], place_count: usize, trans_count: usize, ) -> Self
Create a SparseIncidenceMatrix from a dense incidence matrix D (rows=places, cols=transitions).
Sourcepub fn is_enabled(&self, t: usize, marking: &[i64]) -> bool
pub fn is_enabled(&self, t: usize, marking: &[i64]) -> bool
Check if transition t is enabled under the given marking slice.
Trait Implementations§
Source§impl Clone for SparseIncidenceMatrix
impl Clone for SparseIncidenceMatrix
Source§impl Debug for SparseIncidenceMatrix
impl Debug for SparseIncidenceMatrix
Source§impl<'de> Deserialize<'de> for SparseIncidenceMatrix
impl<'de> Deserialize<'de> for SparseIncidenceMatrix
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SparseIncidenceMatrix
Source§impl PartialEq for SparseIncidenceMatrix
impl PartialEq for SparseIncidenceMatrix
Source§impl Serialize for SparseIncidenceMatrix
impl Serialize for SparseIncidenceMatrix
impl StructuralPartialEq for SparseIncidenceMatrix
Auto Trait Implementations§
impl Forget for SparseIncidenceMatrix
impl Freeze for SparseIncidenceMatrix
impl RefUnwindSafe for SparseIncidenceMatrix
impl Send for SparseIncidenceMatrix
impl Sync for SparseIncidenceMatrix
impl Unpin for SparseIncidenceMatrix
impl UnsafeUnpin for SparseIncidenceMatrix
impl UnwindSafe for SparseIncidenceMatrix
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.