Skip to main content

GraphProjection

Struct GraphProjection 

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

Materialized binary graph projection.

This view exposes OxGraph canonical topology through oxgraph-graph traits. Outgoing arrays are CSR-shaped; incoming arrays are CSC-shaped.

§Performance

Cloning is O(n + m) for visible nodes and edges. Traversal is O(k) for each yielded adjacency list.

Implementations§

Source§

impl GraphProjection

Source

pub const fn definition(&self) -> &GraphProjectionDefinition

Returns the definition used for this projection.

§Performance

This method is O(1).

Trait Implementations§

Source§

impl CanonicalElementIdentity for GraphProjection

Source§

type CanonicalElementId = ElementId

Canonical element ID guaranteed by this view. Read more
Source§

fn canonical_element_id( &self, element: Self::ElementId, ) -> Self::CanonicalElementId

Returns the canonical ID for a visible local element. Read more
Source§

impl CanonicalRelationIdentity for GraphProjection

Source§

type CanonicalRelationId = RelationId

Canonical relation ID guaranteed by this view. Read more
Source§

fn canonical_relation_id( &self, relation: Self::RelationId, ) -> Self::CanonicalRelationId

Returns the canonical ID for a visible local relation. Read more
Source§

impl Clone for GraphProjection

Source§

fn clone(&self) -> GraphProjection

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl ContainsElement for GraphProjection

Source§

fn contains_element(&self, element: Self::ElementId) -> bool

Returns whether element is valid and visible in this view. Read more
Source§

impl ContainsRelation for GraphProjection

Source§

fn contains_relation(&self, relation: Self::RelationId) -> bool

Returns whether relation is valid and visible in this view. Read more
Source§

impl Debug for GraphProjection

Source§

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

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

impl EdgeSourceGraph for GraphProjection

Source§

fn source(&self, edge: Self::RelationId) -> Self::ElementId

Returns the source node of edge. edge must be a valid edge ID.
Source§

impl EdgeTargetGraph for GraphProjection

Source§

fn target(&self, edge: Self::RelationId) -> Self::ElementId

Returns the target node of edge. edge must be a valid edge ID.
Source§

impl ElementIndex for GraphProjection

Source§

fn element_bound(&self) -> usize

Returns the exclusive upper bound for element indexes in this view. Read more
Source§

fn element_index(&self, element: Self::ElementId) -> usize

Returns the dense index for element in this view. Read more
Source§

impl ElementPredecessors for GraphProjection

Source§

type Predecessors<'view> = Copied<Iter<'view, ProjectionElementId>> where Self: 'view

Iterator over predecessor element IDs reaching one element. Read more
Source§

fn element_predecessors( &self, element: Self::ElementId, ) -> Self::Predecessors<'_>

Returns elements that reach element through outgoing connections. Read more
Source§

impl ElementSuccessors for GraphProjection

Source§

type Successors<'view> = Copied<Iter<'view, ProjectionElementId>> where Self: 'view

Iterator over successor element IDs reached from one element. Read more
Source§

fn element_successors(&self, element: Self::ElementId) -> Self::Successors<'_>

Returns elements reachable through outgoing connections from element. Read more
Source§

impl Eq for GraphProjection

Source§

impl GraphCounts for GraphProjection

Source§

fn node_count(&self) -> usize

Returns the number of nodes visible in this graph view.
Source§

fn edge_count(&self) -> usize

Returns the number of edges visible in this graph view.
Source§

impl IncomingEdgeCount for GraphProjection

Source§

fn in_degree(&self, node: Self::ElementId) -> usize

Returns the number of edges entering node.
Source§

impl IncomingGraph for GraphProjection

Source§

type InEdges<'view> = Copied<Iter<'view, ProjectionRelationId>> where Self: 'view

Iterator over edge IDs entering one target node.
Source§

fn incoming_edges(&self, node: Self::ElementId) -> Self::InEdges<'_>

Returns edges whose target is node.
Source§

impl LocalElementIdentity for GraphProjection

Source§

fn local_element_id( &self, canonical: Self::CanonicalElementId, ) -> Option<Self::ElementId>

Returns the visible local element for canonical, if present. Read more
Source§

impl LocalRelationIdentity for GraphProjection

Source§

fn local_relation_id( &self, canonical: Self::CanonicalRelationId, ) -> Option<Self::RelationId>

Returns the visible local relation for canonical, if present. Read more
Source§

impl OutgoingEdgeCount for GraphProjection

Source§

fn out_degree(&self, node: Self::ElementId) -> usize

Returns the number of edges leaving node.
Source§

impl OutgoingGraph for GraphProjection

Source§

type OutEdges<'view> = Copied<Iter<'view, ProjectionRelationId>> where Self: 'view

Iterator over edge IDs leaving one source node.
Source§

fn outgoing_edges(&self, node: Self::ElementId) -> Self::OutEdges<'_>

Returns edges whose source is node.
Source§

impl PartialEq for GraphProjection

Source§

fn eq(&self, other: &GraphProjection) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl RelationIndex for GraphProjection

Source§

fn relation_bound(&self) -> usize

Returns the exclusive upper bound for relation indexes in this view. Read more
Source§

fn relation_index(&self, relation: Self::RelationId) -> usize

Returns the dense index for relation in this view. Read more
Source§

impl StructuralPartialEq for GraphProjection

Source§

impl TopologyBase for GraphProjection

Source§

type ElementId = ProjectionElementId

Identity of a topology element. Read more
Source§

type RelationId = ProjectionRelationId

Identity of a topology relation. Read more
Source§

impl TopologyCounts for GraphProjection

Source§

fn element_count(&self) -> usize

Returns the number of elements visible in this topology view. Read more
Source§

fn relation_count(&self) -> usize

Returns the number of relations visible in this topology view. 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> ContainsEdge for T

Source§

fn contains_edge(&self, edge: Self::RelationId) -> bool

Returns whether edge is valid and visible in this graph view.
Source§

impl<T> ContainsHyperedge for T

Source§

fn contains_hyperedge(&self, hyperedge: Self::RelationId) -> bool

Returns whether hyperedge is valid and visible in this hypergraph view.
Source§

impl<T> ContainsNode for T
where T: ContainsElement,

Source§

fn contains_node(&self, node: Self::ElementId) -> bool

Returns whether node is valid and visible in this graph view.
Source§

impl<T> ContainsVertex for T
where T: ContainsElement,

Source§

fn contains_vertex(&self, vertex: Self::ElementId) -> bool

Returns whether vertex is valid and visible in this hypergraph view.
Source§

impl<T> DirectedGraph for T

Source§

impl<T> DirectedVertexPredecessors for T

Source§

type VertexPredecessors<'view> = <T as ElementPredecessors>::Predecessors<'view> where T: 'view

Iterator over predecessor vertices reaching one target-side vertex.
Source§

fn predecessor_vertices( &self, vertex: <T as TopologyBase>::ElementId, ) -> <T as DirectedVertexPredecessors>::VertexPredecessors<'_>

Returns source-side vertices that can reach vertex.
Source§

impl<T> DirectedVertexSuccessors for T

Source§

type VertexSuccessors<'view> = <T as ElementSuccessors>::Successors<'view> where T: 'view

Iterator over successor vertices reachable from one source-side vertex.
Source§

fn successor_vertices( &self, vertex: <T as TopologyBase>::ElementId, ) -> <T as DirectedVertexSuccessors>::VertexSuccessors<'_>

Returns target-side vertices reachable from vertex.
Source§

impl<T> EdgeEndpointGraph for T

Source§

fn endpoints( &self, edge: Self::RelationId, ) -> (Self::ElementId, Self::ElementId)

Returns (source, target) for edge. edge must be a valid edge ID.
Source§

impl<T> EdgeIndex for T
where T: RelationIndex,

Source§

fn edge_bound(&self) -> usize

Returns the exclusive upper bound for edge indexes in this graph view.
Source§

fn edge_index(&self, edge: Self::RelationId) -> usize

Returns the dense index for edge in this graph view.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> ForwardGraph for T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> GraphBase for T
where T: TopologyBase,

Source§

impl<T> HyperedgeIndex for T
where T: RelationIndex,

Source§

fn hyperedge_bound(&self) -> usize

Returns the exclusive upper bound for hyperedge indexes in this view.
Source§

fn hyperedge_index(&self, hyperedge: Self::RelationId) -> usize

Returns the dense index for hyperedge in this view.
Source§

impl<T> HypergraphBase for T
where T: TopologyBase,

Source§

impl<T> IncomingNeighborsGraph for T

Source§

type InNeighbors<'view> = <T as ElementPredecessors>::Predecessors<'view> where T: 'view

Iterator over nodes that have incoming edges to one target node.
Source§

fn incoming_neighbors( &self, node: <T as TopologyBase>::ElementId, ) -> <T as IncomingNeighborsGraph>::InNeighbors<'_>

Returns predecessor nodes with incoming edges to node.
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> NodeIndex for T
where T: ElementIndex,

Source§

fn node_bound(&self) -> usize

Returns the exclusive upper bound for node indexes in this graph view.
Source§

fn node_index(&self, node: Self::ElementId) -> usize

Returns the dense index for node in this graph view.
Source§

impl<T> OutgoingNeighborsGraph for T

Source§

type OutNeighbors<'view> = <T as ElementSuccessors>::Successors<'view> where T: 'view

Iterator over nodes directly reachable from one source node.
Source§

fn outgoing_neighbors( &self, node: <T as TopologyBase>::ElementId, ) -> <T as OutgoingNeighborsGraph>::OutNeighbors<'_>

Returns neighbor nodes reached by outgoing edges from node.
Source§

impl<T> ReverseGraph for T

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<T> VertexIndex for T
where T: ElementIndex,

Source§

fn vertex_bound(&self) -> usize

Returns the exclusive upper bound for vertex indexes in this view.
Source§

fn vertex_index(&self, vertex: Self::ElementId) -> usize

Returns the dense index for vertex in this view.