-
rust❤️] reduce vs fold의 차이(methods)코딩Coding/Rust❤️Optimization❤️ 2022. 6. 16. 17:59728x90
https://docs.rs/rayon/1.5.3/rayon/iter/trait.ParallelIterator.html#method.reduce
ParallelIterator in rayon::iter - Rust
Parallel fold is similar to sequential fold except that the sequence of items may be subdivided before it is folded. Consider a list of numbers like 22 3 77 89 46. If you used sequential fold to add them (fold(0, |a,b| a+b), you would wind up first adding
docs.rs
Note: unlike a sequential fold operation, the order in which op will be applied to reduce the result is not fully specified. So op should be associative or else the results will be non-deterministic. And of course identity() should produce a true identity.
easy rust
fold
https://youtu.be/LNfhXppiiW8
반응형'코딩Coding > Rust❤️Optimization❤️' 카테고리의 다른 글