@@ -16,14 +16,19 @@ use value_traits::{
1616 slices:: SliceByValue ,
1717} ;
1818
19+ /// A [`CsrGraph`] with Elias–Fano-encoded degree cumulative function and
20+ /// [`BitFieldVec`]-encoded successors.
1921pub type CompressedCsrGraph = CsrGraph < EF , BitFieldVec > ;
22+
23+ /// A [`CsrSortedGraph`] with Elias–Fano-encoded degree cumulative function and
24+ /// [`BitFieldVec`]-encoded successors.
2025pub type CompressedCsrSortedGraph = CsrSortedGraph < EF , BitFieldVec > ;
2126
2227/// A compressed sparse-row graph.
2328#[ derive( Debug , Clone , Epserde ) ]
2429#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
2530///
26- /// It is a graph representation that stores the degree- cumulative function
31+ /// It is a graph representation that stores the degree cumulative function
2732/// (DCF) and the successors in a compressed format. The DCF is a sequence of
2833/// offsets that indicates the start of the neighbors for each node in the
2934/// graph. Building a CSR graph requires always a sorted lender.
@@ -54,26 +59,30 @@ pub struct CsrGraph<DCF = Box<[usize]>, S = Box<[usize]>> {
5459pub struct CsrSortedGraph < DCF = Box < [ usize ] > , S = Box < [ usize ] > > ( CsrGraph < DCF , S > ) ;
5560
5661impl < DCF , S > CsrGraph < DCF , S > {
57- /// Creates a new CSR graph from the given degree- cumulative function and
62+ /// Creates a new CSR graph from the given degree cumulative function and
5863 /// successors.
5964 ///
6065 /// # Safety
61- /// The degree- cumulative function must be monotone and coherent with the
66+ /// The degree cumulative function must be monotone and coherent with the
6267 /// successors.
6368 pub unsafe fn from_parts ( dcf : DCF , successors : S ) -> Self {
6469 Self { dcf, successors }
6570 }
6671
72+ /// Returns a reference to the degree cumulative function.
6773 #[ inline( always) ]
6874 pub fn dcf ( & self ) -> & DCF {
6975 & self . dcf
7076 }
7177
78+ /// Returns a reference to the successors.
7279 #[ inline( always) ]
7380 pub fn successors ( & self ) -> & S {
7481 & self . successors
7582 }
7683
84+ /// Consumes the graph, returning the degree cumulative function and
85+ /// the successors.
7786 #[ inline( always) ]
7887 pub fn into_inner ( self ) -> ( DCF , S ) {
7988 ( self . dcf , self . successors )
0 commit comments