Skip to main content

SparseGraphScanner

Struct SparseGraphScanner 

Source
pub struct SparseGraphScanner<U, T, D>
where U: Scan<Output = usize>, T: Scan,
{ vsize: usize, esize: usize, _marker: PhantomData<fn() -> (U, T, D)>, }

Fields§

§vsize: usize§esize: usize§_marker: PhantomData<fn() -> (U, T, D)>

Implementations§

Source§

impl<U, T, D> SparseGraphScanner<U, T, D>
where U: Scan<Output = usize>, T: Scan,

Source

pub fn new(vsize: usize, esize: usize) -> Self

Examples found in repository?
crates/competitive/src/graph/sparse_graph.rs (line 261)
260    fn mscan<I: ScanSource>(self, iter: &mut I) -> Option<Self::Output> {
261        UndirectedGraphScanner::<U, T>::new(self.vsize, self.vsize - 1).mscan(iter)
262    }
More examples
Hide additional examples
crates/aizu_online_judge/src/grl/grl_4_b.rs (line 7)
5pub fn grl_4_b(reader: impl Read, writer: impl Write) {
6    prepare_io!(reader, writer);
7    sc!(vs, es, (graph, _): @DirectedGraphScanner::<usize, ()>::new(vs, es));
8    pp!(@lf @it graph.topological_sort());
9}
crates/aizu_online_judge/src/grl/grl_4_a.rs (line 7)
5pub fn grl_4_a(reader: impl Read, writer: impl Write) {
6    prepare_io!(reader, writer);
7    sc!(vs, es, (graph, _): @DirectedGraphScanner::<usize, ()>::new(vs, es));
8    pp!((graph.topological_sort().len() != vs) as u32);
9}
crates/aizu_online_judge/src/grl/grl_3_b.rs (line 7)
5pub fn grl_3_b(reader: impl Read, writer: impl Write) {
6    prepare_io!(reader, writer);
7    sc!(vs, es, (graph, _): @UndirectedGraphScanner::<usize, ()>::new(vs, es));
8    let mut bridge = LowLink::new(&graph).bridge;
9    bridge.sort_unstable();
10    for (u, v) in bridge.into_iter() {
11        pp!(u, v);
12    }
13}
crates/aizu_online_judge/src/grl/grl_3_a.rs (line 7)
5pub fn grl_3_a(reader: impl Read, writer: impl Write) {
6    prepare_io!(reader, writer);
7    sc!(vs, es, (graph, _): @UndirectedGraphScanner::<usize, ()>::new(vs, es));
8    let mut articulation = LowLink::new(&graph).articulation;
9    articulation.sort_unstable();
10    for u in articulation.into_iter() {
11        pp!(u);
12    }
13}
crates/aizu_online_judge/src/grl/grl_3_c.rs (line 7)
5pub fn grl_3_c(reader: impl Read, writer: impl Write) {
6    prepare_io!(reader, writer);
7    sc!(vs, es, (graph, _): @DirectedGraphScanner::<usize, ()>::new(vs, es));
8    let scc = StronglyConnectedComponent::new(&graph);
9    sc!(q);
10    for (u, v) in sv!([(usize, usize); iter q]) {
11        pp!((scc[u] == scc[v]) as u32);
12    }
13}

Trait Implementations§

Source§

impl<U, T, D> MarkedScan for SparseGraphScanner<U, T, D>
where U: Scan<Output = usize>, T: Scan, D: SparseGraphConstruction,

Source§

type Output = (SparseGraph<D>, Vec<<T as Scan>::Output>)

Source§

fn mscan<I: ScanSource>(self, iter: &mut I) -> Option<Self::Output>

Auto Trait Implementations§

§

impl<U, T, D> Freeze for SparseGraphScanner<U, T, D>

§

impl<U, T, D> RefUnwindSafe for SparseGraphScanner<U, T, D>

§

impl<U, T, D> Send for SparseGraphScanner<U, T, D>

§

impl<U, T, D> Sync for SparseGraphScanner<U, T, D>

§

impl<U, T, D> Unpin for SparseGraphScanner<U, T, D>

§

impl<U, T, D> UnsafeUnpin for SparseGraphScanner<U, T, D>

§

impl<U, T, D> UnwindSafe for SparseGraphScanner<U, T, D>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToArrayVecScalar for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.