From fa959058ac12376f68ac80cd4b15bc7f72910a08 Mon Sep 17 00:00:00 2001 From: Johann Carl Meyer Date: Mon, 15 Jan 2024 22:13:04 +0100 Subject: [PATCH 1/4] fix and improve doc-comments --- src/linspace.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/linspace.rs b/src/linspace.rs index 6e9b1203c..513044e00 100644 --- a/src/linspace.rs +++ b/src/linspace.rs @@ -66,8 +66,8 @@ impl ExactSizeIterator for Linspace where Linspace: Iterator {} /// /// The `Linspace` has `n` elements from `a` to `b` (inclusive). /// -/// The iterator element type is `F`, where `F` must implement `Float`, e.g. -/// `f32` or `f64`. +/// The iterator element type is `F`, where `F` must implement [`Float`], e.g. +/// [`f32`] or [`f64`]. /// /// **Panics** if converting `n - 1` to type `F` fails. #[inline] @@ -89,13 +89,13 @@ where } } -/// Return an iterator of floats from `start` to `end` (exclusive), +/// Return an iterator of floats from `a` to `b` (exclusive), /// incrementing by `step`. /// /// Numerical reasons can result in `b` being included in the result. /// -/// The iterator element type is `F`, where `F` must implement `Float`, e.g. -/// `f32` or `f64`. +/// The iterator element type is `F`, where `F` must implement [`Float`], e.g. +/// [`f32`] or [`f64`]. /// /// **Panics** if converting `((b - a) / step).ceil()` to type `F` fails. #[inline] From bd511668de998bf3095a219d14453defc8782b0f Mon Sep 17 00:00:00 2001 From: Johann Carl Meyer Date: Mon, 15 Jan 2024 22:22:34 +0100 Subject: [PATCH 2/4] improve doc-comments --- src/logspace.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/logspace.rs b/src/logspace.rs index 4dc6e1f32..53be034b5 100644 --- a/src/logspace.rs +++ b/src/logspace.rs @@ -68,12 +68,12 @@ impl ExactSizeIterator for Logspace where Logspace: Iterator {} /// An iterator of a sequence of logarithmically spaced numbers. /// -/// The `Logspace` has `n` elements, where the first element is `base.powf(a)` +/// The [`Logspace`] has `n` elements, where the first element is `base.powf(a)` /// and the last element is `base.powf(b)`. If `base` is negative, this /// iterator will return all negative values. /// -/// The iterator element type is `F`, where `F` must implement `Float`, e.g. -/// `f32` or `f64`. +/// The iterator element type is `F`, where `F` must implement [`Float`], e.g. +/// [`f32`] or [`f64`]. /// /// **Panics** if converting `n - 1` to type `F` fails. #[inline] From 472664f89da6266484f7e7379a50fa36b215593f Mon Sep 17 00:00:00 2001 From: Johann Carl Meyer Date: Mon, 15 Jan 2024 22:23:32 +0100 Subject: [PATCH 3/4] export Linspace and Logspace iterators --- src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 41a23ae3f..afeed1f20 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -192,7 +192,9 @@ mod iterators; mod layout; mod linalg_traits; mod linspace; +pub use crate::linspace::{Linspace, linspace, range}; mod logspace; +pub use crate::logspace::{Logspace, logspace}; mod math_cell; mod numeric_util; mod order; From 42a6dde94aa0240cef22ad79d1bfe12e8adc0820 Mon Sep 17 00:00:00 2001 From: Johann Carl Meyer Date: Wed, 17 Jan 2024 23:33:02 +0100 Subject: [PATCH 4/4] fix no-std build --- src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index afeed1f20..fc735c4b5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -192,8 +192,10 @@ mod iterators; mod layout; mod linalg_traits; mod linspace; +#[cfg(feature = "std")] pub use crate::linspace::{Linspace, linspace, range}; mod logspace; +#[cfg(feature = "std")] pub use crate::logspace::{Logspace, logspace}; mod math_cell; mod numeric_util;