Fix release metadata and repair the benchmarks
- repository pointed at the old host and the old repo name; this is the link crates.io and docs.rs display - the readme example imported `differential_equations`, so it could not compile under the crate's published name - `cargo bench` did not build: `Solution` borrows the ODE, so `.solve()` cannot be called on a temporary `Problem`. Bind it first.
This commit is contained in:
1 parent
ffd9efa15c
commit
1f2070d110
4 files changed
+10
-7
No files matched your search
@@ -200,7 +200,8 @@ fn bench_interpolation(c: &mut Criterion) {
|
||||
let bs3 = BS3::new().a_tol(tol).r_tol(tol);
|
||||
b.iter(|| {
|
||||
black_box({
|
||||
let solution = Problem::new(ode, bs3, controller).solve();
|
||||
let mut problem = Problem::new(ode, bs3, controller);
|
||||
let solution = problem.solve();
|
||||
// Interpolate at 100 points
|
||||
let _: Vec<_> = (0..100).map(|i| solution.interpolate(i as f64 * 0.05)).collect();
|
||||
});
|
||||
@@ -213,7 +214,8 @@ fn bench_interpolation(c: &mut Criterion) {
|
||||
let dp45 = DormandPrince45::new().a_tol(tol).r_tol(tol);
|
||||
b.iter(|| {
|
||||
black_box({
|
||||
let solution = Problem::new(ode, dp45, controller).solve();
|
||||
let mut problem = Problem::new(ode, dp45, controller);
|
||||
let solution = problem.solve();
|
||||
// Interpolate at 100 points
|
||||
let _: Vec<_> = (0..100).map(|i| solution.interpolate(i as f64 * 0.05)).collect();
|
||||
});
|
||||
|
||||
@@ -45,7 +45,8 @@ fn bench_interpolation_1d(c: &mut Criterion) {
|
||||
c.bench_function("bench_interpolation_1d", |b| {
|
||||
b.iter(|| {
|
||||
std::hint::black_box({
|
||||
let solution = Problem::new(ode, dp45, controller).solve();
|
||||
let mut problem = Problem::new(ode, dp45, controller);
|
||||
let solution = problem.solve();
|
||||
let _ = (0..100).map(|t| solution.interpolate(t as f64 * 0.1)[0]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user