I\'m attempting to parallelise the Ramer–Douglas-Peucker line simplification algorithm by using Rayon\'s par_iter
instead of iter
:
exte
Rayon's parallel iterators implement ParallelIterator
, not Iterator
. In particular, this means you cannot just put a par_iter()
in a for-loop header and expect it to suddenly be parallel. for
is sequential.
Since your original code isn't written in terms of iterator functions, but rather as for loops, you can't parallelize it simply with the switch to par_iter()
, but have to actually redesign the code.
In particular, the failing part of the code seems to be implementing the max_by_key function.