Struct lattice_graph::square::SquareGraph [−][src]
pub struct SquareGraph<N, E, Ix = usize, S = DefaultShape> where
Ix: IndexType, { /* fields omitted */ }
Expand description
Undirected Square Grid Graph. It is has rectangle shape.
Node(i,j+1) - Edge(i,j+1,Horizontal) - Node(i+1,j+1) | | Edge(i,j,Vertical) Edge(i+1,j,Vertical) | | Node(i,j) - Edge(i,j,Horizontal) - Node(i+1,j)
Implementations
pub unsafe fn new_raw(
nodes: FixedVec2D<N>,
horizontal: FixedVec2D<E>,
vertical: FixedVec2D<E>
) -> Self
pub unsafe fn new_raw(
nodes: FixedVec2D<N>,
horizontal: FixedVec2D<E>,
vertical: FixedVec2D<E>
) -> Self
Create a SquareGraph
from raw data.
It only check whether the size of nodes and edges are correct in debug_assertion
.
Create a SquareGraph
with the nodes and edges initialized with default.
Creates a SquareGraph
with initializing nodes and edges from position.
pub fn get_edge_id(
&self,
node: NodeIndex<Ix>,
dir: SquareDirection
) -> Option<(EdgeIndex<Ix>, bool)>
pub fn get_edge_id(
&self,
node: NodeIndex<Ix>,
dir: SquareDirection
) -> Option<(EdgeIndex<Ix>, bool)>
Get the edge from node.
pub fn get_edge_reference<'a>(
&'a self,
n: NodeIndex<Ix>,
dir: SquareDirection
) -> Option<EdgeReference<'a, E, Ix, S>>
pub fn get_edge_reference<'a>(
&'a self,
n: NodeIndex<Ix>,
dir: SquareDirection
) -> Option<EdgeReference<'a, E, Ix, S>>
Get the edge reference form node.
Returns the Node count in the horizontal direction.
Returns the Node count in the vertical direction.
Get a reference to the horizontal edges. [horizontal][vertical]
Get a mutable reference to the nodes. [horizontal][vertical]
Get a mutable reference to the horizontal edges. [horizontal][vertical]
Get a mutable reference to the vertical edges.
Trait Implementations
type NodeWeight = N
type EdgeWeight = E
type EdgeType = Undirected
type EdgeType = Undirected
The kind edges in the graph.
impl<'a, N, E, Ix, S> IntoEdgeReferences for &'a SquareGraph<N, E, Ix, S> where
Ix: IndexType,
E: Copy,
S: Shape,
impl<'a, N, E, Ix, S> IntoEdgeReferences for &'a SquareGraph<N, E, Ix, S> where
Ix: IndexType,
E: Copy,
S: Shape,
type EdgeRef = EdgeReference<'a, E, Ix, S>
type EdgeReferences = EdgeReferences<'a, E, Ix, S>
impl<'a, N, E, Ix, S> IntoNeighbors for &'a SquareGraph<N, E, Ix, S> where
Ix: IndexType,
S: Shape,
impl<'a, N, E, Ix, S> IntoNeighbors for &'a SquareGraph<N, E, Ix, S> where
Ix: IndexType,
S: Shape,
impl<'a, N, E, Ix, S> IntoNeighborsDirected for &'a SquareGraph<N, E, Ix, S> where
Ix: IndexType,
S: Shape,
impl<'a, N, E, Ix, S> IntoNeighborsDirected for &'a SquareGraph<N, E, Ix, S> where
Ix: IndexType,
S: Shape,
type NeighborsDirected = Neighbors<Ix, S>
impl<'a, N, E, Ix, S> IntoNodeIdentifiers for &'a SquareGraph<N, E, Ix, S> where
Ix: IndexType,
Range<Ix>: Iterator<Item = Ix>,
impl<'a, N, E, Ix, S> IntoNodeIdentifiers for &'a SquareGraph<N, E, Ix, S> where
Ix: IndexType,
Range<Ix>: Iterator<Item = Ix>,
type NodeIdentifiers = NodeIndices<Ix>
impl<'a, N: Clone, E, Ix, S> IntoNodeReferences for &'a SquareGraph<N, E, Ix, S> where
Ix: IndexType,
Range<Ix>: Iterator<Item = Ix>,
impl<'a, N: Clone, E, Ix, S> IntoNodeReferences for &'a SquareGraph<N, E, Ix, S> where
Ix: IndexType,
Range<Ix>: Iterator<Item = Ix>,
type NodeReferences = NodeReferences<'a, N, Ix>
Auto Trait Implementations
impl<N, E, Ix, S> RefUnwindSafe for SquareGraph<N, E, Ix, S> where
E: RefUnwindSafe,
N: RefUnwindSafe,
impl<N, E, Ix, S> Send for SquareGraph<N, E, Ix, S> where
E: Send,
N: Send,
impl<N, E, Ix, S> Sync for SquareGraph<N, E, Ix, S> where
E: Sync,
N: Sync,
impl<N, E, Ix, S> Unpin for SquareGraph<N, E, Ix, S>
impl<N, E, Ix, S> UnwindSafe for SquareGraph<N, E, Ix, S> where
E: RefUnwindSafe,
N: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
get wheter the type is const generic wrapper.