Fix link to dot method for 2-D arrays (#489)

Note that this also changes the link name from `dot` to
`ndarray::Array2::dot` to avoid conflicting with the `vector-norm.md`
recipe.
This commit is contained in:
Jim Turner 2018-12-07 09:25:25 -05:00 committed by Andrew Gauger
parent dc8f1f2dd2
commit 77739fb73c

View file

@ -3,13 +3,13 @@
Creates a 1-D array (vector) with [`ndarray::arr1`] and a 2-D array (matrix)
with [`ndarray::arr2`]. First, a scalar is multiplied by the vector to get
another vector. Then, the matrix is multiplied by the new vector with [`dot`].
([`dot`] performs matrix multiplication, while the `*` operator performs
element-wise multiplication.) In `ndarray`, 1-D arrays can be interpreted as
either row or column vectors depending on context. If representing the
orientation of a vector is important, a 2-D array with one row or one column
must be used instead. In this example, the vector is a 1-D array on the
right-hand side, so [`dot`] handles it as a column vector.
another vector. Then, the matrix is multiplied by the new vector with
[`ndarray::Array2::dot`]. (`dot` performs matrix multiplication, while the `*`
operator performs element-wise multiplication.) In `ndarray`, 1-D arrays can be
interpreted as either row or column vectors depending on context. If
representing the orientation of a vector is important, a 2-D array with one row
or one column must be used instead. In this example, the vector is a 1-D array
on the right-hand side, so `dot` handles it as a column vector.
```rust
extern crate ndarray;
@ -32,6 +32,6 @@ fn main() {
}
```
[`dot`]: https://docs.rs/ndarray/*/ndarray/struct.ArrayBase.html#method.dot
[`ndarray::Array2::dot`]: https://docs.rs/ndarray/*/ndarray/struct.ArrayBase.html#method.dot-1
[`ndarray::arr1`]: https://docs.rs/ndarray/*/ndarray/fn.arr1.html
[`ndarray::arr2`]: https://docs.rs/ndarray/*/ndarray/fn.arr2.html