pub struct MultiSampleEdge { /* private fields */ }Expand description
Edge class for connecting nodes in the graph that tracks some per-sample information.
This class extends BaseEdge with the additional functionality of tracking the maximum multiplicity seen within any single sample. The workflow for using this class is:
{@code
MultiSampleEdge e = new MultiSampleEdge(ref, 1)
e.incMultiplicity(1) // total is 2, per sample is 2, max per sample is 1
e.getPruningMultiplicity() // = 1
e.flushSingleSampleMultiplicity() // total is 2, per sample is 0, max per sample is 2
e.getPruningMultiplicity() // = 2
e.incMultiplicity(3) // total is 5, per sample is 3, max per sample is 2
e.getPruningMultiplicity() // = 2
e.flushSingleSampleMultiplicity() // total is 5, per sample is 0, max per sample is 3
e.getPruningMultiplicity() // = 3
}
Implementations§
Source§impl MultiSampleEdge
impl MultiSampleEdge
pub fn set( &mut self, is_ref: bool, multiplicity: usize, single_sample_capacity: usize, )
Sourcepub fn flush_single_sample_multiplicity(&mut self)
pub fn flush_single_sample_multiplicity(&mut self)
update the single sample multiplicities by adding the current single sample multiplicity to the priority queue, and reset the current single sample multiplicity to 0.
pub fn inc_multiplicity(&mut self, incr: usize)
pub fn get_pruning_multiplicity(&self) -> usize
pub fn add_reference_index(&mut self, i: usize)
pub fn get_reference_path_indexes(&self) -> &Vec<usize>
pub fn get_current_single_sample_multiplicity(&self) -> usize
Trait Implementations§
Source§impl BaseEdge for MultiSampleEdge
impl BaseEdge for MultiSampleEdge
Source§fn new(
is_ref: bool,
multiplicity: usize,
single_sample_capacity: usize,
) -> MultiSampleEdge
fn new( is_ref: bool, multiplicity: usize, single_sample_capacity: usize, ) -> MultiSampleEdge
Create a new MultiSampleEdge with weight multiplicity and, if isRef == true, indicates a path through the reference
@param isRef indicates whether this edge is a path through the reference @param multiplicity the number of observations of this edge in this sample @param singleSampleCapacity the max number of samples to track edge multiplicities
Source§fn get_multiplicity(&self) -> usize
fn get_multiplicity(&self) -> usize
Get the number of observations of paths connecting two vertices @return a positive integer >= 0
Source§fn get_dot_label(&self) -> String
fn get_dot_label(&self) -> String
Get the DOT format label for this edge, to be displayed when printing this edge to a DOT file @return a non-null string
Source§fn inc_multiplicity(&mut self, incr: usize)
fn inc_multiplicity(&mut self, incr: usize)
Increase the multiplicity of this edge by incr @param incr the change in this multiplicity, must be >= 0
Source§fn get_pruning_multiplicity(&self) -> usize
fn get_pruning_multiplicity(&self) -> usize
A special assessor that returns the multiplicity that should be used by pruning algorithm
@return the multiplicity value that should be used for pruning
Source§fn set_multiplicity(&mut self, value: usize)
fn set_multiplicity(&mut self, value: usize)
Set the multiplicity of this edge to value @param value an integer >= 0
Source§fn is_ref(&self) -> bool
fn is_ref(&self) -> bool
Does this edge indicate a path through the reference graph? @return true if so
Source§fn set_is_ref(&mut self, is_ref: bool)
fn set_is_ref(&mut self, is_ref: bool)
Indicate that this edge follows the reference sequence, or not @param isRef true if this is a reference edge
Source§fn add(&mut self, edge: Self)
fn add(&mut self, edge: Self)
Add edge to this edge, updating isRef and multiplicity as appropriate
isRef is simply the or of this and edge multiplicity is the sum
@param edge the edge to add @return this
Source§fn make_o_r_edge(
edges: Vec<Self>,
multiplicity: usize,
single_sample_capacity: usize,
) -> Self
fn make_o_r_edge( edges: Vec<Self>, multiplicity: usize, single_sample_capacity: usize, ) -> Self
Create a new BaseEdge with the given multiplicity. The resulting edge is a reference edge if any of the argument edges are reference.
@param edges a collection of edges to or their isRef values @param multiplicity our desired multiplicity @return a newly allocated BaseEdge
fn to_string(&self) -> String
Source§impl Clone for MultiSampleEdge
impl Clone for MultiSampleEdge
Source§fn clone(&self) -> MultiSampleEdge
fn clone(&self) -> MultiSampleEdge
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MultiSampleEdge
impl Debug for MultiSampleEdge
Source§impl Hash for MultiSampleEdge
impl Hash for MultiSampleEdge
Source§impl PartialEq for MultiSampleEdge
impl PartialEq for MultiSampleEdge
impl Eq for MultiSampleEdge
Auto Trait Implementations§
impl Freeze for MultiSampleEdge
impl RefUnwindSafe for MultiSampleEdge
impl Send for MultiSampleEdge
impl Sync for MultiSampleEdge
impl Unpin for MultiSampleEdge
impl UnwindSafe for MultiSampleEdge
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
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.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
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.