JErnestoMtz / rapl

Rank Polymorphic array library for Rust.
103 stars 3 forks source link

Linspace / Logspace Implementation #21

Closed JErnestoMtz closed 1 year ago

JErnestoMtz commented 1 year ago

I think the ratio between usability and Implementation complexity for this functions is high, therefore I believe is worth implementing.

The goal would be simply something like Ndarr::linspace(start: T, stop: T, n: usize)

ndarray implementation require for the T to be Float, which I'm not sure is quite necessary. T: Float it would certainly make it almost trivial to implement, but I don't se why divisible integers like linspace(2,10,5) -> Ndarr::from([2,4,6,8,10]) are not supported. Although maybe is not worth the extra work, because there is always ranges for integers.