You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It could be nice to have some shortcuts when working with matrices (and possibly for vectors too).
For instance, if a is a matrix, it might be convenient to use a.rows() instead of a.shape()[0].
Also exposing a type alias for matrices can be nice, something like pub type MatrixView<A> = ArrayView<A, (Ix, Ix)>.
There are probably other goodies we might want, but I don't know them yet.
I am using pub type MA = OwnedArray<f64, (Ix,Ix)>; I think having some fixed shortcuts in ndarray would be nice to avoid each using package inventing its own.
Since we have OwnedArray, RcArray, ArrayView, ArrayViewMut I've been a bit hesitant, I don't know how the API will eventually end up.. It is plausible we could add some terse type aliases, preferably finding a nice shorthand system.
Maybe if someone has a generic scheme for type aliases they are already using and wants to propose. I don't use too much aliases, but type Ix2 = (Ix, Ix) is pretty common!
Maybe it's unrelated, but racer doesn't do the world's best job with ndarray. Racer has a lot of things that can go wrong and make it not complete. In some files I can't get it to complete anything I try, I guess because it doesn't know the types of any of the array variables.
Activity
daniel-vainsencher commentedon Mar 12, 2016
👍
I am using
pub type MA = OwnedArray<f64, (Ix,Ix)>;I think having some fixed shortcuts in ndarray would be nice to avoid each using package inventing its own.bluss commentedon Mar 12, 2016
Since we have OwnedArray, RcArray, ArrayView, ArrayViewMut I've been a bit hesitant, I don't know how the API will eventually end up.. It is plausible we could add some terse type aliases, preferably finding a nice shorthand system.
Maybe if someone has a generic scheme for type aliases they are already using and wants to propose. I don't use too much aliases, but
type Ix2 = (Ix, Ix)is pretty common!Maybe it's unrelated, but racer doesn't do the world's best job with ndarray. Racer has a lot of things that can go wrong and make it not complete. In some files I can't get it to complete anything I try, I guess because it doesn't know the types of any of the array variables.
bluss commentedon Mar 12, 2016
The type alias
Arraybeing deprecated, I've said it's up for grabs in a future version.Some shortlist candidates are (A) ArrayBase becomes Array, (B) OwnedArray becomes Array, (C) A new trait is made and called Array. Now issue #145
bluss commentedon Mar 15, 2016
I have some natural resistance to dimensionality-specific methods.
What I most often use instead of .rows() is just
Which is even terser, but indeed the code is not as self documenting.
bluss commentedon Mar 17, 2016
rows, cols are now fixed. We can open a new specific issue for type aliases.