japaric-archived / linalg.rs

[INACTIVE]
Apache License 2.0
29 stars 1 forks source link

Remove the `Set` trait in favor of the `IndexAssign` trait #75

Open japaric opened 9 years ago

japaric commented 9 years ago

This let us go from

A.slice_mut((a..b, c..d)).set(B.slice((e..f, g..h)));
A.row_mut(0).set(1.);
A.col_mut(1).set(0.)

to

A[(a..b, c..d)] = B.slice((e..f, g..h));
A[0] = 1.;
A[(.., 1)] = 0;

The same thing in Python/NumPy for reference:

A[a:b, c:d] = B[e:f, g:h]
A[0] = 1
A[:, 1] = 0

Blocked on rust-lang/rust#25628