(Feature suggestion) SortedMultiSet
まだ誰も着手していません。
評価
調査の方向性
既存の SortedSet と SortedMultiDict の実装および API を確認することから始めます。SortedMultiSet が重複する比較キー、効率的な挿入・削除・検索、値による削除をどのように扱うべきかを定義してください。issue ではファイルやテストが特定されていないため、完了基準については maintainer の合意が必要になります。
索引モデルが issue の本文から書いたものです。
説明
I think that this package is missing a SortedMultiSet type. As an example, let's say we want to collect a list of persons, sorted by age, as stored in an ages dictionary:
ages = Dict(:bob => 1, :sam => 2, :joe => 1)
and perform efficient insertions/deletions and searching on this list. My first reflex is using a SortedSet for this; however: SortedSet(keys(ages), Base.Order.By(x->ages[x])) merges the keys :bob: and :joe. (*)
There are two ways to work around this limitation right now:
SortedSet((age, person) for (person, age) in ages);SortedMultiDict(age => person for (person, age) in ages).
However, both of them are somewhat memory-inefficient (they store information equivalent to a full copy of the ages database, as well as quite cumbersome to use (neither implementation allows a simple delete!(set, :bob) call). The second inconvenient may be fixed by writing a simple wrapper over either type (possibly the SortedMultiDict, which is somewhat more efficient), but the first one cannot be fixed except by writing a new structure.
(Also, keep in mind that the example I gave here is of course much simplified. In particular, the comparison values are numbers, and thus quite compact in memory. There could probably be some use cases where the comparison keys are big data structures, hence the fact that we don't want to copy all of them).
(*) in my view this is simply a bad design choice in the definition of SortedSet, because only equal values should be merged, i.e. a set should be allowed to be sorted according to a preorder, but it is likely much too late to change this.
- 主要言語
- Julia
- スター
- 747
- フォーク
- 261
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
JuliaCollections/DataStructures.jl のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
append!(l1::MutableLinkedList, l2::MutableLinkedList) fails for empty l2対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
JuliaCollections/DataStructures.jl#997 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
several `mutable struct` type definitions do not require mutability, review and adjust対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
JuliaCollections/DataStructures.jl の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
Add project: Typst_jll.jl対応中かも @github-actions が今日担当しました。 オープンadd-project
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
YDX-2147483647/best-of-typst#590 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100