Skip to content

Commit 0827101

Browse files
Replace some links with intra-doc links
1 parent 307234e commit 0827101

26 files changed

+260
-328
lines changed

ndarray-rand/src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
//! Constructors for randomized arrays: `rand` integration for `ndarray`.
1010
//!
11-
//! See [**`RandomExt`**](trait.RandomExt.html) for usage examples.
11+
//! See **[`RandomExt`]** for usage examples.
1212
//!
1313
//! ## Note
1414
//!
1515
//! `ndarray-rand` depends on [`rand` 0.8][rand].
1616
//!
1717
//! [`rand`][rand] and [`rand_distr`][rand_distr]
18-
//! are re-exported as sub-modules, [`ndarray_rand::rand`](rand/index.html)
19-
//! and [`ndarray_rand::rand_distr`](rand_distr/index.html) respectively.
18+
//! are re-exported as sub-modules, [`ndarray_rand::rand`](rand)
19+
//! and [`ndarray_rand::rand_distr`](rand_distr) respectively.
2020
//! You can use these submodules for guaranteed version compatibility or
2121
//! convenience.
2222
//!
@@ -60,7 +60,7 @@ pub mod rand_distr {
6060
/// Note that `SmallRng` is cheap to initialize and fast, but it may generate
6161
/// low-quality random numbers, and reproducibility is not guaranteed. See its
6262
/// documentation for information. You can select a different RNG with
63-
/// [`.random_using()`](#tymethod.random_using).
63+
/// [`.random_using()`](Self::RandomUsing).
6464
pub trait RandomExt<S, A, D>
6565
where
6666
S: RawData<Elem = A>,
@@ -293,8 +293,8 @@ where
293293
/// if lanes from the original array should only be sampled once (*without replacement*) or
294294
/// multiple times (*with replacement*).
295295
///
296-
/// [`sample_axis`]: trait.RandomExt.html#tymethod.sample_axis
297-
/// [`sample_axis_using`]: trait.RandomExt.html#tymethod.sample_axis_using
296+
/// [`sample_axis`]: RandomExt::sample_axis
297+
/// [`sample_axis_using`]: RandomExt::sample_axis_using
298298
#[derive(Debug, Clone)]
299299
pub enum SamplingStrategy {
300300
WithReplacement,

src/data_repr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rawpointer::PointerExt;
1111
/// Array's representation.
1212
///
1313
/// *Don’t use this type directly—use the type alias
14-
/// [`Array`](type.Array.html) for the array type!*
14+
/// [`Array`](crate::Array) for the array type!*
1515
// Like a Vec, but with non-unique ownership semantics
1616
//
1717
// repr(C) to make it transmutable OwnedRepr<A> -> OwnedRepr<B> if

src/dimension/dim.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::Ix;
1818
/// `Dim` describes the number of axes and the length of each axis
1919
/// in an array. It is also used as an index type.
2020
///
21-
/// See also the [`Dimension` trait](trait.Dimension.html) for its methods and
21+
/// See also the [`Dimension`] trait for its methods and
2222
/// operations.
2323
///
2424
/// # Examples

src/doc/ndarray_for_numpy_users/mod.rs

+81-94
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
//!
2424
//! # Similarities
2525
//!
26-
//! `ndarray`'s array type ([`ArrayBase`][ArrayBase]), is very similar to
26+
//! `ndarray`'s array type ([`ArrayBase`]), is very similar to
2727
//! NumPy's array type (`numpy.ndarray`):
2828
//!
2929
//! * Arrays have a single element type.
@@ -70,12 +70,12 @@
7070
//! </td>
7171
//! <td>
7272
//!
73-
//! In `ndarray`, all arrays are instances of [`ArrayBase`][ArrayBase], but
74-
//! `ArrayBase` is generic over the ownership of the data. [`Array`][Array]
75-
//! owns its data; [`ArrayView`][ArrayView] is a view;
76-
//! [`ArrayViewMut`][ArrayViewMut] is a mutable view; [`CowArray`][CowArray]
73+
//! In `ndarray`, all arrays are instances of [`ArrayBase`], but
74+
//! `ArrayBase` is generic over the ownership of the data. [`Array`]
75+
//! owns its data; [`ArrayView`] is a view;
76+
//! [`ArrayViewMut`] is a mutable view; [`CowArray`]
7777
//! either owns its data or is a view (with copy-on-write mutation of the view
78-
//! variant); and [`ArcArray`][ArcArray] has a reference-counted pointer to its
78+
//! variant); and [`ArcArray`] has a reference-counted pointer to its
7979
//! data (with copy-on-write mutation). Arrays and views follow Rust's aliasing
8080
//! rules.
8181
//!
@@ -91,7 +91,7 @@
9191
//! <td>
9292
//!
9393
//! In `ndarray`, you can create fixed-dimension arrays, such as
94-
//! [`Array2`][Array2]. This takes advantage of the type system to help you
94+
//! [`Array2`]. This takes advantage of the type system to help you
9595
//! write correct code and also avoids small heap allocations for the shape and
9696
//! strides.
9797
//!
@@ -263,7 +263,7 @@
263263
//! Note that [`a.shape()`][.shape()], [`a.dim()`][.dim()], and
264264
//! [`a.raw_dim()`][.raw_dim()] all return the shape of the array, but as
265265
//! different types. `a.shape()` returns the shape as `&[Ix]`, (where
266-
//! [`Ix`][Ix] is `usize`) which is useful for general operations on the shape.
266+
//! [`Ix`] is `usize`) which is useful for general operations on the shape.
267267
//! `a.dim()` returns the shape as `D::Pattern`, which is useful for
268268
//! pattern-matching shapes. `a.raw_dim()` returns the shape as `D`, which is
269269
//! useful for creating other arrays of the same shape.
@@ -376,7 +376,7 @@
376376
//!
377377
//! </td><td>
378378
//!
379-
//! [`a * b`, `a + b`, etc.](../../struct.ArrayBase.html#arithmetic-operations)
379+
//! [`a * b`, `a + b`, etc.](ArrayBase#arithmetic-operations)
380380
//!
381381
//! </td><td>
382382
//!
@@ -540,17 +540,17 @@
540540
//! ## Iteration
541541
//!
542542
//! `ndarray` has lots of interesting iterators/producers that implement the
543-
//! [`NdProducer`][NdProducer] trait, which is a generalization of `Iterator`
543+
//! [`NdProducer`](crate::NdProducer) trait, which is a generalization of `Iterator`
544544
//! to multiple dimensions. This makes it possible to correctly and efficiently
545545
//! zip together slices/subviews of arrays in multiple dimensions with
546-
//! [`Zip`][Zip] or [`azip!()`][azip!]. The purpose of this is similar to
546+
//! [`Zip`] or [`azip!()`]. The purpose of this is similar to
547547
//! [`np.nditer`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.nditer.html),
548-
//! but [`Zip`][Zip] is implemented and used somewhat differently.
548+
//! but [`Zip`] is implemented and used somewhat differently.
549549
//!
550550
//! This table lists some of the iterators/producers which have a direct
551551
//! equivalent in NumPy. For a more complete introduction to producers and
552552
//! iterators, see [*Loops, Producers, and
553-
//! Iterators*](../../struct.ArrayBase.html#loops-producers-and-iterators).
553+
//! Iterators*](ArrayBase#loops-producers-and-iterators).
554554
//! Note that there are also variants of these iterators (with a `_mut` suffix)
555555
//! that yield `ArrayViewMut` instead of `ArrayView`.
556556
//!
@@ -570,88 +570,75 @@
570570
//! `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
571571
//! `a.shape[0] == a.shape[1]` | [`a.is_square()`][.is_square()] | check if the array is square
572572
//!
573-
//! [.abs_diff_eq()]: ../../struct.ArrayBase.html#impl-AbsDiffEq<ArrayBase<S2%2C%20D>>
574-
//! [ArcArray]: ../../type.ArcArray.html
575-
//! [arr2()]: ../../fn.arr2.html
576-
//! [array!]: ../../macro.array.html
577-
//! [Array]: ../../type.Array.html
578-
//! [Array2]: ../../type.Array2.html
579-
//! [ArrayBase]: ../../struct.ArrayBase.html
580-
//! [ArrayView]: ../../type.ArrayView.html
581-
//! [ArrayViewMut]: ../../type.ArrayViewMut.html
582-
//! [.assign()]: ../../struct.ArrayBase.html#method.assign
583-
//! [.axis_iter()]: ../../struct.ArrayBase.html#method.axis_iter
584-
//! [azip!]: ../../macro.azip.html
585-
//! [.ncols()]: ../../struct.ArrayBase.html#method.ncols
586-
//! [.column()]: ../../struct.ArrayBase.html#method.column
587-
//! [.column_mut()]: ../../struct.ArrayBase.html#method.column_mut
588-
//! [concatenate!]: ../../macro.concatenate.html
589-
//! [concatenate()]: ../../fn.concatenate.html
590-
//! [CowArray]: ../../type.CowArray.html
591-
//! [::default()]: ../../struct.ArrayBase.html#method.default
592-
//! [.diag()]: ../../struct.ArrayBase.html#method.diag
593-
//! [.dim()]: ../../struct.ArrayBase.html#method.dim
594-
//! [::eye()]: ../../struct.ArrayBase.html#method.eye
595-
//! [.fill()]: ../../struct.ArrayBase.html#method.fill
596-
//! [.fold()]: ../../struct.ArrayBase.html#method.fold
597-
//! [.fold_axis()]: ../../struct.ArrayBase.html#method.fold_axis
598-
//! [::from_elem()]: ../../struct.ArrayBase.html#method.from_elem
599-
//! [::from_iter()]: ../../struct.ArrayBase.html#method.from_iter
600-
//! [::from_diag()]: ../../struct.ArrayBase.html#method.from_diag
601-
//! [::from_shape_fn()]: ../../struct.ArrayBase.html#method.from_shape_fn
602-
//! [::from_shape_vec()]: ../../struct.ArrayBase.html#method.from_shape_vec
603-
//! [::from_shape_vec_unchecked()]: ../../struct.ArrayBase.html#method.from_shape_vec_unchecked
604-
//! [::from_vec()]: ../../struct.ArrayBase.html#method.from_vec
605-
//! [.index()]: ../../struct.ArrayBase.html#impl-Index<I>
606-
//! [.indexed_iter()]: ../../struct.ArrayBase.html#method.indexed_iter
607-
//! [.insert_axis()]: ../../struct.ArrayBase.html#method.insert_axis
608-
//! [.is_empty()]: ../../struct.ArrayBase.html#method.is_empty
609-
//! [.is_square()]: ../../struct.ArrayBase.html#method.is_square
610-
//! [.iter()]: ../../struct.ArrayBase.html#method.iter
611-
//! [Ix]: ../../type.Ix.html
612-
//! [.len()]: ../../struct.ArrayBase.html#method.len
613-
//! [.len_of()]: ../../struct.ArrayBase.html#method.len_of
614-
//! [::linspace()]: ../../struct.ArrayBase.html#method.linspace
615-
//! [::logspace()]: ../../struct.ArrayBase.html#method.logspace
616-
//! [::geomspace()]: ../../struct.ArrayBase.html#method.geomspace
617-
//! [.map()]: ../../struct.ArrayBase.html#method.map
618-
//! [.map_axis()]: ../../struct.ArrayBase.html#method.map_axis
619-
//! [.map_inplace()]: ../../struct.ArrayBase.html#method.map_inplace
620-
//! [.mapv()]: ../../struct.ArrayBase.html#method.mapv
621-
//! [.mapv_inplace()]: ../../struct.ArrayBase.html#method.mapv_inplace
622-
//! [.mapv_into()]: ../../struct.ArrayBase.html#method.mapv_into
623-
//! [matrix-* dot]: ../../struct.ArrayBase.html#method.dot-1
624-
//! [.mean()]: ../../struct.ArrayBase.html#method.mean
625-
//! [.mean_axis()]: ../../struct.ArrayBase.html#method.mean_axis
626-
//! [.ndim()]: ../../struct.ArrayBase.html#method.ndim
627-
//! [NdProducer]: ../../trait.NdProducer.html
628-
//! [::ones()]: ../../struct.ArrayBase.html#method.ones
629-
//! [.outer_iter()]: ../../struct.ArrayBase.html#method.outer_iter
630-
//! [::range()]: ../../struct.ArrayBase.html#method.range
631-
//! [.raw_dim()]: ../../struct.ArrayBase.html#method.raw_dim
632-
//! [.reversed_axes()]: ../../struct.ArrayBase.html#method.reversed_axes
633-
//! [.row()]: ../../struct.ArrayBase.html#method.row
634-
//! [.row_mut()]: ../../struct.ArrayBase.html#method.row_mut
635-
//! [.nrows()]: ../../struct.ArrayBase.html#method.nrows
636-
//! [s!]: ../../macro.s.html
637-
//! [.sum()]: ../../struct.ArrayBase.html#method.sum
638-
//! [.slice()]: ../../struct.ArrayBase.html#method.slice
639-
//! [.slice_axis()]: ../../struct.ArrayBase.html#method.slice_axis
640-
//! [.slice_collapse()]: ../../struct.ArrayBase.html#method.slice_collapse
641-
//! [.slice_move()]: ../../struct.ArrayBase.html#method.slice_move
642-
//! [.slice_mut()]: ../../struct.ArrayBase.html#method.slice_mut
643-
//! [.shape()]: ../../struct.ArrayBase.html#method.shape
644-
//! [stack!]: ../../macro.stack.html
645-
//! [stack()]: ../../fn.stack.html
646-
//! [.strides()]: ../../struct.ArrayBase.html#method.strides
647-
//! [.index_axis()]: ../../struct.ArrayBase.html#method.index_axis
648-
//! [.sum_axis()]: ../../struct.ArrayBase.html#method.sum_axis
649-
//! [.t()]: ../../struct.ArrayBase.html#method.t
650-
//! [vec-* dot]: ../../struct.ArrayBase.html#method.dot
651-
//! [.for_each()]: ../../struct.ArrayBase.html#method.for_each
652-
//! [::zeros()]: ../../struct.ArrayBase.html#method.zeros
653-
//! [Zip]: ../../struct.Zip.html
573+
//! [.abs_diff_eq()]: ArrayBase#impl-AbsDiffEq<ArrayBase<S2%2C%20D>>
574+
//! [.assign()]: ArrayBase::assign
575+
//! [.axis_iter()]: ArrayBase::axis_iter
576+
//! [.ncols()]: ArrayBase::ncols
577+
//! [.column()]: ArrayBase::column
578+
//! [.column_mut()]: ArrayBase::column_mut
579+
//! [concatenate()]: crate::concatenate()
580+
//! [::default()]: ArrayBase::default
581+
//! [.diag()]: ArrayBase::diag
582+
//! [.dim()]: ArrayBase::dim
583+
//! [::eye()]: ArrayBase::eye
584+
//! [.fill()]: ArrayBase::fill
585+
//! [.fold()]: ArrayBase::fold
586+
//! [.fold_axis()]: ArrayBase::fold_axis
587+
//! [::from_elem()]: ArrayBase::from_elem
588+
//! [::from_iter()]: ArrayBase::from_iter
589+
//! [::from_diag()]: ArrayBase::from_diag
590+
//! [::from_shape_fn()]: ArrayBase::from_shape_fn
591+
//! [::from_shape_vec()]: ArrayBase::from_shape_vec
592+
//! [::from_shape_vec_unchecked()]: ArrayBase::from_shape_vec_unchecked
593+
//! [::from_vec()]: ArrayBase::from_vec
594+
//! [.index()]: ArrayBase#impl-Index<I>
595+
//! [.indexed_iter()]: ArrayBase::indexed_iter
596+
//! [.insert_axis()]: ArrayBase::insert_axis
597+
//! [.is_empty()]: ArrayBase::is_empty
598+
//! [.is_square()]: ArrayBase::is_square
599+
//! [.iter()]: ArrayBase::iter
600+
//! [.len()]: ArrayBase::len
601+
//! [.len_of()]: ArrayBase::len_of
602+
//! [::linspace()]: ArrayBase::linspace
603+
//! [::logspace()]: ArrayBase::logspace
604+
//! [::geomspace()]: ArrayBase::geomspace
605+
//! [.map()]: ArrayBase::map
606+
//! [.map_axis()]: ArrayBase::map_axis
607+
//! [.map_inplace()]: ArrayBase::map_inplace
608+
//! [.mapv()]: ArrayBase::mapv
609+
//! [.mapv_inplace()]: ArrayBase::mapv_inplace
610+
//! [.mapv_into()]: ArrayBase::mapv_into
611+
//! [matrix-* dot]: ArrayBase::dot-1
612+
//! [.mean()]: ArrayBase::mean
613+
//! [.mean_axis()]: ArrayBase::mean_axis
614+
//! [.ndim()]: ArrayBase::ndim
615+
//! [::ones()]: ArrayBase::ones
616+
//! [.outer_iter()]: ArrayBase::outer_iter
617+
//! [::range()]: ArrayBase::range
618+
//! [.raw_dim()]: ArrayBase::raw_dim
619+
//! [.reversed_axes()]: ArrayBase::reversed_axes
620+
//! [.row()]: ArrayBase::row
621+
//! [.row_mut()]: ArrayBase::row_mut
622+
//! [.nrows()]: ArrayBase::nrows
623+
//! [.sum()]: ArrayBase::sum
624+
//! [.slice()]: ArrayBase::slice
625+
//! [.slice_axis()]: ArrayBase::slice_axis
626+
//! [.slice_collapse()]: ArrayBase::slice_collapse
627+
//! [.slice_move()]: ArrayBase::slice_move
628+
//! [.slice_mut()]: ArrayBase::slice_mut
629+
//! [.shape()]: ArrayBase::shape
630+
//! [stack()]: crate::stack()
631+
//! [.strides()]: ArrayBase::strides
632+
//! [.index_axis()]: ArrayBase::index_axis
633+
//! [.sum_axis()]: ArrayBase::sum_axis
634+
//! [.t()]: ArrayBase::t
635+
//! [vec-* dot]: ArrayBase::dot
636+
//! [.for_each()]: ArrayBase::for_each
637+
//! [::zeros()]: ArrayBase::zeros
638+
//! [`Zip`]: crate::Zip
654639
655640
pub mod coord_transform;
656641
pub mod rk_step;
657642
pub mod simple_math;
643+
644+
use crate::imp_prelude::*; // for intra-doc links

src/doc/ndarray_for_numpy_users/rk_step.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@
120120
//! * Don't return a newly allocated `f_new` array. If the caller wants this
121121
//! information, they can get it from the last row of `k`.
122122
//!
123-
//! * Use [`c.mul_add(h, t)`][f64.mul_add()] instead of `t + c * h`. This is
123+
//! * Use [`c.mul_add(h, t)`](f64::mul_add) instead of `t + c * h`. This is
124124
//! faster and reduces the floating-point error. It might also be beneficial
125-
//! to use [`.scaled_add()`][.scaled_add()] or a combination of
126-
//! [`azip!()`][azip!] and [`.mul_add()`][f64.mul_add()] on the arrays in
125+
//! to use [`.scaled_add()`] or a combination of
126+
//! [`azip!()`] and [`.mul_add()`](f64::mul_add) on the arrays in
127127
//! some places, but that's not demonstrated in the example below.
128128
//!
129129
//! ```
@@ -168,9 +168,7 @@
168168
//! # fn main() { let _ = rk_step::<fn(_, ArrayView1<'_, f64>, ArrayViewMut1<'_, f64>)>; }
169169
//! ```
170170
//!
171-
//! [f64.mul_add()]: https://doc.rust-lang.org/std/primitive.f64.html#method.mul_add
172-
//! [.scaled_add()]: ../../../struct.ArrayBase.html#method.scaled_add
173-
//! [azip!]: ../../../macro.azip.html
171+
//! [`.scaled_add()`]: crate::ArrayBase::scaled_add
174172
//!
175173
//! ### SciPy license
176174
//!

src/free_functions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use alloc::vec::Vec;
1414
use crate::imp_prelude::*;
1515
use crate::{dimension, ArcArray1, ArcArray2};
1616

17-
/// Create an [**`Array`**](type.Array.html) with one, two or
17+
/// Create an **[`Array`]** with one, two or
1818
/// three dimensions.
1919
///
2020
/// ```

src/impl_constructors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ macro_rules! size_of_shape_checked_unwrap {
269269
/// column major (“f” order) memory layout instead of the default row major.
270270
/// For example `Array::zeros((5, 6).f())` makes a column major 5 × 6 array.
271271
///
272-
/// Use [`IxDyn`](type.IxDyn.html) for the shape to create an array with dynamic
272+
/// Use [`type@IxDyn`] for the shape to create an array with dynamic
273273
/// number of axes.
274274
///
275275
/// Finally, the few constructors that take a completely general

src/impl_cow.rs

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ use crate::imp_prelude::*;
1111
/// Methods specific to `CowArray`.
1212
///
1313
/// ***See also all methods for [`ArrayBase`]***
14-
///
15-
/// [`ArrayBase`]: struct.ArrayBase.html
1614
impl<'a, A, D> CowArray<'a, A, D>
1715
where
1816
D: Dimension,

src/impl_methods.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ where
179179
/// If the input array is contiguous, then the output array will have the same
180180
/// memory layout. Otherwise, the layout of the output array is unspecified.
181181
/// If you need a particular layout, you can allocate a new array with the
182-
/// desired memory layout and [`.assign()`](#method.assign) the data.
182+
/// desired memory layout and [`.assign()`](Self::assign) the data.
183183
/// Alternatively, you can collectan iterator, like this for a result in
184184
/// standard layout:
185185
///
@@ -400,7 +400,7 @@ where
400400
///
401401
/// Iterator element type is `(D::Pattern, &A)`.
402402
///
403-
/// See also [`Zip::indexed`](struct.Zip.html)
403+
/// See also [`Zip::indexed`]
404404
pub fn indexed_iter(&self) -> IndexedIter<'_, A, D>
405405
where
406406
S: Data,
@@ -544,9 +544,9 @@ where
544544
/// collapsed, as in [`.collapse_axis()`], rather than removed, as in
545545
/// [`.slice_move()`] or [`.index_axis_move()`].
546546
///
547-
/// [`.collapse_axis()`]: #method.collapse_axis
548-
/// [`.slice_move()`]: #method.slice_move
549-
/// [`.index_axis_move()`]: #method.index_axis_move
547+
/// [`.collapse_axis()`]: Self::collapse_axis
548+
/// [`.slice_move()`]: Self::slice_move
549+
/// [`.index_axis_move()`]: Self::index_axis_move
550550
///
551551
/// See [*Slicing*](#slicing) for full documentation.
552552
/// See also [`s!`], [`SliceArg`], and [`SliceInfo`](crate::SliceInfo).
@@ -916,7 +916,7 @@ where
916916

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

0 commit comments

Comments
 (0)