pub struct BidirectedAdjacencyArray<IndexType: GraphIndexInteger, NodeData, EdgeData> { /* private fields */ }Implementations§
Source§impl<IndexType: GraphIndexInteger, NodeData, EdgeData> BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType: GraphIndexInteger, NodeData, EdgeData> BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
Sourcepub fn new(
nodes: TaggedVec<NodeIndex<IndexType>, NodeData>,
edges: TaggedVec<EdgeIndex<IndexType>, BidirectedEdge<IndexType, EdgeData>>,
) -> Self
pub fn new( nodes: TaggedVec<NodeIndex<IndexType>, NodeData>, edges: TaggedVec<EdgeIndex<IndexType>, BidirectedEdge<IndexType, EdgeData>>, ) -> Self
Creates a bidirected adjacency array with the given bidirected nodes and edges.
§Example
use bidirected_adjacency_array::graph::BidirectedAdjacencyArray;
use bidirected_adjacency_array::index::{NodeIndex, EdgeIndex};
use bidirected_adjacency_array::graph::BidirectedEdge;
use tagged_vec::TaggedVec;
let nodes = TaggedVec::from(vec!['A', 'B', 'C']);
let edges = TaggedVec::from(vec![
BidirectedEdge::new(NodeIndex::from_usize(0).into_directed_forward(), NodeIndex::from_usize(1).into_directed_forward(), 1), // A+ -> B+
BidirectedEdge::new(NodeIndex::from_usize(1).into_directed_reverse(), NodeIndex::from_usize(2).into_directed_forward(), 2), // B- -> C+
]);
let graph = BidirectedAdjacencyArray::<u8, _, _>::new(nodes, edges);Sourcepub fn reorder_edges(
&mut self,
node: DirectedNodeIndex<IndexType>,
comparator: impl FnMut(DirectedNodeIndex<IndexType>, DirectedNodeIndex<IndexType>) -> Ordering,
)
pub fn reorder_edges( &mut self, node: DirectedNodeIndex<IndexType>, comparator: impl FnMut(DirectedNodeIndex<IndexType>, DirectedNodeIndex<IndexType>) -> Ordering, )
Reorder the edges of the given node according to the given comparator.
The comparator receives two different to-nodes, representing the two edges from the given node to these to-nodes.
Sourcepub fn remove_multiedges(&mut self) -> BTreeSet<EdgeIndex<IndexType>>
pub fn remove_multiedges(&mut self) -> BTreeSet<EdgeIndex<IndexType>>
Removes multiedges between the same pair of directed nodes, keeping only one of them.
Warning: This does not check if the edge data of the multiedges is actually the same, and simply keeps one of them. It is the caller’s responsibility to ensure that this is the case if they want to keep the data consistent.
Returns the indices of the removed edges. Note that this method shifts the edge indices, and hence the returned indices now respond to different edges in the graph, or possibly no edge at all.
pub fn node_count(&self) -> usize
pub fn edge_count(&self) -> usize
pub fn iter_nodes(&self) -> impl Iterator<Item = NodeIndex<IndexType>>
pub fn iter_edges(&self) -> impl Iterator<Item = EdgeIndex<IndexType>>
pub fn iter_outgoing_edges( &self, node: DirectedNodeIndex<IndexType>, ) -> impl Iterator<Item = DirectedEdge<IndexType>>
Sourcepub fn iter_incident_edges(
&self,
node: NodeIndex<IndexType>,
) -> impl Iterator<Item = EdgeIndex<IndexType>>
pub fn iter_incident_edges( &self, node: NodeIndex<IndexType>, ) -> impl Iterator<Item = EdgeIndex<IndexType>>
Iterate over the bidirected edges incident to the given bidirected node.
pub fn node_data(&self, node: NodeIndex<IndexType>) -> &NodeData
pub fn edge( &self, edge: EdgeIndex<IndexType>, ) -> EdgeView<'_, IndexType, EdgeData>
pub fn directed_edge_data<'this>( &'this self, directed_edge: DirectedEdgeIndex<IndexType>, ) -> DirectedEdgeDataView<'this, IndexType, EdgeData>
pub fn directed_edge_into_bidirected( &self, directed_edge: DirectedEdgeIndex<IndexType>, ) -> EdgeIndex<IndexType>
Source§impl<IndexType: GraphIndexInteger, NodeData: From<PlainGfaNodeData>, EdgeData: From<PlainGfaEdgeData>> BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType: GraphIndexInteger, NodeData: From<PlainGfaNodeData>, EdgeData: From<PlainGfaEdgeData>> BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
pub fn read_gfa1( reader: impl BufRead, ) -> Result<BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>, GfaReadError>
Source§impl<IndexType: GraphIndexInteger, NodeData: GfaNodeData, EdgeData: GfaEdgeData> BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType: GraphIndexInteger, NodeData: GfaNodeData, EdgeData: GfaEdgeData> BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
Source§impl<IndexType: GraphIndexInteger, NodeData, EdgeData> BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType: GraphIndexInteger, NodeData, EdgeData> BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
Trait Implementations§
Source§impl<IndexType: Clone + GraphIndexInteger, NodeData: Clone, EdgeData: Clone> Clone for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType: Clone + GraphIndexInteger, NodeData: Clone, EdgeData: Clone> Clone for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
Source§fn clone(&self) -> BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
fn clone(&self) -> BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<IndexType: Debug + GraphIndexInteger, NodeData: Debug, EdgeData: Debug> Debug for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType: Debug + GraphIndexInteger, NodeData: Debug, EdgeData: Debug> Debug for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
Source§impl<IndexType: Hash + GraphIndexInteger, NodeData: Hash, EdgeData: Hash> Hash for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType: Hash + GraphIndexInteger, NodeData: Hash, EdgeData: Hash> Hash for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
Source§impl<IndexType: Ord + GraphIndexInteger, NodeData: Ord, EdgeData: Ord> Ord for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType: Ord + GraphIndexInteger, NodeData: Ord, EdgeData: Ord> Ord for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
Source§fn cmp(
&self,
other: &BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>,
) -> Ordering
fn cmp( &self, other: &BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>, ) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<IndexType: PartialEq + GraphIndexInteger, NodeData: PartialEq, EdgeData: PartialEq> PartialEq for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType: PartialEq + GraphIndexInteger, NodeData: PartialEq, EdgeData: PartialEq> PartialEq for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
Source§fn eq(
&self,
other: &BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>,
) -> bool
fn eq( &self, other: &BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>, ) -> bool
self and other values to be equal, and is used by ==.Source§impl<IndexType: PartialOrd + GraphIndexInteger, NodeData: PartialOrd, EdgeData: PartialOrd> PartialOrd for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType: PartialOrd + GraphIndexInteger, NodeData: PartialOrd, EdgeData: PartialOrd> PartialOrd for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType: Eq + GraphIndexInteger, NodeData: Eq, EdgeData: Eq> Eq for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType: GraphIndexInteger, NodeData, EdgeData> StructuralPartialEq for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
Auto Trait Implementations§
impl<IndexType, NodeData, EdgeData> Freeze for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType, NodeData, EdgeData> RefUnwindSafe for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType, NodeData, EdgeData> Send for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType, NodeData, EdgeData> Sync for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType, NodeData, EdgeData> Unpin for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType, NodeData, EdgeData> UnsafeUnpin for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
impl<IndexType, NodeData, EdgeData> UnwindSafe for BidirectedAdjacencyArray<IndexType, NodeData, EdgeData>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.