From 1f2070d1105b4d3d9d54a401ebf63110bf9b1c87 Mon Sep 17 00:00:00 2001 From: Connor Johnstone Date: Tue, 29 Sep 2026 16:08:03 -0400 Subject: [PATCH] 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. --- Cargo.toml | 4 ++-- benches/bs3_vs_dp5.rs | 6 ++++-- benches/simple_1d.rs | 3 ++- readme.md | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b565c40..84d1fe2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "ordinary-diffeq" -version = "0.3.0" +version = "0.3.1" edition = "2021" authors = ["Connor Johnstone"] description = "A library for solving differential equations based on the DifferentialEquations.jl julia library." readme = "readme.md" -repository = "https://gitlab.rcjohnstone.com/connor/differential-equations" +repository = "https://git.rcjohnstone.com/connor/ordinary-diffeq" license = "MIT" exclude = ["roadmap/"] diff --git a/benches/bs3_vs_dp5.rs b/benches/bs3_vs_dp5.rs index 1056a5d..b59e5cc 100644 --- a/benches/bs3_vs_dp5.rs +++ b/benches/bs3_vs_dp5.rs @@ -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(); }); diff --git a/benches/simple_1d.rs b/benches/simple_1d.rs index d46618e..3f4effc 100644 --- a/benches/simple_1d.rs +++ b/benches/simple_1d.rs @@ -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]); }); }); diff --git a/readme.md b/readme.md index d8ae3fe..8585ed6 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# DifferentialEquations +# ordinary-diffeq A library, written in Rust, for integrating ordinary differential equations. For now, this is relatively simple, but it does have key features that are needed for orbit propagation, ray tracing, @@ -47,7 +47,7 @@ pendulum problem): ```rust use nalgebra::Vector2; -use differential_equations::prelude::*; +use ordinary_diffeq::prelude::*; use std::f64::consts::PI; // Define the system (parameters, derivative, and initial state)