Releases: orxfun/orx-split-vec
Parallelization
Support for Parallelization
Concurrent iterator optimized for the split vector is implemented. This enables parallel computation over split vector elements.
Concurrent Iterator
Concurrent iterator over references of split vector is implemented. Furthermore, a consuming concurrent iterator yielding owned elements is implemented.
impl<'a, T, G> IntoConcurrentIter<Item = &'a T> for &'a SplitVec<T, G>
impl<'a, T, G> IntoConcurrentIter<Item = T> for SplitVec<T, G>
They together imply that the split vectors for all growth strategies defined in this crate implement ConcurrentCollection
.
This allows for creating concurrent iterators over references of items of the split vector that can be shared among threads.
Parallelization
This applies that the following is automatically implemented:
impl<'a, T, G> IntoParIter<Item = &'a T> for &'a SplitVec<T, G>
impl<'a, T, G> IntoParIter<Item = T> for SplitVec<T, G>
Or in brief, SplitVec<T, G>: ParallelizableCollection<Item = T>
.
This means that the split vector can be used as the input source for all parallel computations defined by the ParIter
. The benchmarks show that parallelization over the defined concurrent iterators is very efficient.
split_vec.par()
returns a parallel iterator over references to its elements, andsplit_vec.into_par()
consumes the vector and returns a parallel iterator of the owned elements.
You may find demonstrations in demo_parallelization
and bench_parallelization
examples.
2024edition
Changes
Migrated to 2024edition.
32bit support is provided fixing the bugs in boundary checks.
iter_over
and iter_over_mut
are implemented as a generalization of slicing a vector. Slices and SlicesMut iterators are improved. Test over iterators are extended.
CI action is added.
SplitVec::iter() Revision
Necessary Iterator methods are overwritten in order to improve performance:
nth
is implemented. This also improves the performance ofskip
. Fixes #75last
method is implemented to avoid iterating the entire range.max
andmin
are implemented to reduce over the fragments' default reductions.- Similarly, reduction methods
fold
,reduce
,all
,any
,count
are implemented.
In addition, Clone
is implemented for the split vector iterator.
Finally, ExactSizeIterator
is implemented.
Upgrade PseudoDefault dependency
Merge pull request #72 from orxfun/Upgrade-PseudoDefault-dependency Upgrade PseudoDefault dependency
Dual license
Merge pull request #70 from orxfun/dual-license dual-license
SplitVec implements Collection and CollectionMut
3.12.0 Merge pull request #69 from orxfun/SplitVec-implements-Collection-and…
Documentation and benchmark revision
Documentation had been outdated and it has gone through a major revision. Further, the benchmarks are revised and repeated. Finally, upgraded the dependency to new pinned vec version.
Iterator over range
iter_over_range
method is provided.
At one hand, vec.iter_over_range(a..b)
is equivalent to vec.iter().skip(a).take(b - a)
. However, the latter requires a
unnecessary next
calls. Since all pinned vectors provide random access to elements, the objective of iter_over_range
is to directly jump to a
and create an iterator from this point on, and hence, avoiding the unnecessary iterations at the beginning.
Support for Self Referential Collections
The following methods are implemented:
- index_of_ptr
- push_get_ptr
- iter_ptr
- iter_ptr_rev
- contains_ptr
- get_ptr
Crate is converted to no_std
Merge pull request #57 from orxfun/crate-converted-into-no_std crate converted into no_std
Reserve initiated capacity
- ConcurrentSplitVec is simplified by removing the requirement for the atomic number of fragments. This number can be computed by the growth with constant time random access implementations.
reserve_maximum_concurrent_capacity_fill_with
is implemented.- Tests related to reserving maximum capacity are extended.