argmin-rs / argmin

Numerical optimization in pure Rust
http://argmin-rs.org
Apache License 2.0
972 stars 76 forks source link

LBFGS example, trait bounds #367

Closed KGrewal1 closed 11 months ago

KGrewal1 commented 11 months ago

Trying to run the example of LBFGS but running into the issue of

the trait bound ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>: argmin_math::ArgminSub<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> is not satisfied

all features are enabled so am at an impasse as to what to do. Also have a similar trait issue when Param is f64.

KGrewal1 commented 11 months ago

Cargo.toml dependencies are:

[dependencies]
# Required
anyhow = "1.0"
argmin = {version = "0.8.1", features = ["slog-logger", "serde1", "slog", "slog-term"]}
instant = {version = "0.1" }
paste = "1"
num-traits = { version = "0.2" }
rand = { version = "0.8.5" }
rand_xoshiro = { version = "0.6.0" }
thiserror = "1.0"
argmin-math = { version = "0.3", default-features = false, features = ["primitives"] }
# optional
bincode = { version = "1.3.3", optional = true }
ctrlc = { version = "3.2.4", optional = true }
getrandom = { version = "0.2", features = ["js"], optional = true }
gnuplot = { version = "0.0.37", optional = true }
rayon = { version = "1.6.0", optional = true }
serde = { version = "1.0", features = ["derive", "rc"], optional = true }
serde_json = { version = "1.0", optional = true }
slog = { version = "2.7", optional = true, features = ["dynamic-keys"] }
slog-term = { version = "2.9", optional = true }
slog-async = { version = "2.7", optional = true }
slog-json = { version = "2.6", optional = true }
finitediff = { version = "0.1.4", features = ["ndarray"] }
argmin_testfunctions = "0.1.1"
ndarray = { version = "0.15", features = ["serde-1"] }
KGrewal1 commented 11 months ago

Issue identified as argmin maths missing ["ndarray_latest-serde"] as a dependency