A few extensions I've needed of ndarray

Offen
#178 22 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
25/100
Issue-Typ
Feature
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
rust
Bereich
data

Rechercherichtung

Start by reviewing the existing ndarray APIs around ArrayBase, Dimension, NdFloat, and fold, then read the discussion for decisions about the proposed methods. The scope is not settled: confirm which extensions, if any, are wanted and clarify the fold deprecation question before defining completion criteria.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Relevant to any dimension:

trait MyArr<S: Data<Elem=A>, A: NdFloat, D: Dimension>
{
    // Yes, trivial with from_elem, but useful enough.
    fn ones(dim: D) -> ArrayBase<S,D>;
    // Also very common stuff
    fn powf(&self, exp: A) -> ArrayBase<Vec<A>,D>;
    fn sqr(&self) -> ArrayBase<Vec<A>,D>;
    fn norm(&self) -> A;
    fn max(&self) -> A;
}

Relevant to matrices only:

trait Mat<D: NdFloat> {
    fn sum_sqr_cw(&self) -> VE; // column wise sum of squares

    // Copy out a submatrix selecting arbitrary rows and columns from self.
    fn submatrix(&self, rows: &Vec<Ix>, columns: &Vec<Ix>) -> MA;
}

BTW, I receive a warning that fold is deprecated because it forces a particular order. I am not sure what you mean by that, and what is a good replacement for it.

I can submit a PR for those if welcome.

Vorherrschende Sprache
Rust
Sterne
4.3k
Forks
391
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus rust-ndarray/ndarray

Alle Issues in rust-ndarray/ndarray

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.