pub struct LatticeGraph<N, E, S: Shape> { /* private fields */ }
Expand description

Abstract Lattice Graph. It holds the node and edge weight data. The actural behaviour is dependent on Shape.

Implementations

Creates a graph with uninitalized node and edge weight data. It is extremely unsafe so should use with MaybeUninit and use assume_init.

Creates a graph with node and edge weight data set to default.

Creates a graph with node and edge weight data from the coordinate.

Get a reference to the lattice graph’s s.

Creates a graph with node and edge weight data set to default with Shape from default.

Creates a graph with uninitalized node and edge weight data with Shape from default. It is extremely unsafe so should use with MaybeUninit and use assume_init.

Creates a graph with node and edge weight data from the coordinate with Shape from default.

Assume the underlying nodes and edges to be initialized.

let mut hex = unsafe { HexGraphConst::<MaybeUninit<f32>, MaybeUninit<()>, OddR, 5, 5>::new_uninit_s() };
for i in 0..5{
    for j in 0..5{
        let offset = Offset::new(i, j);
        let coord = hex.shape().from_offset(offset);
        if let Some(ref mut n) = hex.node_weight_mut(coord){
            **n = MaybeUninit::new((i + j) as f32);
        }
    }
}
let hex_init = unsafe{ hex.assume_init() };

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Executes the destructor for this type. Read more

The associated adjacency matrix type

Create the adjacency matrix

Return true if there is an edge from a to b, false otherwise. Read more

node identifier

edge identifier

The kind edges in the graph.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Return an iterator of the neighbors of node a.

Return an upper bound of the node indices in the graph (suitable for the size of a bitmap). Read more

Convert a to an integer index.

Convert i to a node index. i must be a valid value in the graph.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The associated map type

Create a new visitor map

Reset the visitor map (and resize to new size of graph if needed)

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

get wheter the type is const generic wrapper.

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.