Skip to content

Commit

Permalink
Replace some links with intra-doc links
Browse files Browse the repository at this point in the history
  • Loading branch information
LeSeulArtichaut committed Jun 17, 2021
1 parent 307234e commit e45cfb9
Show file tree
Hide file tree
Showing 26 changed files with 262 additions and 328 deletions.
12 changes: 6 additions & 6 deletions ndarray-rand/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

//! Constructors for randomized arrays: `rand` integration for `ndarray`.
//!
//! See [**`RandomExt`**](trait.RandomExt.html) for usage examples.
//! See **[`RandomExt`]** for usage examples.
//!
//! ## Note
//!
//! `ndarray-rand` depends on [`rand` 0.8][rand].
//!
//! [`rand`][rand] and [`rand_distr`][rand_distr]
//! are re-exported as sub-modules, [`ndarray_rand::rand`](rand/index.html)
//! and [`ndarray_rand::rand_distr`](rand_distr/index.html) respectively.
//! are re-exported as sub-modules, [`ndarray_rand::rand`](rand)
//! and [`ndarray_rand::rand_distr`](rand_distr) respectively.
//! You can use these submodules for guaranteed version compatibility or
//! convenience.
//!
Expand Down Expand Up @@ -60,7 +60,7 @@ pub mod rand_distr {
/// Note that `SmallRng` is cheap to initialize and fast, but it may generate
/// low-quality random numbers, and reproducibility is not guaranteed. See its
/// documentation for information. You can select a different RNG with
/// [`.random_using()`](#tymethod.random_using).
/// [`.random_using()`](Self::RandomUsing).
pub trait RandomExt<S, A, D>
where
S: RawData<Elem = A>,
Expand Down Expand Up @@ -293,8 +293,8 @@ where
/// if lanes from the original array should only be sampled once (*without replacement*) or
/// multiple times (*with replacement*).
///
/// [`sample_axis`]: trait.RandomExt.html#tymethod.sample_axis
/// [`sample_axis_using`]: trait.RandomExt.html#tymethod.sample_axis_using
/// [`sample_axis`]: RandomExt::sample_axis
/// [`sample_axis_using`]: RandomExt::sample_axis_using
#[derive(Debug, Clone)]
pub enum SamplingStrategy {
WithReplacement,
Expand Down
2 changes: 1 addition & 1 deletion src/data_repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rawpointer::PointerExt;
/// Array's representation.
///
/// *Don’t use this type directly—use the type alias
/// [`Array`](type.Array.html) for the array type!*
/// [`Array`](crate::Array) for the array type!*
// Like a Vec, but with non-unique ownership semantics
//
// repr(C) to make it transmutable OwnedRepr<A> -> OwnedRepr<B> if
Expand Down
2 changes: 1 addition & 1 deletion src/dimension/dim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::Ix;
/// `Dim` describes the number of axes and the length of each axis
/// in an array. It is also used as an index type.
///
/// See also the [`Dimension` trait](trait.Dimension.html) for its methods and
/// See also the [`Dimension`] trait for its methods and
/// operations.
///
/// # Examples
Expand Down
177 changes: 83 additions & 94 deletions src/doc/ndarray_for_numpy_users/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//!
//! # Similarities
//!
//! `ndarray`'s array type ([`ArrayBase`][ArrayBase]), is very similar to
//! `ndarray`'s array type ([`ArrayBase`]), is very similar to
//! NumPy's array type (`numpy.ndarray`):
//!
//! * Arrays have a single element type.
Expand Down Expand Up @@ -70,12 +70,12 @@
//! </td>
//! <td>
//!
//! In `ndarray`, all arrays are instances of [`ArrayBase`][ArrayBase], but
//! `ArrayBase` is generic over the ownership of the data. [`Array`][Array]
//! owns its data; [`ArrayView`][ArrayView] is a view;
//! [`ArrayViewMut`][ArrayViewMut] is a mutable view; [`CowArray`][CowArray]
//! In `ndarray`, all arrays are instances of [`ArrayBase`], but
//! `ArrayBase` is generic over the ownership of the data. [`Array`]
//! owns its data; [`ArrayView`] is a view;
//! [`ArrayViewMut`] is a mutable view; [`CowArray`]
//! either owns its data or is a view (with copy-on-write mutation of the view
//! variant); and [`ArcArray`][ArcArray] has a reference-counted pointer to its
//! variant); and [`ArcArray`] has a reference-counted pointer to its
//! data (with copy-on-write mutation). Arrays and views follow Rust's aliasing
//! rules.
//!
Expand All @@ -91,7 +91,7 @@
//! <td>
//!
//! In `ndarray`, you can create fixed-dimension arrays, such as
//! [`Array2`][Array2]. This takes advantage of the type system to help you
//! [`Array2`]. This takes advantage of the type system to help you
//! write correct code and also avoids small heap allocations for the shape and
//! strides.
//!
Expand Down Expand Up @@ -263,7 +263,7 @@
//! Note that [`a.shape()`][.shape()], [`a.dim()`][.dim()], and
//! [`a.raw_dim()`][.raw_dim()] all return the shape of the array, but as
//! different types. `a.shape()` returns the shape as `&[Ix]`, (where
//! [`Ix`][Ix] is `usize`) which is useful for general operations on the shape.
//! [`Ix`] is `usize`) which is useful for general operations on the shape.
//! `a.dim()` returns the shape as `D::Pattern`, which is useful for
//! pattern-matching shapes. `a.raw_dim()` returns the shape as `D`, which is
//! useful for creating other arrays of the same shape.
Expand Down Expand Up @@ -376,7 +376,7 @@
//!
//! </td><td>
//!
//! [`a * b`, `a + b`, etc.](../../struct.ArrayBase.html#arithmetic-operations)
//! [`a * b`, `a + b`, etc.](ArrayBase#arithmetic-operations)
//!
//! </td><td>
//!
Expand Down Expand Up @@ -540,17 +540,17 @@
//! ## Iteration
//!
//! `ndarray` has lots of interesting iterators/producers that implement the
//! [`NdProducer`][NdProducer] trait, which is a generalization of `Iterator`
//! [`NdProducer`](crate::NdProducer) trait, which is a generalization of `Iterator`
//! to multiple dimensions. This makes it possible to correctly and efficiently
//! zip together slices/subviews of arrays in multiple dimensions with
//! [`Zip`][Zip] or [`azip!()`][azip!]. The purpose of this is similar to
//! [`Zip`] or [`azip!()`]. The purpose of this is similar to
//! [`np.nditer`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.nditer.html),
//! but [`Zip`][Zip] is implemented and used somewhat differently.
//! but [`Zip`] is implemented and used somewhat differently.
//!
//! This table lists some of the iterators/producers which have a direct
//! equivalent in NumPy. For a more complete introduction to producers and
//! iterators, see [*Loops, Producers, and
//! Iterators*](../../struct.ArrayBase.html#loops-producers-and-iterators).
//! Iterators*](ArrayBase#loops-producers-and-iterators).
//! Note that there are also variants of these iterators (with a `_mut` suffix)
//! that yield `ArrayViewMut` instead of `ArrayView`.
//!
Expand All @@ -570,88 +570,77 @@
//! `a[:,4]` | [`a.column(4)`][.column()] or [`a.column_mut(4)`][.column_mut()] | view (or mutable view) of column 4 in a 2-D array
//! `a.shape[0] == a.shape[1]` | [`a.is_square()`][.is_square()] | check if the array is square
//!
//! [.abs_diff_eq()]: ../../struct.ArrayBase.html#impl-AbsDiffEq<ArrayBase<S2%2C%20D>>
//! [ArcArray]: ../../type.ArcArray.html
//! [arr2()]: ../../fn.arr2.html
//! [array!]: ../../macro.array.html
//! [Array]: ../../type.Array.html
//! [Array2]: ../../type.Array2.html
//! [ArrayBase]: ../../struct.ArrayBase.html
//! [ArrayView]: ../../type.ArrayView.html
//! [ArrayViewMut]: ../../type.ArrayViewMut.html
//! [.assign()]: ../../struct.ArrayBase.html#method.assign
//! [.axis_iter()]: ../../struct.ArrayBase.html#method.axis_iter
//! [azip!]: ../../macro.azip.html
//! [.ncols()]: ../../struct.ArrayBase.html#method.ncols
//! [.column()]: ../../struct.ArrayBase.html#method.column
//! [.column_mut()]: ../../struct.ArrayBase.html#method.column_mut
//! [concatenate!]: ../../macro.concatenate.html
//! [concatenate()]: ../../fn.concatenate.html
//! [CowArray]: ../../type.CowArray.html
//! [::default()]: ../../struct.ArrayBase.html#method.default
//! [.diag()]: ../../struct.ArrayBase.html#method.diag
//! [.dim()]: ../../struct.ArrayBase.html#method.dim
//! [::eye()]: ../../struct.ArrayBase.html#method.eye
//! [.fill()]: ../../struct.ArrayBase.html#method.fill
//! [.fold()]: ../../struct.ArrayBase.html#method.fold
//! [.fold_axis()]: ../../struct.ArrayBase.html#method.fold_axis
//! [::from_elem()]: ../../struct.ArrayBase.html#method.from_elem
//! [::from_iter()]: ../../struct.ArrayBase.html#method.from_iter
//! [::from_diag()]: ../../struct.ArrayBase.html#method.from_diag
//! [::from_shape_fn()]: ../../struct.ArrayBase.html#method.from_shape_fn
//! [::from_shape_vec()]: ../../struct.ArrayBase.html#method.from_shape_vec
//! [::from_shape_vec_unchecked()]: ../../struct.ArrayBase.html#method.from_shape_vec_unchecked
//! [::from_vec()]: ../../struct.ArrayBase.html#method.from_vec
//! [.index()]: ../../struct.ArrayBase.html#impl-Index<I>
//! [.indexed_iter()]: ../../struct.ArrayBase.html#method.indexed_iter
//! [.insert_axis()]: ../../struct.ArrayBase.html#method.insert_axis
//! [.is_empty()]: ../../struct.ArrayBase.html#method.is_empty
//! [.is_square()]: ../../struct.ArrayBase.html#method.is_square
//! [.iter()]: ../../struct.ArrayBase.html#method.iter
//! [Ix]: ../../type.Ix.html
//! [.len()]: ../../struct.ArrayBase.html#method.len
//! [.len_of()]: ../../struct.ArrayBase.html#method.len_of
//! [::linspace()]: ../../struct.ArrayBase.html#method.linspace
//! [::logspace()]: ../../struct.ArrayBase.html#method.logspace
//! [::geomspace()]: ../../struct.ArrayBase.html#method.geomspace
//! [.map()]: ../../struct.ArrayBase.html#method.map
//! [.map_axis()]: ../../struct.ArrayBase.html#method.map_axis
//! [.map_inplace()]: ../../struct.ArrayBase.html#method.map_inplace
//! [.mapv()]: ../../struct.ArrayBase.html#method.mapv
//! [.mapv_inplace()]: ../../struct.ArrayBase.html#method.mapv_inplace
//! [.mapv_into()]: ../../struct.ArrayBase.html#method.mapv_into
//! [matrix-* dot]: ../../struct.ArrayBase.html#method.dot-1
//! [.mean()]: ../../struct.ArrayBase.html#method.mean
//! [.mean_axis()]: ../../struct.ArrayBase.html#method.mean_axis
//! [.ndim()]: ../../struct.ArrayBase.html#method.ndim
//! [NdProducer]: ../../trait.NdProducer.html
//! [::ones()]: ../../struct.ArrayBase.html#method.ones
//! [.outer_iter()]: ../../struct.ArrayBase.html#method.outer_iter
//! [::range()]: ../../struct.ArrayBase.html#method.range
//! [.raw_dim()]: ../../struct.ArrayBase.html#method.raw_dim
//! [.reversed_axes()]: ../../struct.ArrayBase.html#method.reversed_axes
//! [.row()]: ../../struct.ArrayBase.html#method.row
//! [.row_mut()]: ../../struct.ArrayBase.html#method.row_mut
//! [.nrows()]: ../../struct.ArrayBase.html#method.nrows
//! [s!]: ../../macro.s.html
//! [.sum()]: ../../struct.ArrayBase.html#method.sum
//! [.slice()]: ../../struct.ArrayBase.html#method.slice
//! [.slice_axis()]: ../../struct.ArrayBase.html#method.slice_axis
//! [.slice_collapse()]: ../../struct.ArrayBase.html#method.slice_collapse
//! [.slice_move()]: ../../struct.ArrayBase.html#method.slice_move
//! [.slice_mut()]: ../../struct.ArrayBase.html#method.slice_mut
//! [.shape()]: ../../struct.ArrayBase.html#method.shape
//! [stack!]: ../../macro.stack.html
//! [stack()]: ../../fn.stack.html
//! [.strides()]: ../../struct.ArrayBase.html#method.strides
//! [.index_axis()]: ../../struct.ArrayBase.html#method.index_axis
//! [.sum_axis()]: ../../struct.ArrayBase.html#method.sum_axis
//! [.t()]: ../../struct.ArrayBase.html#method.t
//! [vec-* dot]: ../../struct.ArrayBase.html#method.dot
//! [.for_each()]: ../../struct.ArrayBase.html#method.for_each
//! [::zeros()]: ../../struct.ArrayBase.html#method.zeros
//! [Zip]: ../../struct.Zip.html
//! [.abs_diff_eq()]: ArrayBase#impl-AbsDiffEq<ArrayBase<S2%2C%20D>>
//! [.assign()]: ArrayBase::assign
//! [.axis_iter()]: ArrayBase::axis_iter
//! [.ncols()]: ArrayBase::ncols
//! [.column()]: ArrayBase::column
//! [.column_mut()]: ArrayBase::column_mut
//! [concatenate()]: crate::concatenate()
//! [::default()]: ArrayBase::default
//! [.diag()]: ArrayBase::diag
//! [.dim()]: ArrayBase::dim
//! [::eye()]: ArrayBase::eye
//! [.fill()]: ArrayBase::fill
//! [.fold()]: ArrayBase::fold
//! [.fold_axis()]: ArrayBase::fold_axis
//! [::from_elem()]: ArrayBase::from_elem
//! [::from_iter()]: ArrayBase::from_iter
//! [::from_diag()]: ArrayBase::from_diag
//! [::from_shape_fn()]: ArrayBase::from_shape_fn
//! [::from_shape_vec()]: ArrayBase::from_shape_vec
//! [::from_shape_vec_unchecked()]: ArrayBase::from_shape_vec_unchecked
//! [::from_vec()]: ArrayBase::from_vec
//! [.index()]: ArrayBase#impl-Index<I>
//! [.indexed_iter()]: ArrayBase::indexed_iter
//! [.insert_axis()]: ArrayBase::insert_axis
//! [.is_empty()]: ArrayBase::is_empty
//! [.is_square()]: ArrayBase::is_square
//! [.iter()]: ArrayBase::iter
//! [.len()]: ArrayBase::len
//! [.len_of()]: ArrayBase::len_of
//! [::linspace()]: ArrayBase::linspace
//! [::logspace()]: ArrayBase::logspace
//! [::geomspace()]: ArrayBase::geomspace
//! [.map()]: ArrayBase::map
//! [.map_axis()]: ArrayBase::map_axis
//! [.map_inplace()]: ArrayBase::map_inplace
//! [.mapv()]: ArrayBase::mapv
//! [.mapv_inplace()]: ArrayBase::mapv_inplace
//! [.mapv_into()]: ArrayBase::mapv_into
//! [matrix-* dot]: ArrayBase::dot-1
//! [.mean()]: ArrayBase::mean
//! [.mean_axis()]: ArrayBase::mean_axis
//! [.ndim()]: ArrayBase::ndim
//! [::ones()]: ArrayBase::ones
//! [.outer_iter()]: ArrayBase::outer_iter
//! [::range()]: ArrayBase::range
//! [.raw_dim()]: ArrayBase::raw_dim
//! [.reversed_axes()]: ArrayBase::reversed_axes
//! [.row()]: ArrayBase::row
//! [.row_mut()]: ArrayBase::row_mut
//! [.nrows()]: ArrayBase::nrows
//! [.sum()]: ArrayBase::sum
//! [.slice()]: ArrayBase::slice
//! [.slice_axis()]: ArrayBase::slice_axis
//! [.slice_collapse()]: ArrayBase::slice_collapse
//! [.slice_move()]: ArrayBase::slice_move
//! [.slice_mut()]: ArrayBase::slice_mut
//! [.shape()]: ArrayBase::shape
//! [stack()]: crate::stack()
//! [.strides()]: ArrayBase::strides
//! [.index_axis()]: ArrayBase::index_axis
//! [.sum_axis()]: ArrayBase::sum_axis
//! [.t()]: ArrayBase::t
//! [vec-* dot]: ArrayBase::dot
//! [.for_each()]: ArrayBase::for_each
//! [::zeros()]: ArrayBase::zeros
//! [`Zip`]: crate::Zip

pub mod coord_transform;
pub mod rk_step;
pub mod simple_math;

// This is to avoid putting `crate::` everywhere
#[allow(unused_imports)]
use crate::imp_prelude::*;
10 changes: 4 additions & 6 deletions src/doc/ndarray_for_numpy_users/rk_step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@
//! * Don't return a newly allocated `f_new` array. If the caller wants this
//! information, they can get it from the last row of `k`.
//!
//! * Use [`c.mul_add(h, t)`][f64.mul_add()] instead of `t + c * h`. This is
//! * Use [`c.mul_add(h, t)`](f64::mul_add) instead of `t + c * h`. This is
//! faster and reduces the floating-point error. It might also be beneficial
//! to use [`.scaled_add()`][.scaled_add()] or a combination of
//! [`azip!()`][azip!] and [`.mul_add()`][f64.mul_add()] on the arrays in
//! to use [`.scaled_add()`] or a combination of
//! [`azip!()`] and [`.mul_add()`](f64::mul_add) on the arrays in
//! some places, but that's not demonstrated in the example below.
//!
//! ```
Expand Down Expand Up @@ -168,9 +168,7 @@
//! # fn main() { let _ = rk_step::<fn(_, ArrayView1<'_, f64>, ArrayViewMut1<'_, f64>)>; }
//! ```
//!
//! [f64.mul_add()]: https://doc.rust-lang.org/std/primitive.f64.html#method.mul_add
//! [.scaled_add()]: ../../../struct.ArrayBase.html#method.scaled_add
//! [azip!]: ../../../macro.azip.html
//! [`.scaled_add()`]: crate::ArrayBase::scaled_add
//!
//! ### SciPy license
//!
Expand Down
2 changes: 1 addition & 1 deletion src/free_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use alloc::vec::Vec;
use crate::imp_prelude::*;
use crate::{dimension, ArcArray1, ArcArray2};

/// Create an [**`Array`**](type.Array.html) with one, two or
/// Create an **[`Array`]** with one, two or
/// three dimensions.
///
/// ```
Expand Down
2 changes: 1 addition & 1 deletion src/impl_constructors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ macro_rules! size_of_shape_checked_unwrap {
/// column major (“f” order) memory layout instead of the default row major.
/// For example `Array::zeros((5, 6).f())` makes a column major 5 × 6 array.
///
/// Use [`IxDyn`](type.IxDyn.html) for the shape to create an array with dynamic
/// Use [`type@IxDyn`] for the shape to create an array with dynamic
/// number of axes.
///
/// Finally, the few constructors that take a completely general
Expand Down
2 changes: 0 additions & 2 deletions src/impl_cow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ use crate::imp_prelude::*;
/// Methods specific to `CowArray`.
///
/// ***See also all methods for [`ArrayBase`]***
///
/// [`ArrayBase`]: struct.ArrayBase.html
impl<'a, A, D> CowArray<'a, A, D>
where
D: Dimension,
Expand Down
12 changes: 6 additions & 6 deletions src/impl_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ where
/// If the input array is contiguous, then the output array will have the same
/// memory layout. Otherwise, the layout of the output array is unspecified.
/// If you need a particular layout, you can allocate a new array with the
/// desired memory layout and [`.assign()`](#method.assign) the data.
/// desired memory layout and [`.assign()`](Self::assign) the data.
/// Alternatively, you can collectan iterator, like this for a result in
/// standard layout:
///
Expand Down Expand Up @@ -400,7 +400,7 @@ where
///
/// Iterator element type is `(D::Pattern, &A)`.
///
/// See also [`Zip::indexed`](struct.Zip.html)
/// See also [`Zip::indexed`]
pub fn indexed_iter(&self) -> IndexedIter<'_, A, D>
where
S: Data,
Expand Down Expand Up @@ -544,9 +544,9 @@ where
/// collapsed, as in [`.collapse_axis()`], rather than removed, as in
/// [`.slice_move()`] or [`.index_axis_move()`].
///
/// [`.collapse_axis()`]: #method.collapse_axis
/// [`.slice_move()`]: #method.slice_move
/// [`.index_axis_move()`]: #method.index_axis_move
/// [`.collapse_axis()`]: Self::collapse_axis
/// [`.slice_move()`]: Self::slice_move
/// [`.index_axis_move()`]: Self::index_axis_move
///
/// See [*Slicing*](#slicing) for full documentation.
/// See also [`s!`], [`SliceArg`], and [`SliceInfo`](crate::SliceInfo).
Expand Down Expand Up @@ -916,7 +916,7 @@ where

/// Collapses the array to `index` along the axis and removes the axis.
///
/// See [`.index_axis()`](#method.index_axis) and [*Subviews*](#subviews) for full documentation.
/// See [`.index_axis()`](Self::index_axis) and [*Subviews*](#subviews) for full documentation.
///
/// **Panics** if `axis` or `index` is out of bounds.
pub fn index_axis_move(mut self, axis: Axis, index: usize) -> ArrayBase<S, D::Smaller>
Expand Down
Loading

0 comments on commit e45cfb9

Please sign in to comment.