@@ -182,37 +182,13 @@ use webgraph::utils::Granularity;
182182/// # Examples
183183///
184184/// ```
185- /// use webgraph::graphs::vec_graph::VecGraph;
186- /// use webgraph::graphs::bvgraph::DCF;
187- /// use webgraph::traits::{RandomAccessLabeling, SequentialLabeling};
188- /// use webgraph_algo::distances::hyperball::*;
189- /// use dsi_progress_logger::no_logging;
190- /// use sux::prelude::*;
191- /// use rand::SeedableRng;
192- /// use lender::prelude::*;
193- ///
194- /// // A small graph: 0 → 1 → 2 → 0, 1 → 3
185+ /// # use webgraph::graphs::vec_graph::VecGraph;
186+ /// # use webgraph::traits::SequentialLabeling;
187+ /// # use webgraph_algo::distances::hyperball::*;
188+ /// # use dsi_progress_logger::no_logging;
189+ /// # use rand::SeedableRng;
195190/// let graph = VecGraph::from_arcs([(0, 1), (1, 2), (2, 0), (1, 3)]);
196- ///
197- /// // Build the degree cumulative function (DCF)
198- /// let mut efb = EliasFanoBuilder::new(
199- /// graph.num_nodes() + 1,
200- /// graph.num_arcs() as usize,
201- /// );
202- /// efb.push(0);
203- /// let mut cumul = 0;
204- /// let mut lender = graph.iter();
205- /// while let Some((_, succs)) = lender.next() {
206- /// cumul += succs.into_iter().count();
207- /// efb.push(cumul);
208- /// }
209- /// let dcf: DCF = unsafe {
210- /// efb.build().map_high_bits(|high_bits| {
211- /// SelectZeroAdaptConst::<_, _, 12, 4>::new(
212- /// SelectAdaptConst::<_, _, 12, 4>::new(high_bits),
213- /// )
214- /// })
215- /// };
191+ /// let dcf = graph.build_dcf();
216192///
217193/// // Build and run HyperBall (neighborhood function only)
218194/// let rng = rand::rngs::SmallRng::seed_from_u64(0);
@@ -230,28 +206,13 @@ use webgraph::utils::Granularity;
230206///
231207/// ```
232208/// # use webgraph::graphs::vec_graph::VecGraph;
233- /// # use webgraph::graphs::bvgraph::DCF;
234- /// # use webgraph::traits::{RandomAccessLabeling, SequentialLabeling};
209+ /// # use webgraph::traits::SequentialLabeling;
235210/// # use webgraph_algo::distances::hyperball::*;
236211/// # use dsi_progress_logger::no_logging;
237- /// # use sux::prelude::*;
238212/// # use rand::SeedableRng;
239- /// # use lender::prelude::*;
240213/// # let graph = VecGraph::from_arcs([(0, 1), (1, 2), (2, 0), (1, 3)]);
241- /// # let mut efb = EliasFanoBuilder::new(
242- /// # graph.num_nodes() + 1, graph.num_arcs() as usize);
243- /// # efb.push(0);
244- /// # let mut cumul = 0;
245- /// # let mut lender = graph.iter();
246- /// # while let Some((_, succs)) = lender.next() {
247- /// # cumul += succs.into_iter().count();
248- /// # efb.push(cumul);
249- /// # }
250- /// # let dcf: DCF = unsafe {
251- /// # efb.build().map_high_bits(|high_bits| {
252- /// # SelectZeroAdaptConst::<_, _, 12, 4>::new(
253- /// # SelectAdaptConst::<_, _, 12, 4>::new(high_bits))})};
254- /// let rng = rand::rngs::SmallRng::seed_from_u64(0);
214+ /// # let dcf = graph.build_dcf();
215+ /// # let rng = rand::rngs::SmallRng::seed_from_u64(0);
255216/// let mut hyperball = HyperBallBuilder::with_hyper_log_log(
256217/// &graph, None::<&VecGraph>, &dcf, 6, None,
257218/// )?
0 commit comments