Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Linspace and Logspace iterators #1348

Merged
merged 4 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions src/linspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ impl<F> ExactSizeIterator for Linspace<F> where Linspace<F>: 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]
Expand All @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions src/logspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ impl<F> ExactSizeIterator for Logspace<F> where Logspace<F>: 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]
Expand Down
Loading