Support for .multi_slice_axis_mut and .multi_slice_axis_move

Aperta
#836 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
data

Direzione di ricerca

Start by reading the existing multi_slice_mut and slice_axis_mut APIs, which the issue identifies as the relevant precedents. Trace how their returned views and axis handling work, then define the corresponding behavior for multi_slice_axis_mut and multi_slice_axis_move. Done means the shown Axis(0) example is supported with the expected four views.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

From #775:

We should add multi_slice_axis_mut and multi_slice_axis_move methods, in the same way that slice_axis_mut is analogous to slice_mut.

Are the methods multi_slice_axis_mut and multi_slice_axis_move still desired? I was looking for such functionality. If so, based on multi_slice_mut, is my understanding correct in that these two methods would make the following possible?

let mut example = array![
   [0, 0, 0],
   [0, 0, 0],
   [1, 2, 3],
   [4, 5, 6],
   [7, 8, 9],
   [0, 0, 0],
   [0, 0, 0],
];

let (mut pad_lo, mut pad_hi, mut edge_lo, mut edge_hi) =
    example.multi_slice_axis_mut(Axis(0), (s![..2], s![5..], s![2], s![4]));
// pad_lo:  [ [ 0, 0, 0 ],
//            [ 0, 0, 0 ] ]
// pad_hi:  [ [ 0, 0, 0 ],
//            [ 0, 0, 0 ] ]
// edge_lo: [ [ 1, 2, 3 ] ] 
// edge_hi: [ [ 7, 8, 9 ] ]

Although I'm still learning a lot about Rust, I would love to give implementing it a try, if the functionality is still on the to-do list.

It'd also come in handy for the ndarray-pad crate I'm working on!


I moved this into its own separate issue to not clutter the mentioned issue.

Lingua principale
Rust
Stelle
4.3k
Fork
391
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-ndarray/ndarray

Tutte le issue di rust-ndarray/ndarray

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.