Struct matrixgraph::SimpleGraph
[−]
[src]
pub struct SimpleGraph { /* fields omitted */ }
A simple graph represented by the upper right triangle of an adjacency matrix of fixed size
The cells of the adjacency matrix are assigned values of type Option
Methods
impl SimpleGraph
[src]
fn new(size: usize) -> SimpleGraph
Creates a new simple graph object with a fixed size.
fn from_vec(weights: &Vec<Option<f64>>) -> SimpleGraph
Creates a new simple graph object with a fixed size from a vector that is the row-wise representation of the upper right triangle of an adjacency matrix.
Note: A zero-sized vector creates a graph with a single vertex.
fn to_vec(&self) -> Vec<Option<f64>>
Returns the vector that is the row-wise representation of the upper right triangle of the adjacency matrix of the simple graph.
fn to_digraph_vec(&self) -> Vec<Option<f64>>
Returns the vector that is the row-wise representation of the full adjacency matrix of the simple graph.
Trait Implementations
impl PartialEq for SimpleGraph
[src]
fn eq(&self, __arg_0: &SimpleGraph) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &SimpleGraph) -> bool
This method tests for !=
.
impl Clone for SimpleGraph
[src]
fn clone(&self) -> SimpleGraph
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more