|
23 | 23 | //!
|
24 | 24 | //! # Similarities
|
25 | 25 | //!
|
26 |
| -//! `ndarray`'s array type ([`ArrayBase`][ArrayBase]), is very similar to |
| 26 | +//! `ndarray`'s array type ([`ArrayBase`]), is very similar to |
27 | 27 | //! NumPy's array type (`numpy.ndarray`):
|
28 | 28 | //!
|
29 | 29 | //! * Arrays have a single element type.
|
|
70 | 70 | //! </td>
|
71 | 71 | //! <td>
|
72 | 72 | //!
|
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`] |
77 | 77 | //! 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 |
79 | 79 | //! data (with copy-on-write mutation). Arrays and views follow Rust's aliasing
|
80 | 80 | //! rules.
|
81 | 81 | //!
|
|
91 | 91 | //! <td>
|
92 | 92 | //!
|
93 | 93 | //! 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 |
95 | 95 | //! write correct code and also avoids small heap allocations for the shape and
|
96 | 96 | //! strides.
|
97 | 97 | //!
|
|
263 | 263 | //! Note that [`a.shape()`][.shape()], [`a.dim()`][.dim()], and
|
264 | 264 | //! [`a.raw_dim()`][.raw_dim()] all return the shape of the array, but as
|
265 | 265 | //! 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. |
267 | 267 | //! `a.dim()` returns the shape as `D::Pattern`, which is useful for
|
268 | 268 | //! pattern-matching shapes. `a.raw_dim()` returns the shape as `D`, which is
|
269 | 269 | //! useful for creating other arrays of the same shape.
|
|
376 | 376 | //!
|
377 | 377 | //! </td><td>
|
378 | 378 | //!
|
379 |
| -//! [`a * b`, `a + b`, etc.](../../struct.ArrayBase.html#arithmetic-operations) |
| 379 | +//! [`a * b`, `a + b`, etc.](ArrayBase#arithmetic-operations) |
380 | 380 | //!
|
381 | 381 | //! </td><td>
|
382 | 382 | //!
|
|
540 | 540 | //! ## Iteration
|
541 | 541 | //!
|
542 | 542 | //! `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` |
544 | 544 | //! to multiple dimensions. This makes it possible to correctly and efficiently
|
545 | 545 | //! 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 |
547 | 547 | //! [`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. |
549 | 549 | //!
|
550 | 550 | //! This table lists some of the iterators/producers which have a direct
|
551 | 551 | //! equivalent in NumPy. For a more complete introduction to producers and
|
552 | 552 | //! iterators, see [*Loops, Producers, and
|
553 |
| -//! Iterators*](../../struct.ArrayBase.html#loops-producers-and-iterators). |
| 553 | +//! Iterators*](ArrayBase#loops-producers-and-iterators). |
554 | 554 | //! Note that there are also variants of these iterators (with a `_mut` suffix)
|
555 | 555 | //! that yield `ArrayViewMut` instead of `ArrayView`.
|
556 | 556 | //!
|
|
570 | 570 | //! `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
|
571 | 571 | //! `a.shape[0] == a.shape[1]` | [`a.is_square()`][.is_square()] | check if the array is square
|
572 | 572 | //!
|
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 |
654 | 639 |
|
655 | 640 | pub mod coord_transform;
|
656 | 641 | pub mod rk_step;
|
657 | 642 | pub mod simple_math;
|
| 643 | + |
| 644 | +// This is to avoid putting `crate::` everywhere |
| 645 | +#[allow(unused_imports)] |
| 646 | +use crate::imp_prelude::*; |
0 commit comments