japaric-archived / linalg.rs

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

Implement map in place #24

Open japaric opened 9 years ago

japaric commented 9 years ago

Sugar for:

for e in m.iter_mut() {
    f(e)
}

Probably via a Map trait:

trait Map<T> {
    fn map(&mut self, f: |&mut T|);
}

Although it'd be nice to just write m.map(Float::sin) or even better just m.sin() (like Python universal functions).

This can be thread parallelized in the future.