pub struct InfluenceMap {
pub vertex_count: usize,
/* private fields */
}Expand description
Map from vertex_id to VertexInfluence. Built from a collection of TargetFile objects.
Fields§
§vertex_count: usizeImplementations§
Source§impl InfluenceMap
impl InfluenceMap
Sourcepub fn build(targets: &[(&str, &TargetFile)]) -> Self
pub fn build(targets: &[(&str, &TargetFile)]) -> Self
Build from a list of (name, target) pairs.
Sourcepub fn get(&self, vertex_id: u32) -> Option<&VertexInfluence>
pub fn get(&self, vertex_id: u32) -> Option<&VertexInfluence>
Get influence info for a specific vertex. Returns None if vertex is unaffected.
Sourcepub fn affected_vertex_count(&self) -> usize
pub fn affected_vertex_count(&self) -> usize
Number of vertices that are affected by at least one target.
Sourcepub fn iter(&self) -> impl Iterator<Item = &VertexInfluence>
pub fn iter(&self) -> impl Iterator<Item = &VertexInfluence>
Iterate over all VertexInfluence entries.
Sourcepub fn top_vertices(&self, n: usize) -> Vec<&VertexInfluence>
pub fn top_vertices(&self, n: usize) -> Vec<&VertexInfluence>
Find the top-N most-influenced vertices (by total magnitude).
Sourcepub fn vertices_for_target(&self, target_name: &str) -> Vec<u32>
pub fn vertices_for_target(&self, target_name: &str) -> Vec<u32>
Find all vertices affected by a specific target.
Sourcepub fn targets_for_vertex(&self, vertex_id: u32) -> Vec<(&str, f32)>
pub fn targets_for_vertex(&self, vertex_id: u32) -> Vec<(&str, f32)>
Find all targets that affect a specific vertex.
Sourcepub fn target_stats(&self) -> Vec<(String, usize, f32)>
pub fn target_stats(&self) -> Vec<(String, usize, f32)>
Compute per-target statistics: (target_name, vertex_count, total_delta_magnitude).
Sourcepub fn isolated_vertices(&self) -> Vec<u32>
pub fn isolated_vertices(&self) -> Vec<u32>
Find “isolated” vertices: affected by only 1 target.
Find “shared” vertices: affected by N or more targets.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InfluenceMap
impl RefUnwindSafe for InfluenceMap
impl Send for InfluenceMap
impl Sync for InfluenceMap
impl Unpin for InfluenceMap
impl UnsafeUnpin for InfluenceMap
impl UnwindSafe for InfluenceMap
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
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>
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 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>
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