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:
connor committed 2026-09-29 16:08:03 -04:00
1 parent ffd9efa15c
commit 1f2070d110
4 files changed
+10 -7

No files matched your search

+2 -2
View File
@@ -1,11 +1,11 @@
[package] [package]
name = "ordinary-diffeq" name = "ordinary-diffeq"
version = "0.3.0" version = "0.3.1"
edition = "2021" edition = "2021"
authors = ["Connor Johnstone"] authors = ["Connor Johnstone"]
description = "A library for solving differential equations based on the DifferentialEquations.jl julia library." description = "A library for solving differential equations based on the DifferentialEquations.jl julia library."
readme = "readme.md" readme = "readme.md"
repository = "https://gitlab.rcjohnstone.com/connor/differential-equations" repository = "https://git.rcjohnstone.com/connor/ordinary-diffeq"
license = "MIT" license = "MIT"
exclude = ["roadmap/"] exclude = ["roadmap/"]
+4 -2
View File
@@ -200,7 +200,8 @@ fn bench_interpolation(c: &mut Criterion) {
let bs3 = BS3::new().a_tol(tol).r_tol(tol); let bs3 = BS3::new().a_tol(tol).r_tol(tol);
b.iter(|| { b.iter(|| {
black_box({ 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 // Interpolate at 100 points
let _: Vec<_> = (0..100).map(|i| solution.interpolate(i as f64 * 0.05)).collect(); 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); let dp45 = DormandPrince45::new().a_tol(tol).r_tol(tol);
b.iter(|| { b.iter(|| {
black_box({ 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 // Interpolate at 100 points
let _: Vec<_> = (0..100).map(|i| solution.interpolate(i as f64 * 0.05)).collect(); let _: Vec<_> = (0..100).map(|i| solution.interpolate(i as f64 * 0.05)).collect();
}); });
+2 -1
View File
@@ -45,7 +45,8 @@ fn bench_interpolation_1d(c: &mut Criterion) {
c.bench_function("bench_interpolation_1d", |b| { c.bench_function("bench_interpolation_1d", |b| {
b.iter(|| { b.iter(|| {
std::hint::black_box({ 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]); let _ = (0..100).map(|t| solution.interpolate(t as f64 * 0.1)[0]);
}); });
}); });
+2 -2
View File
@@ -1,4 +1,4 @@
# DifferentialEquations # ordinary-diffeq
A library, written in Rust, for integrating ordinary differential equations. For now, this is 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, relatively simple, but it does have key features that are needed for orbit propagation, ray tracing,
@@ -47,7 +47,7 @@ pendulum problem):
```rust ```rust
use nalgebra::Vector2; use nalgebra::Vector2;
use differential_equations::prelude::*; use ordinary_diffeq::prelude::*;
use std::f64::consts::PI; use std::f64::consts::PI;
// Define the system (parameters, derivative, and initial state) // Define the system (parameters, derivative, and initial state)