MultiSampleEdge

Struct MultiSampleEdge 

Source
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

Source

pub fn set( &mut self, is_ref: bool, multiplicity: usize, single_sample_capacity: usize, )

Source

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.

Source

pub fn inc_multiplicity(&mut self, incr: usize)

Source

pub fn get_pruning_multiplicity(&self) -> usize

Source

pub fn add_reference_index(&mut self, i: usize)

Source

pub fn get_reference_path_indexes(&self) -> &Vec<usize>

Source

pub fn get_current_single_sample_multiplicity(&self) -> usize

Trait Implementations§

Source§

impl BaseEdge for MultiSampleEdge

Source§

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

Get the number of observations of paths connecting two vertices @return a positive integer >= 0

Source§

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)

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

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)

Set the multiplicity of this edge to value @param value an integer >= 0

Source§

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)

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)

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

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

Source§

fn to_string(&self) -> String

Source§

impl Clone for MultiSampleEdge

Source§

fn clone(&self) -> MultiSampleEdge

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MultiSampleEdge

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for MultiSampleEdge

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for MultiSampleEdge

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for MultiSampleEdge

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CallHasher for T
where T: Hash + ?Sized,

Source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<T> Ungil for T
where T: Send,