Struct simple_pagerank::Pagerank[][src]

pub struct Pagerank<T> where
    T: Eq + Hash + Clone
{ /* fields omitted */ }

Implementations

impl<T> Pagerank<T> where
    T: Eq + Hash + Clone
[src]

pub fn new() -> Pagerank<T>[src]

pub fn set_damping_factor(&mut self, factor: u8) -> Result<(), String>[src]

pub fn add_edge(&mut self, source: T, target: T)[src]

Adds an edge between two nodes

pub fn get_node(&mut self, name: T) -> Node<T>[src]

Returns a copy of a node

pub fn get_node_id(&mut self, name: T) -> usize[src]

Returns the node_id for a given node name

pub fn calculate_with_convergence(&mut self, convergence: f64) -> i32[src]

Calculates PageRank with custom convergence

pub fn calculate(&mut self) -> i32[src]

Calculates pagerank with custom convergence

pub fn nodes(&self) -> Vec<Node<T>>[src]

Return all nodes, sorted by their pagerank

pub fn calculate_step(&mut self) -> f64[src]

Calculates a single iteration of the PageRank

pub fn len_with_incoming_edges(&mut self) -> usize[src]

Len of all edges

pub fn len(&self) -> usize[src]

Return the number of vertices/nodes in the current graph

pub fn len_edge(&self) -> usize[src]

Returns the number of edges in the current graph

pub fn is_empty(&self) -> bool[src]

Trait Implementations

impl<T> Default for Pagerank<T> where
    T: Eq + Hash + Clone
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Pagerank<T> where
    T: RefUnwindSafe

impl<T> Send for Pagerank<T> where
    T: Send

impl<T> Sync for Pagerank<T> where
    T: Sync

impl<T> Unpin for Pagerank<T> where
    T: Unpin

impl<T> UnwindSafe for Pagerank<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.