Need help with eviolite library

Hi all!
I'm working on an assignment for uni, where it's suggested to use a performant language, as Python just won't cut it. No points for guess which language I want to use.. :grin: We're implementing simple evolutionary algorithms, and are free to use any libraries. I searched around and found eviolite that seems to be what I need. However, I'm unable to even get the example code running.. :sweat_smile:

I get an error message:

error[E0599]: no function or associated item named `random_using` found for struct `ArrayBase` in the current scope
   --> src/main.rs:24:28
    |
24  |         Polynomial(Array1::random_using(
    |                            ^^^^^^^^^^^^ function or associated item not found in `ArrayBase<OwnedRepr<_>, Dim<[usize; 1]>>`

...which takes me to a closed Github issue with the ndarray crate (oh, the rabbit holes...) but it's really old, and from what I can gather, shouldn't be a problem any more...?

I could be missing something obvious...?

Are there any other similar crates that are known to work better?

Thanks in advance for all your help!

Thomas

You copied the approx_sin example code into your own package, right? Have you added ndarray-rand as a dependency and imported the RandomExt trait? If so, could you share what version of ndarray and what version of ndarray-rand you are using? Your ndarray version must match the one ndarray-rand uses, otherwise RandomExt won't be implemented for the types from your version of ndarray.

1 Like

I like typing it in myself, as I feel that I learn more that way. Brings all kinds of typos with it, of course, but I still think it's worth it.. :sweat_smile:

It appears I was using ndarray-rand = "^0.13" for some reason, but once I changed it to match the version used by the eviolite library ("0.14") its now compiling... :smiley:

Thank you for working with me on this!

1 Like