pub struct Transducerdp<M, T, C>{
pub dp: C,
/* private fields */
}
Fields§
§dp: C
Implementations§
Source§impl<M, T, C> Transducerdp<M, T, C>
impl<M, T, C> Transducerdp<M, T, C>
Sourcepub fn new<F>(fst: T, init: M::T, factory: F) -> Selfwhere
F: ContainerFactory<Container = C>,
pub fn new<F>(fst: T, init: M::T, factory: F) -> Selfwhere
F: ContainerFactory<Container = C>,
Examples found in repository?
crates/competitive/src/data_structure/transducer.rs (line 107)
102 pub fn with_factory<F>(self, factory: F) -> Transducerdp<M, A, F::Container>
103 where
104 F: ContainerFactory,
105 F::Container: Container<Key = A::State, Value = M::T>,
106 {
107 Transducerdp::new(self.fst, self.init, factory)
108 }
109 pub fn with_hashmap(self) -> Transducerdp<M, A, HashMap<A::State, M::T>>
110 where
111 A::State: Eq + Hash,
112 {
113 Transducerdp::new(self.fst, self.init, HashMapFactory::default())
114 }
115 pub fn with_vecmap<F>(
116 self,
117 key_to_index: F,
118 ) -> Transducerdp<M, A, VecMap<false, A::State, M::T, F>>
119 where
120 F: Fn(&A::State) -> usize + Clone,
121 {
122 Transducerdp::new(self.fst, self.init, VecMapFactory::new(key_to_index))
123 }
124 pub fn with_fixed_vecmap<F>(
125 self,
126 key_to_index: F,
127 len: usize,
128 ) -> Transducerdp<M, A, VecMap<true, A::State, M::T, F>>
129 where
130 F: Fn(&A::State) -> usize + Clone,
131 {
132 Transducerdp::new(
133 self.fst,
134 self.init,
135 FixedVecMapFactory::new(key_to_index, len),
136 )
137 }
Sourcepub fn step_effect<S, I, B, F>(&mut self, sigma: S, effect: F)
pub fn step_effect<S, I, B, F>(&mut self, sigma: S, effect: F)
Examples found in repository?
crates/competitive/src/data_structure/transducer.rs (line 272)
264 pub fn run_effect<S, I, B, F>(&mut self, mut sigma: S, len: usize, mut effect: F) -> M::T
265 where
266 S: FnMut() -> I,
267 I: IntoIterator<Item = B>,
268 B: Borrow<T::Input>,
269 F: FnMut(&M::T, &T::Output) -> M::T,
270 {
271 for _ in 0..len {
272 self.step_effect(&mut sigma, &mut effect);
273 }
274 self.fold_accept()
275 }
Sourcepub fn fold_accept(&self) -> M::T
pub fn fold_accept(&self) -> M::T
Examples found in repository?
crates/competitive/src/data_structure/transducer.rs (line 262)
253 pub fn run<S, I, B>(&mut self, mut sigma: S, len: usize) -> M::T
254 where
255 S: FnMut() -> I,
256 I: IntoIterator<Item = B>,
257 B: Borrow<T::Input>,
258 {
259 for _ in 0..len {
260 self.step(&mut sigma);
261 }
262 self.fold_accept()
263 }
264 pub fn run_effect<S, I, B, F>(&mut self, mut sigma: S, len: usize, mut effect: F) -> M::T
265 where
266 S: FnMut() -> I,
267 I: IntoIterator<Item = B>,
268 B: Borrow<T::Input>,
269 F: FnMut(&M::T, &T::Output) -> M::T,
270 {
271 for _ in 0..len {
272 self.step_effect(&mut sigma, &mut effect);
273 }
274 self.fold_accept()
275 }
pub fn map_fold_accept<U, F, D>(&self, f: F, map: D) -> D
pub fn run<S, I, B>(&mut self, sigma: S, len: usize) -> M::T
pub fn run_effect<S, I, B, F>( &mut self, sigma: S, len: usize, effect: F, ) -> M::T
Trait Implementations§
Source§impl<M, T, C> Clone for Transducerdp<M, T, C>
impl<M, T, C> Clone for Transducerdp<M, T, C>
Source§fn clone(&self) -> Transducerdp<M, T, C>
fn clone(&self) -> Transducerdp<M, T, C>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<M, T, C> Freeze for Transducerdp<M, T, C>
impl<M, T, C> RefUnwindSafe for Transducerdp<M, T, C>where
T: RefUnwindSafe,
C: RefUnwindSafe,
impl<M, T, C> Send for Transducerdp<M, T, C>
impl<M, T, C> Sync for Transducerdp<M, T, C>
impl<M, T, C> Unpin for Transducerdp<M, T, C>
impl<M, T, C> UnwindSafe for Transducerdp<M, T, C>where
T: UnwindSafe,
C: UnwindSafe,
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
Mutably borrows from an owned value. Read more