Skip to content

Commit 0e2163e

Browse files
committed
chore: clean-up
1 parent d5eb833 commit 0e2163e

File tree

7 files changed

+220
-201
lines changed

7 files changed

+220
-201
lines changed

lib/node_modules/@stdlib/ndarray/base/eye/README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# eye
2222

23-
> Create a two-dimensional array with ones on the kth diagonal and zeros elsewhere
23+
> Create a two-dimensional ndarray with ones on the kth diagonal and zeros elsewhere
2424
2525
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
2626

@@ -42,23 +42,20 @@ var eye = require( '@stdlib/ndarray/base/eye' );
4242

4343
#### eye( dtype, rows, cols, k, order )
4444

45-
Creates a two-dimensional array with ones on the kth diagonal and zeros elsewhere.
45+
Returns a two-dimensional ndarray with ones on the kth diagonal and zeros elsewhere.
4646

4747
```javascript
4848
var getShape = require( '@stdlib/ndarray/shape' );
4949
var getDType = require( '@stdlib/ndarray/dtype' );
5050

51-
var x = eye( 'float64', 3, 3, 0, 'row-major');
52-
// returns <ndarray>
51+
var arr = eye( 'float64', 3, 3, 0, 'row-major');
52+
// returns <ndarray>[ [ 1.0, 0.0, 0.0 ], [ 0.0, 1.0, 0.0 ], [ 0.0, 0.0, 1.0 ] ]
5353

54-
var sh = getShape( x );
54+
var sh = getShape( arr );
5555
// returns [ 3, 3 ]
5656

57-
var dt = String( getDType( x ) );
57+
var dt = String( getDType( arr ) );
5858
// returns 'float64'
59-
60-
var v = x.get( 0, 0 );
61-
// returns 1.0
6259
```
6360

6461
The function accepts the following arguments:
@@ -80,8 +77,8 @@ The function accepts the following arguments:
8077

8178
## Notes
8279

83-
- If the provided [data type][@stdlib/ndarray/dtypes] is complex, the function returns an ndarray whose kth diagonal is filled with complex numbers whose real component equals one and imaginary component equals zero
84-
- If `k` is greater than the number of columns or less than the number of negative rows, the function returns an array filled with zeros
80+
- If the provided [data type][@stdlib/ndarray/dtypes] is complex, the function returns an ndarray whose kth diagonal is filled with complex numbers whose real component equals one and imaginary component equals zero.
81+
- If `k` is greater than the number of columns or less than the number of negative rows, the function returns an ndarray filled with zeros.
8582

8683
</section>
8784

@@ -99,11 +96,11 @@ The function accepts the following arguments:
9996
var eye = require( '@stdlib/ndarray/base/eye' );
10097
var ndarray2array = require( '@stdlib/ndarray/to-array' );
10198

102-
var x = eye( 'float64', 3, 3, 1, 'row-major');
103-
console.log( ndarray2array( x ) );
99+
var arr = eye( 'float64', 3, 3, 1, 'row-major');
100+
console.log( ndarray2array( arr ) );
104101

105-
x = eye( 'complex64', 3, 3, 1, 'row-major');
106-
console.log( ndarray2array( x ) );
102+
arr = eye( 'complex64', 3, 3, 1, 'row-major');
103+
console.log( ndarray2array( arr ) );
107104
```
108105

109106
</section>

lib/node_modules/@stdlib/ndarray/base/eye/docs/repl.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
{{alias}}( dtype, rows, cols, k, order )
3-
Creates a two-dimensional array with ones on the kth diagonal and zeros
3+
Returns a two-dimensional ndarray with ones on the kth diagonal and zeros
44
elsewhere.
55

66
If the provided data type is complex, the function returns an ndarray
@@ -12,10 +12,10 @@
1212
dtype: string|DataType
1313
Underlying data type.
1414

15-
rows: NonNegativeInteger
15+
rows: integer
1616
Number of rows.
1717

18-
cols: NonNegativeInteger
18+
cols: integer
1919
Number of columns.
2020

2121
k: integer
@@ -32,13 +32,12 @@
3232

3333
Examples
3434
--------
35-
> var arr = {{alias}}( 'float64', 2, 2, 0, 'row-major' )
36-
<ndarray>
35+
> var arr = {{alias}}( 'float64', 3, 3, 0, 'row-major' )
36+
<ndarray>[ [ 1.0, 0.0, 0.0 ], [ 0.0, 1.0, 0.0 ], [ 0.0, 0.0, 1.0 ] ]
3737
> var sh = {{alias:@stdlib/ndarray/shape}}( arr )
38-
[ 2, 2 ]
39-
> var data = {{alias:@stdlib/ndarray/to-array}}( arr )
40-
[ [ 1, 0 ], [ 0, 1 ] ]
41-
--------
38+
[ 3, 3 ]
39+
> var dt = String( {{alias:@stdlib/ndarray/dtype}}( arr ) )
40+
'float64'
4241

4342
See Also
4443
--------

0 commit comments

Comments
 (0)