You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/ndarray/diagonal/README.md
+27-2Lines changed: 27 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,8 @@ limitations under the License.
22
22
23
23
> Return a **read-only** view of the diagonal of a matrix (or stack of matrices).
24
24
25
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro section element. -->
26
+
25
27
<sectionclass="intro">
26
28
27
29
For an `M`-by-`N` matrix `A`, the `k`-th diagonal is defined as
@@ -39,12 +41,29 @@ D_k = \{\, A_{i,j} : j - i = k \,\}
39
41
40
42
<!-- </equation> -->
41
43
42
-
where `k = 0` corresponds to the main diagonal, `k > 0` corresponds to the super-diagonals (above the main diagonal), and `k < 0` corresponds to the sub-diagonals (below the main diagonal).
44
+
where `k = 0` corresponds to the main diagonal, `k > 0` corresponds to the super-diagonals (above the main diagonal), and `k < 0` corresponds to the sub-diagonals (below the main diagonal). For example, given the matrix
the main diagonal is `[ a_{0,0}, a_{1,1}, a_{2,2} ]`, the super-diagonal `k = 1` is `[ a_{0,1}, a_{1,2} ]`, and the sub-diagonal `k = -1` is `[ a_{1,0}, a_{2,1} ]`.
43
60
44
61
</section>
45
62
46
63
<!-- /.intro -->
47
64
65
+
<!-- Package usage documentation. -->
66
+
48
67
<sectionclass="usage">
49
68
50
69
## Usage
@@ -55,7 +74,7 @@ var diagonal = require( '@stdlib/ndarray/diagonal' );
55
74
56
75
#### diagonal( x\[, options] )
57
76
58
-
Returns a read-only view of the diagonal of a matrix (or stack of matrices)`x`.
77
+
Returns a read-only view of the diagonal of a matrix (or stack of matrices).
59
78
60
79
```javascript
61
80
var array =require( '@stdlib/ndarray/array' );
@@ -81,6 +100,8 @@ The function accepts the following options:
81
100
82
101
<!-- /.usage -->
83
102
103
+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
104
+
84
105
<sectionclass="notes">
85
106
86
107
## Notes
@@ -92,6 +113,8 @@ The function accepts the following options:
92
113
93
114
<!-- /.notes -->
94
115
116
+
<!-- Package usage examples. -->
117
+
95
118
<sectionclass="examples">
96
119
97
120
## Examples
@@ -128,6 +151,8 @@ console.log( ndarray2array( y ) );
128
151
129
152
<!-- /.examples -->
130
153
154
+
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
0 commit comments