Faster iterator for arbitrary order
まだ誰も着手していません。
評価
調査の方向性
Review ArrayBase's existing fold, scalar_sum, and visit methods, then compare the proposed iter(), iter_mut(), indexed_iter(), and indexed_iter_mut() APIs with the listed Iterator and Itertools adapters. Done means the naming and arbitrary-order semantics are agreed and the adapters are implemented without requiring separate methods for every consumer.
索引モデルが issue の本文から書いたものです。
説明
.iter() provides an iterator over all the elements, but it always iterates in logical order, which may be slow depending on the memory layout of the array. In some cases, however, the order of iteration doesn't matter. Recent issues regarding these types of cases include #466 and #468. Examples of methods where order doesn't matter include the most common uses of these from the Iterator trait
.fold().for_each().all()and.any().find().min(),.max(),.min_by(),.max_by(),.min_by_key(),.max_by_key().sum(),.product()
and these from Itertools
.cartesian_product().unique(),.unique_by().combinations().all_equal().foreach().fold_results(),.fold_options(),.fold1(),.tree_fold(),.fold_while().sorted(),.sorted_by(),.sorted_by_key().partition_map().into_group_map().minmax(),.minmax_by_key(),minmax_by()
We have already implemented some of these "arbitrary order" adapters as individual methods on ArrayBase, including .fold(), .scalar_sum(), and .visit(). However, it doesn't make sense to create separate methods for all of the possible iterator adapters.
As a result, I'd like to add "arbitrary order" .iter(), .iter_mut(), .indexed_iter(), and .indexed_iter_mut() methods designed to iterate in the fastest possible order so that we can hopefully get good performance with iterator adapters.
What does everyone think these "arbitrary order" iterators should be named?
I've thought of .iter_arbitrary() and .iter_unordered(), but those names seem somewhat unclear and unnecessarily verbose.
- 主要言語
- Rust
- スター
- 4.3k
- フォーク
- 391
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-ndarray/ndarray のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
rust-ndarray/ndarray#1612 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
rust-ndarray/ndarray#1617 · コメント 1 件 ·
-
bug good first issue
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
rust-ndarray/ndarray#1615 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
rust-ndarray/ndarray#1610 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
rust-ndarray/ndarray#1609 ·