Struct Network

Source
pub struct Network { /* private fields */ }
Expand description

§Definition of struct Network, the implementation of network in mathmatics.

Expression of network or graph is “The set of vertexes and the set of links which is pair of the vertex”.
I use this index rule: the vertex is denoted by number 0 ~ n-1, n as the amount of the vertexes.
So the expression of the struct Network becomes simple and smart.

Note : A famous way of the expression of network is adjacency matrix, but it use O(n^2) memory space.
I may prepare the access to the adjacency matrix bia function, but it is not inevitable. Many of the calculation experiment program for the network dynamics like percolation is written with using edge list expression of the network, not adjacency matrix.

Implementations§

Source§

impl Network

Source

pub fn make_square_lattice(length: u32) -> Network

Create square lattice.

Source

pub fn make_regular_lattice(dim: u32, length: u32) -> Network

Create regular lattice

Source

pub fn make_regular_random_graph(n: u32, frac: f64, rng: &mut StdRng) -> Network

create regular random graph

Source

pub fn exist_self_loop(&self) -> bool

Check of the self loop Calculation time is O(L).

Source

pub fn exist_multi_loop(&self) -> bool

Check of the multi loop Caution : Calculation time is O(L^2), it can be vast time. Be careful.

Source

pub fn show_network(&self)

Source§

impl Network

Source

pub fn get_n(&self) -> u32

Get Network.n

Source

pub fn get_edge_list(&self) -> Vec<(u32, u32)>

Get Network.edge_list

Source

pub fn get_average_degree(&self) -> f64

Get average degree of the network Calculation time : O(1)

Trait Implementations§

Source§

impl Clone for Network

Source§

fn clone(&self) -> Network

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

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

Performs copy-assignment from source. Read more

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> 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<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> 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