Skip to content

Commit 356ec73

Browse files
committed
Auto-generated commit
1 parent 6cd56b6 commit 356ec73

2 files changed

Lines changed: 111 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
<details>
5050

51+
- [`839aaf6`](https://github.com/stdlib-js/stdlib/commit/839aaf681cf5e10b2f4d1ed566d716dd2726421b) - **docs:** update documentation [(#13120)](https://github.com/stdlib-js/stdlib/pull/13120) _(by stdlib-bot)_
5152
- [`4a14673`](https://github.com/stdlib-js/stdlib/commit/4a1467352fcbd486caca6564a300c627449d796d) - **docs:** update namespace table of contents [(#13121)](https://github.com/stdlib-js/stdlib/pull/13121) _(by stdlib-bot)_
5253
- [`8bf9161`](https://github.com/stdlib-js/stdlib/commit/8bf91614301abf9249ff3ea9379baa4bc6c450e0) - **feat:** add `ndarray/matrix` namespace _(by Athan Reines)_
5354
- [`dc9a2a7`](https://github.com/stdlib-js/stdlib/commit/dc9a2a7eb4962f9743ba7a7369a6593669370296) - **feat:** add `ndarray/matrix/ctor` _(by Athan Reines)_

matrix/docs/types/index.d.ts

Lines changed: 110 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,116 @@ import matrix = require( './../../../matrix/ctor' );
2727
*/
2828
interface Namespace {
2929
/**
30-
* TODO.
30+
* Creates a matrix (i.e., a two-dimensional ndarray).
31+
*
32+
* @param arg0 - number of rows, shape, array-like object, ArrayBuffer, or iterable
33+
* @param arg1 - number of columns or integer byte offset specifying the location of the first matrix element
34+
* @param arg2 - number of rows or shape
35+
* @param arg3 - number of columns
36+
* @param dtype - data type (default: 'float64')
37+
* @param options - function options
38+
* @param options.readonly - boolean indicating whether to return a read-only matrix
39+
* @param options.mode - specifies how to handle indices which exceed matrix dimensions
40+
* @param options.submode - specifies how to handle subscripts which exceed array dimensions on a per dimension basis
41+
* @param options.order - memory layout (either row-major or column-major)
42+
* @returns two-dimensional ndarray
43+
*
44+
* @example
45+
* var getDType = require( './../../../dtype' );
46+
* var getShape = require( './../../../shape' );
47+
*
48+
* var arr = ns.matrix();
49+
* // returns <ndarray>
50+
*
51+
* var sh = getShape( arr );
52+
* // returns [ 0, 0 ]
53+
*
54+
* var dt = String( getDType( arr ) );
55+
* // returns 'float64'
56+
*
57+
* @example
58+
* var getDType = require( './../../../dtype' );
59+
* var getShape = require( './../../../shape' );
60+
*
61+
* var arr = ns.matrix( 2, 2 );
62+
* // returns <ndarray>
63+
*
64+
* var sh = getShape( arr );
65+
* // returns [ 2, 2 ]
66+
*
67+
* var dt = String( getDType( arr ) );
68+
* // returns 'float64'
69+
*
70+
* @example
71+
* var getDType = require( './../../../dtype' );
72+
* var getShape = require( './../../../shape' );
73+
*
74+
* var arr = ns.matrix( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] );
75+
* // returns <ndarray>
76+
*
77+
* var sh = getShape( arr );
78+
* // returns [ 2, 2 ]
79+
*
80+
* var dt = String( getDType( arr ) );
81+
* // returns 'float64'
82+
*
83+
* @example
84+
* var getDType = require( './../../../dtype' );
85+
* var getShape = require( './../../../shape' );
86+
*
87+
* var arr = ns.matrix( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], 'float32' );
88+
* // returns <ndarray>
89+
*
90+
* var sh = getShape( arr );
91+
* // returns [ 2, 2 ]
92+
*
93+
* var dt = String( getDType( arr ) );
94+
* // returns 'float32'
95+
*
96+
* @example
97+
* var getShape = require( './../../../shape' );
98+
* var getDType = require( './../../../dtype' );
99+
* var ArrayBuffer = require( '@stdlib/array/buffer' );
100+
*
101+
* var buf = new ArrayBuffer( 32 );
102+
* var arr = ns.matrix( buf, 8, 2, 1, 'int32' );
103+
* // returns <ndarray>
104+
*
105+
* var sh = getShape( arr );
106+
* // returns [ 2, 1 ]
107+
*
108+
* var dt = String( getDType( arr ) );
109+
* // returns 'int32'
110+
*
111+
* @example
112+
* var getShape = require( './../../../shape' );
113+
* var getDType = require( './../../../dtype' );
114+
* var ArrayBuffer = require( '@stdlib/array/buffer' );
115+
*
116+
* var buf = new ArrayBuffer( 32 );
117+
* var arr = ns.matrix( buf, 8, [ 2, 1 ], 'int32', {} );
118+
* // returns <ndarray>
119+
*
120+
* var sh = getShape( arr );
121+
* // returns [ 2, 1 ]
122+
*
123+
* var dt = String( getDType( arr ) );
124+
* // returns 'int32'
125+
*
126+
* @example
127+
* var getDType = require( './../../../dtype' );
128+
* var getShape = require( './../../../shape' );
129+
*
130+
* var Float32Matrix = ns.matrix.factory( 'float32' );
131+
*
132+
* var arr = new Float32Matrix( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] );
133+
* // returns <ndarray>
134+
*
135+
* var dt = String( getDType( arr ) );
136+
* // returns 'float32'
137+
*
138+
* var sh = getShape( arr );
139+
* // returns [ 2, 2 ]
31140
*/
32141
matrix: typeof matrix;
33142
}

0 commit comments

Comments
 (0)