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
In a downstream crate, I added argmin 0.7.0 as a dependency (but not argmin-math). I then tried to setup a solver like this:
let solver = NelderMead::new(vec![
vec![3.0f64,3.0f64],
vec![2.0f64,1.5f64],
vec![1.0f64,0.5f64],]).unwrap();
This fails with the error message that the trait ArgminAdd is not implemented for Vec<f64>. However, once I add argmin-math as a direct dependency of the downstream crate as well, it works (it is not necessary to import the trait).
Is this expected behaviour?
The text was updated successfully, but these errors were encountered:
Yes, this is intended and documented in the book. Unfortunately there are currently some difficulties to actually find the book, depending on which path you took ;) I assume that your path was either via the API documentation or the examples, which both so far make no mention of the book. The former is fixed in #270 (but will only go live with the next release) and I will fix the latter by turning the examples into their own crates with dedicated Cargo.toml files hopefully soon.
It may seem a bit tedious having to add both argmin and argmin-math but this split approach has a couple of advantages, in particular in terms of maintainability and in terms of flexibility for the users. For instance, it allows one to cut down on compilation time and code size if needed by enabling one to explicitly specify which functionality is needed.
Apologies for the inconvenience and thanks for this issue, because it really helps improving the "docs experience".
In a downstream crate, I added
argmin 0.7.0
as a dependency (but notargmin-math
). I then tried to setup a solver like this:This fails with the error message that the trait
ArgminAdd
is not implemented forVec<f64>
. However, once I addargmin-math
as a direct dependency of the downstream crate as well, it works (it is not necessary to import the trait).Is this expected behaviour?
The text was updated successfully, but these errors were encountered: