pub struct MarkovFlow {
pub adjacency_matrix: DMatrix<f64>,
pub dim: usize,
pub sink_matrix: DMatrix<f64>,
pub sensitivity_matrix: DMatrix<f64>,
pub influence_matrix: DMatrix<f64>,
pub origin_matrix: DMatrix<f64>,
pub dependency_matrix: DMatrix<f64>,
pub in_vector: DVector<f64>,
pub flow_vector: DVector<f64>,
pub flow_matrix: DMatrix<f64>,
}
Expand description
MarkovFlow struct contains all results of the Markov flow calculations based on an adjacency matrix, evaporation constant, and scaling toggle.
§Example
extern crate nalgebra as na;
use ratio_markov::{DMatrix, DVector, MarkovFlow};
let adj = DMatrix::from_row_slice(3, 3, &[2.0, 0.5, 0.7, 1.0, 2.0, 3.0, 1.0, 2.6, 0.1]);
let markov = MarkovFlow::new(&adj, 4.0, false);
Fields§
§adjacency_matrix: DMatrix<f64>
Adjacency matrix with only positive values. Negatives are set to 0.0.
dim: usize
Dimension of this problem (size of adjacency matrix axes).
sink_matrix: DMatrix<f64>
Sink matrix. A probability matrix that has been provided with a evaporation sink.
sensitivity_matrix: DMatrix<f64>
Sensitivity matrix that shows how much flow from a source node ends up in another node if it were injected with 1.0.
influence_matrix: DMatrix<f64>
Influence matrix, percentage of outflow through j ends up in i.
origin_matrix: DMatrix<f64>
Origin matrix that shows how much flow originates from a source node in a target node if its flow is 1.0.
dependency_matrix: DMatrix<f64>
Dependency matrix, percentage of inflow through j coming from i.
in_vector: DVector<f64>
Input vector (ones or scaled).
flow_vector: DVector<f64>
Flow vector through each node w.r.t. input vector.
flow_matrix: DMatrix<f64>
Flow matrix denoting the resulting flow over every edge when the system is injected with in_vector.
Implementations§
Source§impl MarkovFlow
impl MarkovFlow
Sourcepub fn new(adj: &DMatrix<f64>, mu: f64, scale: bool) -> MarkovFlow
pub fn new(adj: &DMatrix<f64>, mu: f64, scale: bool) -> MarkovFlow
New MarkovFlow struct containing all Markov chain calculations.
§Arguments
adj
- Square adjacency matrix with nodes in identical order on both axis. Only positive adjacency values are used in the calculations.mu
- Evaporation constant. Factor by which flow is reduced after passing through a node.scale
- Whether injected flow in each node should be scaled according to the output adjacency of a node.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MarkovFlow
impl RefUnwindSafe for MarkovFlow
impl Send for MarkovFlow
impl Sync for MarkovFlow
impl Unpin for MarkovFlow
impl UnwindSafe for MarkovFlow
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<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.