From ccab10afbc9a8118e4db20e3cef562f1063a6ee2 Mon Sep 17 00:00:00 2001 From: Etienne Wodey Date: Fri, 18 Oct 2024 17:19:20 +0200 Subject: [PATCH 01/11] argmin-testfunctions: load KaTeX libraries in HTML pages --- .cargo/config.toml | 2 ++ crates/argmin-testfunctions/Cargo.toml | 3 +++ crates/argmin-testfunctions/katex-header.html | 13 +++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 .cargo/config.toml create mode 100644 crates/argmin-testfunctions/katex-header.html diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 000000000..f24917d3f --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +rustdocflags = [ "--html-in-header", "./crates/argmin-testfunctions/katex-header.html" ] diff --git a/crates/argmin-testfunctions/Cargo.toml b/crates/argmin-testfunctions/Cargo.toml index e86b6dce3..6ffc4ffb6 100644 --- a/crates/argmin-testfunctions/Cargo.toml +++ b/crates/argmin-testfunctions/Cargo.toml @@ -12,6 +12,9 @@ readme = "README.md" keywords = ["test", "function", "optimization"] categories = ["science"] +[package.metadata.docs.rs] +rustdoc-args = [ "--html-in-header", "katex-header.html" ] + [dependencies] num = "0.4" diff --git a/crates/argmin-testfunctions/katex-header.html b/crates/argmin-testfunctions/katex-header.html new file mode 100644 index 000000000..dd25db0be --- /dev/null +++ b/crates/argmin-testfunctions/katex-header.html @@ -0,0 +1,13 @@ + + + + From ae07de693e15a1524d28f2ead20c77c65f6e2c97 Mon Sep 17 00:00:00 2001 From: Etienne Wodey Date: Fri, 18 Oct 2024 17:20:18 +0200 Subject: [PATCH 02/11] argmin-testfunctions: fix typo --- crates/argmin-testfunctions/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/argmin-testfunctions/src/lib.rs b/crates/argmin-testfunctions/src/lib.rs index e897e6112..31d1aa0fb 100644 --- a/crates/argmin-testfunctions/src/lib.rs +++ b/crates/argmin-testfunctions/src/lib.rs @@ -7,7 +7,7 @@ //! A collection of two- and multidimensional test functions (and their derivatives and Hessians) //! for optimization algorithms. For two-dimensional test functions, the derivate and Hessian -//! calculation does not allocate. For multi-dimensional tes functions, the derivative and Hessian +//! calculation does not allocate. For multi-dimensional test functions, the derivative and Hessian //! calculation comes in two variants. One variant returns `Vec`s and hence does allocate. This is //! needed for cases, where the number of parameters is only known at run time. In case the number //! of parameters are known at compile-time, the `_const` variants can be used, which return fixed From 8bd9c7714bfca95fc2f7f35ea4c098e15853e90c Mon Sep 17 00:00:00 2001 From: Etienne Wodey Date: Fri, 18 Oct 2024 17:20:35 +0200 Subject: [PATCH 03/11] argmin-testfunctions/ackley: render math using KaTeX, add crosslinks --- crates/argmin-testfunctions/src/ackley.rs | 38 +++++++++++++---------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/crates/argmin-testfunctions/src/ackley.rs b/crates/argmin-testfunctions/src/ackley.rs index ba99bf9e0..0bde39fad 100644 --- a/crates/argmin-testfunctions/src/ackley.rs +++ b/crates/argmin-testfunctions/src/ackley.rs @@ -9,12 +9,14 @@ //! //! Defined as //! -//! `f(x_1, x_2, ..., x_n) = - a * exp( -b \sqrt{\frac{1}{d}\sum_{i=1}^n x_i^2 ) - -//! exp( \frac{1}{d} cos(c * x_i) ) + a + exp(1)` +//! $$ +//! f(x_1, x_2, ..., x_n) = -a\exp\left(-b\sqrt{\frac{1}{n}\sum_{i=1}^{n}x_i^2}\right) - +//! \exp\left(\frac{1}{n}\sum_{i=1}^{n}\cos(cx_i)\right) + a + \exp(1) +//! $$ //! -//! where `x_i \in [-32.768, 32.768]` and usually `a = 10`, `b = 0.2` and `c = 2*pi` +//! where $x_i \in [-32.768,\\,32.768]$ and usually $a = 20$, $b = 0.2$ and $c = 2\pi$. //! -//! The global minimum is at `f(x_1, x_2, ..., x_n) = f(0, 0, ..., 0) = 0`. +//! The global minimum is at $f(x_1, x_2, ..., x_n) = f(0, 0, ..., 0) = 0$. use num::{Float, FromPrimitive}; use std::f64::consts::PI; @@ -24,12 +26,14 @@ use std::iter::Sum; /// /// Defined as /// -/// `f(x_1, x_2, ..., x_n) = - a * exp( -b \sqrt{\frac{1}{d}\sum_{i=1}^n x_i^2 ) - -/// exp( \frac{1}{d} cos(c * x_i) ) + a + exp(1)` +/// $$ +/// f(x_1, x_2, ..., x_n) = -a\exp\left(-b\sqrt{\frac{1}{n}\sum_{i=1}^{n}x_i^2}\right) - +/// \exp\left(\frac{1}{n}\sum_{i=1}^{n}\cos(cx_i)\right) + a + \exp(1) +/// $$ /// -/// where `x_i \in [-32.768, 32.768]` and usually `a = 10`, `b = 0.2` and `c = 2*pi` +/// where $x_i \in [-32.768,\\,32.768]$ and usually $a = 20$, $b = 0.2$ and $c = 2\pi$. /// -/// The global minimum is at `f(x_1, x_2, ..., x_n) = f(0, 0, ..., 0) = 0`. +/// The global minimum is at $f(x_1, x_2, ..., x_n) = f(0, 0, ..., 0) = 0$. pub fn ackley(param: &[T]) -> T where T: Float + FromPrimitive + Sum, @@ -44,7 +48,7 @@ where /// Ackley test function /// -/// The same as `ackley`; however, it allows to set the parameters a, b and c. +/// The same as [`ackley`]; however, it allows to set the parameters $a$, $b$ and $c$. pub fn ackley_abc(param: &[T], a: T, b: T, c: T) -> T where T: Float + FromPrimitive + Sum, @@ -59,7 +63,7 @@ where /// Derivative of Ackley test function /// -/// Calls `ackley_abc_derivative` with `a = 10`, `b = 0.2` and `c = 2*pi` +/// Calls [`ackley_abc_derivative`] with $a = 20$, $b = 0.2$ and $c = 2\pi$. pub fn ackley_derivative(param: &[T]) -> Vec where T: Float + FromPrimitive + Sum, @@ -74,7 +78,7 @@ where /// Derivative of Ackley test function /// -/// The same as `ackley_derivative`; however, it allows to set the parameters a, b and c. +/// The same as [`ackley_derivative`]; however, it allows to set the parameters $a$, $b$ and $c$. pub fn ackley_abc_derivative(param: &[T], a: T, b: T, c: T) -> Vec where T: Float + FromPrimitive + Sum, @@ -100,7 +104,7 @@ where /// Derivative of Ackley test function /// -/// Calls `ackley_abc_derivative_const` with `a = 10`, `b = 0.2` and `c = 2*pi` +/// Calls [`ackley_abc_derivative_const`] with $a = 20$, $b = 0.2$ and $c = 2\pi$. /// /// This is the const generics version, which requires the number of parameters to be known /// at compile time. @@ -118,7 +122,7 @@ where /// Derivative of Ackley test function /// -/// The same as `ackley_derivative`; however, it allows to set the parameters a, b and c. +/// The same as [`ackley_derivative`]; however, it allows to set the parameters $a$, $b$ and $c$. /// /// This is the const generics version, which requires the number of parameters to be known /// at compile time. @@ -151,7 +155,7 @@ where /// Hessian of Ackley test function /// -/// Calls `ackley_abc_hessian` with `a = 10`, `b = 0.2` and `c = 2*pi` +/// Calls [`ackley_abc_hessian`] with $a = 20$, $b = 0.2$ and $c = 2\pi$. pub fn ackley_hessian(param: &[T]) -> Vec> where T: Float + FromPrimitive + Sum + std::fmt::Debug, @@ -166,7 +170,7 @@ where /// Hessian of Ackley test function /// -/// The same as `ackley_hessian`; however, it allows to set the parameters a, b and c. +/// The same as [`ackley_hessian`]; however, it allows to set the parameters $a$, $b$ and $c$. pub fn ackley_abc_hessian(param: &[T], a: T, b: T, c: T) -> Vec> where T: Float + FromPrimitive + Sum, @@ -216,7 +220,7 @@ where /// Hessian of Ackley test function /// -/// Calls `ackley_abc_hessian` with `a = 10`, `b = 0.2` and `c = 2*pi` +/// Calls [`ackley_abc_hessian`] with $a = 20$, $b = 0.2$ and $c = 2\pi$. /// /// This is the const generics version, which requires the number of parameters to be known /// at compile time. @@ -234,7 +238,7 @@ where /// Hessian of Ackley test function /// -/// The same as `ackley_hessian`; however, it allows to set the parameters a, b and c. +/// The same as [`ackley_hessian`]; however, it allows to set the parameters $a$, $b$ and $c$. pub fn ackley_abc_hessian_const(param: &[T; N], a: T, b: T, c: T) -> [[T; N]; N] where T: Float + FromPrimitive + Sum, From 417459b95f583beec19031784b89282eec9beba6 Mon Sep 17 00:00:00 2001 From: Etienne Wodey Date: Fri, 18 Oct 2024 17:26:12 +0200 Subject: [PATCH 04/11] argmin-testfunctions/beale: render math using KaTeX --- crates/argmin-testfunctions/src/beale.rs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/crates/argmin-testfunctions/src/beale.rs b/crates/argmin-testfunctions/src/beale.rs index d7ee6e659..9c1993b12 100644 --- a/crates/argmin-testfunctions/src/beale.rs +++ b/crates/argmin-testfunctions/src/beale.rs @@ -9,12 +9,14 @@ //! //! Defined as //! -//! `f(x_1, x_2) = (1.5 - x_1 + x_1 * x_2)^2 + (2.25 - x_1 + x_1 * x_2^2)^2 + -//! (2.625 - x_1 + x1 * x_2^3)^2` +//! $$ +//! f(x_1, x_2) = (1.5 - x_1 + x_1 x_2)^2 + (2.25 - x_1 + x_1 x_2^2)^2 + +//! (2.625 - x_1 + x_1 x_2^3)^2 +//! $$ //! -//! where `x_i \in [-4.5, 4.5]`. +//! where $x_i \in [-4.5,\\,4.5]$. //! -//! The global minimum is at `f(x_1, x_2) = f(3, 0.5) = 0`. +//! The global minimum is at $f(x_1, x_2) = f(3, 0.5) = 0$. use num::{Float, FromPrimitive}; @@ -22,12 +24,14 @@ use num::{Float, FromPrimitive}; /// /// Defined as /// -/// `f(x_1, x_2) = (1.5 - x_1 + x_1 * x_2)^2 + (2.25 - x_1 + x_1 * x_2^2)^2 + -/// (2.625 - x_1 + x_1 * x_2^3)^2` +/// $$ +/// f(x_1, x_2) = (1.5 - x_1 + x_1 x_2)^2 + (2.25 - x_1 + x_1 x_2^2)^2 + +/// (2.625 - x_1 + x_1 x_2^3)^2 +/// $$ /// -/// where `x_i \in [-4.5, 4.5]`. +/// where $x_i \in [-4.5,\\,4.5]$. /// -/// The global minimum is at `f(x_1, x_2) = f(3, 0.5) = 0`. +/// The global minimum is at $f(x_1, x_2) = f(3, 0.5) = 0$. pub fn beale(param: &[T; 2]) -> T where T: Float + FromPrimitive, @@ -76,7 +80,7 @@ where ] } -/// Derivative of Beale test function +/// Hessian of Beale test function pub fn beale_hessian(param: &[T; 2]) -> [[T; 2]; 2] where T: Float + FromPrimitive, From bf35a92b3b8d308c15154e85529b57ac07917bd1 Mon Sep 17 00:00:00 2001 From: Etienne Wodey Date: Fri, 18 Oct 2024 17:34:28 +0200 Subject: [PATCH 05/11] argmin-testfunctions/booth: render math using KaTeX --- crates/argmin-testfunctions/src/booth.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/crates/argmin-testfunctions/src/booth.rs b/crates/argmin-testfunctions/src/booth.rs index 828b1b692..1f22d1862 100644 --- a/crates/argmin-testfunctions/src/booth.rs +++ b/crates/argmin-testfunctions/src/booth.rs @@ -9,11 +9,13 @@ //! //! Defined as //! -//! `f(x_1, x_2) = (x_1 + 2*x_2 - 7)^2 + (2*x_1 + x_2 - 5)^2` +//! $$ +//! f(x_1, x_2) = (x_1 + 2x_2 - 7)^2 + (2x_1 + x_2 - 5)^2 +//! $$ //! -//! where `x_i \in [-10, 10]`. +//! where $x_i \in [-10,\\,10]$. //! -//! The global minimum is at `f(x_1, x_2) = f(1, 3) = 0`. +//! The global minimum is at $f(x_1, x_2) = f(1, 3) = 0$. use num::{Float, FromPrimitive}; @@ -21,11 +23,13 @@ use num::{Float, FromPrimitive}; /// /// Defined as /// -/// `f(x_1, x_2) = (x_1 + 2*x_2 - 7)^2 + (2*x_1 + x_2 - 5)^2 +/// $$ +/// f(x_1, x_2) = (x_1 + 2x_2 - 7)^2 + (2x_1 + x_2 - 5)^2 +/// $$ /// -/// where `x_i \in [-10, 10]`. +/// where $x_i \in [-10,\\,10]$. /// -/// The global minimum is at `f(x_1, x_2) = f(1, 3) = 0`. +/// The global minimum is at $f(x_1, x_2) = f(1, 3) = 0$. pub fn booth(param: &[T; 2]) -> T where T: Float + FromPrimitive, @@ -55,7 +59,7 @@ where /// Hessian of Booth test function /// -/// Returns [[10, 8], [8, 10]] for every input. +/// Returns $\left(\begin{matrix}10 & 8\\\\8 & 10\end{matrix}\right)$ for every input. pub fn booth_hessian(_param: &[T; 2]) -> [[T; 2]; 2] where T: Float + FromPrimitive, From 9589c262baffaa60c45465945c6b1f762a16dc26 Mon Sep 17 00:00:00 2001 From: Etienne Wodey Date: Fri, 18 Oct 2024 17:41:16 +0200 Subject: [PATCH 06/11] argmin-testfunctions/bukin: render math using KaTeX --- crates/argmin-testfunctions/src/bukin.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/crates/argmin-testfunctions/src/bukin.rs b/crates/argmin-testfunctions/src/bukin.rs index 56af15cf6..051363375 100644 --- a/crates/argmin-testfunctions/src/bukin.rs +++ b/crates/argmin-testfunctions/src/bukin.rs @@ -9,11 +9,13 @@ //! //! Defined as //! -//! `f(x_1, x_2) = 100*\sqrt{|x_2 - 0.01*x_1^2|} + 0.01 * |x_1 + 10|` +//! $$ +//! f(x_1, x_2) = 100\sqrt{\left|x_2 - 0.01x_1^2\right|} + 0.01\left|x_1 + 10\right| +//! $$ //! -//! where `x_1 \in [-15, -5]` and `x_2 \in [-3, 3]`. +//! where $x_1 \in [-15,\\,-5]$ and $x_2 \in [-3,\\,3]$. //! -//! The global minimum is at `f(x_1, x_2) = f(-10, 1) = 0`. +//! The global minimum is at $f(x_1, x_2) = f(-10, 1) = 0$. use num::{Float, FromPrimitive}; @@ -21,11 +23,13 @@ use num::{Float, FromPrimitive}; /// /// Defined as /// -/// `f(x_1, x_2) = 100*\sqrt{|x_2 - 0.01*x_1^2|} + 0.01 * |x_1 + 10|` +/// $$ +/// f(x_1, x_2) = 100\sqrt{\left|x_2 - 0.01x_1^2\right|} + 0.01\left|x_1 + 10\right| +/// $$ /// -/// where `x_1 \in [-15, -5]` and `x_2 \in [-3, 3]`. +/// where $x_1 \in [-15,\\,-5]$ and $x_2 \in [-3,\\,3]$. /// -/// The global minimum is at `f(x_1, x_2) = f(-10, 1) = 0`. +/// The global minimum is at $f(x_1, x_2) = f(-10, 1) = 0$. pub fn bukin_n6(param: &[T; 2]) -> T where T: Float + FromPrimitive, From 7bc37c6249489e9989e2a54283e6b19de6142a0a Mon Sep 17 00:00:00 2001 From: Etienne Wodey Date: Fri, 18 Oct 2024 17:56:57 +0200 Subject: [PATCH 07/11] argmin-testfunctions/crossintray: render math using KaTeX --- .../argmin-testfunctions/src/crossintray.rs | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/crates/argmin-testfunctions/src/crossintray.rs b/crates/argmin-testfunctions/src/crossintray.rs index 4580bb6f4..a38973b51 100644 --- a/crates/argmin-testfunctions/src/crossintray.rs +++ b/crates/argmin-testfunctions/src/crossintray.rs @@ -9,16 +9,19 @@ //! //! Defined as //! -//! `f(x_1, x_2) = -0.0001 * ( | sin(x_1)*sin(x_2)*exp(| 100 - -//! \sqrt{x_1^2+x_2^2} / pi |) | + 1)^0.1` +//! $$ +//! f(x_1, x_2) = -0.0001\left(\left|\sin(x_1)\sin(x_2) +//! \exp\left(\left| 100 - \frac{\sqrt{x_1^2+x_2^2}}{\pi} \right|\right)\right| + +//! 1\right)^{0.1} +//! $$ //! -//! where `x_i \in [-10, 10]`. +//! where $x_i \in [-10,\\,10]$. //! //! The global minima are at -//! * `f(x_1, x_2) = f(1.34941, 1.34941) = -2.06261`. -//! * `f(x_1, x_2) = f(1.34941, -1.34941) = -2.06261`. -//! * `f(x_1, x_2) = f(-1.34941, 1.34941) = -2.06261`. -//! * `f(x_1, x_2) = f(-1.34941, -1.34941) = -2.06261`. +//! * $f(x_1, x_2) = f(1.34941, 1.34941) = -2.06261$. +//! * $f(x_1, x_2) = f(1.34941, -1.34941) = -2.06261$. +//! * $f(x_1, x_2) = f(-1.34941, 1.34941) = -2.06261$. +//! * $f(x_1, x_2) = f(-1.34941, -1.34941) = -2.06261$. use std::f64::consts::PI; @@ -28,18 +31,21 @@ use num::{Float, FromPrimitive}; /// /// Defined as /// -/// `f(x_1, x_2) = -0.0001 * ( | sin(x_1)*sin(x_2)*exp(| 100 - -/// \sqrt{x_1^2+x_2^2} / pi |) | + 1)^0.1` +/// $$ +/// f(x_1, x_2) = -0.0001\left(\left|\sin(x_1)\sin(x_2) +/// \exp\left(\left| 100 - \frac{\sqrt{x_1^2+x_2^2}}{\pi} \right|\right)\right| + +/// 1\right)^{0.1} +/// $$ /// -/// where `x_i \in [-10, 10]`. +/// where $x_i \in [-10,\\,10]$. /// /// The global minima are at -/// * `f(x_1, x_2) = f(1.34941, 1.34941) = -2.06261`. -/// * `f(x_1, x_2) = f(1.34941, -1.34941) = -2.06261`. -/// * `f(x_1, x_2) = f(-1.34941, 1.34941) = -2.06261`. -/// * `f(x_1, x_2) = f(-1.34941, -1.34941) = -2.06261`. +/// * $f(x_1, x_2) = f(1.34941, 1.34941) = -2.06261$. +/// * $f(x_1, x_2) = f(1.34941, -1.34941) = -2.06261$. +/// * $f(x_1, x_2) = f(-1.34941, 1.34941) = -2.06261$. +/// * $f(x_1, x_2) = f(-1.34941, -1.34941) = -2.06261$. /// -/// Note: Even if the input parameters are f32, internal computations will be performed in f64. +/// Note: Even if the input parameters are [`f32`], internal computations will be performed in [`f64`]. pub fn cross_in_tray(param: &[T; 2]) -> T where T: Float + Into + FromPrimitive, @@ -58,7 +64,7 @@ where /// Derivative of Cross-in-tray test function /// -/// Note: Even if the input parameters are f32, internal computations will be performed in f64. +/// Note: Even if the input parameters are [`f32`], internal computations will be performed in [`f64`]. pub fn cross_in_tray_derivative(param: &[T; 2]) -> [T; 2] where T: Float + Into + FromPrimitive, @@ -111,9 +117,9 @@ where /// Hessian of Cross-in-tray test function /// -/// This function may return NaN or INF. +/// This function may return [NAN][f64::NAN] or [INFINITY][f64::INFINITY]. /// -/// Note: Even if the input parameters are f32, internal computations will be performed in f64. +/// Note: Even if the input parameters are [`f32`], internal computations will be performed in [`f64`]. pub fn cross_in_tray_hessian(param: &[T; 2]) -> [[T; 2]; 2] where T: Float + Into + FromPrimitive, From c9d7d009ab6c571731af2707330547e084b34178 Mon Sep 17 00:00:00 2001 From: Etienne Wodey Date: Fri, 18 Oct 2024 18:06:25 +0200 Subject: [PATCH 08/11] argmin-testfunctions/easom: render math using KaTeX --- crates/argmin-testfunctions/src/easom.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/crates/argmin-testfunctions/src/easom.rs b/crates/argmin-testfunctions/src/easom.rs index e7bb3c876..cd0ce7679 100644 --- a/crates/argmin-testfunctions/src/easom.rs +++ b/crates/argmin-testfunctions/src/easom.rs @@ -9,11 +9,13 @@ //! //! Defined as //! -//! `f(x_1, x_2) = - cos(x_1) * cos(x_2) * exp(-(x_1 - pi)^2 - (x_2 - pi)^2)` +//! $$ +//! f(x_1, x_2) = - \cos(x_1)\cos(x_2)\exp\left(-(x_1 - \pi)^2 - (x_2 - \pi)^2\right) +//! $$ //! -//! where `x_i \in [-100, 100]`. +//! where $x_i \in [-100,\\,100]$. //! -//! The global minimum is at `f(x_1, x_2) = f(pi, pi) = -1`. +//! The global minimum is at $f(x_1, x_2) = f(\pi, \pi) = -1$. use num::{Float, FromPrimitive}; use std::f64::consts::PI; @@ -22,11 +24,13 @@ use std::f64::consts::PI; /// /// Defined as /// -/// `f(x_1, x_2) = - cos(x_1) * cos(x_2) * exp(-(x_1 - pi)^2 - (x_2 - pi)^2)` +/// $$ +/// f(x_1, x_2) = - \cos(x_1)\cos(x_2)\exp\left(-(x_1 - \pi)^2 - (x_2 - \pi)^2\right) +/// $$ /// -/// where `x_i \in [-100, 100]`. +/// where $x_i \in [-100,\\,100]$. /// -/// The global minimum is at `f(x_1, x_2) = f(pi, pi) = -1`. +/// The global minimum is at $f(x_1, x_2) = f(\pi, \pi) = -1$. pub fn easom(param: &[T; 2]) -> T where T: Float + FromPrimitive, From b208dd846a463d21070f4c4cf8e3910566853d50 Mon Sep 17 00:00:00 2001 From: Etienne Wodey Date: Mon, 21 Oct 2024 21:33:41 +0200 Subject: [PATCH 09/11] argmin-testfunctions: fix crosslinks in module docs --- crates/argmin-testfunctions/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/argmin-testfunctions/src/lib.rs b/crates/argmin-testfunctions/src/lib.rs index 31d1aa0fb..a5c1a5c4f 100644 --- a/crates/argmin-testfunctions/src/lib.rs +++ b/crates/argmin-testfunctions/src/lib.rs @@ -17,11 +17,11 @@ //! `_hessian`, respectively. The const generics variants are defined as //! `_derivative_const` and `_hessian_const`. //! -//! Some functions, such as `ackley`, `rosenbrock` and `rastrigin` come with additional optional -//! parameters which change the shape of the functions. These additional parameters are exposed in -//! `ackley_abc`, `rosenbrock_ab` and `rastrigin_a`. +//! Some functions, such as [`ackley()`], [`rosenbrock()`] and [`rastrigin()`] come with additional +//! optional parameters which change the shape of the functions. These additional parameters +//! are exposed in [`ackley_abc()`], [`rosenbrock_ab()`] and [`rastrigin_a()`]. //! -//! All functions are generic over their inputs and work with `[f64]` and `[f32]`. +//! All functions are generic over their inputs and work with [`f64`] and [`f32`]. //! //! ## Python wrapper //! From 18e09e67560767c247186ab7d846d686ee1eacf3 Mon Sep 17 00:00:00 2001 From: Etienne Wodey Date: Tue, 22 Oct 2024 08:03:53 +0200 Subject: [PATCH 10/11] workflows: fix book tests --- .github/workflows/book.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml index 8da481fd6..dd1dbb98a 100644 --- a/.github/workflows/book.yml +++ b/.github/workflows/book.yml @@ -33,3 +33,6 @@ jobs: - name: Test code samples working-directory: ./media/book/tests run: cargo test + env: + # Override value in workspace top-level Cargo config.toml + RUSTDOCFLAGS: '' From 966c27db43df150c733c61de3a62c9b2178e03dc Mon Sep 17 00:00:00 2001 From: Etienne Wodey Date: Tue, 22 Oct 2024 08:13:03 +0200 Subject: [PATCH 11/11] workflows: fix argmin-math tests --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee6b9f22f..828f10fb5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,6 +92,9 @@ jobs: tests-argmin-math: runs-on: ubuntu-latest + env: + # Override value in workspace top-level Cargo config.toml + RUSTDOCFLAGS: '' steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2