Struct igraph_s

Source
#[repr(C)]
pub struct igraph_s { pub n: igraph_integer_t, pub directed: igraph_bool_t, pub from: igraph_vector_t, pub to: igraph_vector_t, pub oi: igraph_vector_t, pub ii: igraph_vector_t, pub os: igraph_vector_t, pub is: igraph_vector_t, pub attr: *mut c_void, }
Expand description

\ingroup internal \struct igraph_t \brief The internal data structure for storing graphs.

It is simple and efficient. It has the following members:

  • n The number of vertices, redundant.
  • directed Whether the graph is directed.
  • from The first column of the edge list.
  • to The second column of the edge list.
  • oi The index of the edge list by the first column. Thus the first edge according to this order goes from \c from[oi[0]] to \c to[oi[0]]. The length of this vector is the same as the number of edges in the graph.
  • ii The index of the edge list by the second column. The length of this vector is the same as the number of edges.
  • os Contains pointers to the edgelist (\c from and \c to for every vertex. The first edge \em from vertex \c v is edge no. \c from[oi[os[v]]] if \c os[v]<os[v+1]. If \c os[v]==os[v+1] then there are no edges \em from node \c v. Its length is the number of vertices plus one, the last element is always the same as the number of edges and is contained only to ease the queries.
  • is This is basically the same as os, but this time for the incoming edges.

For undirected graphs, the same edge list is stored, i.e. an undirected edge is stored only once. Currently, undirected edges are canonicalized so that the index of the ‘from’ vertex is not greater than the index of the ‘to’ vertex. Thus, if v1 <= v2, only the edge (v1, v2) needs to be searched for, not (v2, v1), to determine if v1 and v2 are connected. However, this fact is NOT guaranteed by the documented public API, and should not be relied upon by the implementation of any functions, except those belonging to the minimal API in type_indexededgelist.c.

The storage requirements for a graph with \c |V| vertices and \c |E| edges is \c O(|E|+|V|).

Fields§

§n: igraph_integer_t§directed: igraph_bool_t§from: igraph_vector_t§to: igraph_vector_t§oi: igraph_vector_t§ii: igraph_vector_t§os: igraph_vector_t§is: igraph_vector_t§attr: *mut c_void

Trait Implementations§

Source§

impl Clone for igraph_s

Source§

fn clone(&self) -> igraph_s

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

impl Debug for igraph_s

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for igraph_s

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.