I tried to use ParticleSwarm in a project but ran into some errors. I figured it was my fault so tried to run the repo's example, but got the same errors. For example:
error[E0277]: the trait bound `Vec<{float}>: argmin_math::ArgminSub<Vec<{float}>, Vec<{float}>>` is not satisfied
--> examples/ps.rs:41:37
|
41 | let solver = ParticleSwarm::new((vec![-4.0, -4.0], vec![4.0, 4.0]), 40);
| ------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `argmin_math::ArgminSub<Vec<{float}>, Vec<{float}>>` is not implemented for `Vec<{float}>`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `argmin_math::ArgminSub<T, U>`:
<f32 as argmin_math::ArgminSub<f32, f32>>
<f64 as argmin_math::ArgminSub<f64, f64>>
<i16 as argmin_math::ArgminSub<i16, i16>>
<i32 as argmin_math::ArgminSub<i32, i32>>
<i64 as argmin_math::ArgminSub<i64, i64>>
<i8 as argmin_math::ArgminSub<i8, i8>>
<num_complex::Complex<f32> as argmin_math::ArgminSub<num_complex::Complex<f32>, num_complex::Complex<f32>>>
<num_complex::Complex<f64> as argmin_math::ArgminSub<num_complex::Complex<f64>, num_complex::Complex<f64>>>
and 12 others
note: required by a bound in `ParticleSwarm::<P, F, rand::rngs::std::StdRng>::new`
I tried to use
ParticleSwarm
in a project but ran into some errors. I figured it was my fault so tried to run the repo's example, but got the same errors. For example: