Skip to content

Commit c2aeaeb

Browse files
committed
docs: add missing docs
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 30c433f commit c2aeaeb

File tree

3 files changed

+43
-11
lines changed

3 files changed

+43
-11
lines changed

lib/node_modules/@stdlib/ndarray/concat/README.md

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

2121
# concat
2222

23-
> Concatenate a list of ndarrays along a specified ndarray dimension.
23+
> Concatenate a list of [ndarrays][@stdlib/ndarray/ctor] along a specified [ndarray][@stdlib/ndarray/ctor] dimension.
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,7 +42,7 @@ var concat = require( '@stdlib/ndarray/concat' );
4242

4343
#### concat( arrays, dim )
4444

45-
Concatenates a list of ndarrays along a specified ndarray dimension.
45+
Concatenates a list of [ndarrays][@stdlib/ndarray/ctor] along a specified [ndarray][@stdlib/ndarray/ctor] dimension.
4646

4747
```javascript
4848
var ndarray = require( '@stdlib/ndarray/ctor' );
@@ -59,17 +59,46 @@ var out = concat( [ x, y ], -1 );
5959
// returns <ndarray>
6060

6161
var arr = ndarray2array( out );
62-
// returns [ [ -1.0, 2.0, -5.0, 6.0, 7.0 ], [ -3.0, 4.0, 8.0, 9.0, 10.0 ] ]
62+
// returns [ [ -1.0, 2.0, -5.0, 6.0, -7.0 ], [ -3.0, 4.0, 8.0, -9.0, 10.0 ] ]
6363
```
6464

6565
The function accepts the following arguments:
6666

67-
- **arrays**: a list of input ndarrays.
68-
- **dim**: dimension along which the arrays are concatenated. Default: `-1`.
67+
- **arrays**: a list of input [ndarrays][@stdlib/ndarray/ctor].
68+
- **dim**: dimension along which the [ndarrays][@stdlib/ndarray/ctor] are concatenated. Default: `-1`.
6969

7070
#### concat.assign( arrays, out, dim )
7171

72-
<!-- TODO: Add documentation -->
72+
Concatenates a list of ndarrays along a specified ndarray dimension and assigns results to an output ndarray.
73+
74+
```javascript
75+
var ndarray = require( '@stdlib/ndarray/ctor' );
76+
var Float64Array = require( '@stdlib/array/float64' );
77+
var ndarray2array = require( '@stdlib/ndarray/to-array' );
78+
79+
var xbuf = new Float64Array( [ -1.0, 2.0, -3.0, 4.0 ] );
80+
var x = new ndarray( 'float64', xbuf, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
81+
82+
var ybuf = new Float64Array( [ -5.0, 6.0, -7.0, 8.0, -9.0, 10.0 ] );
83+
var y = new ndarray( 'float64', ybuf, [ 2, 3 ], [ 3, 1 ], 0, 'row-major' );
84+
85+
var z = new ndarray( 'float64', new Float64Array( 10 ), [ 2, 5 ], [ 5, 1 ], 0, 'row-major' );
86+
87+
var out = concat.assign( [ x, y ], z, -1 );
88+
// returns <ndarray>
89+
90+
var bool = ( out === z );
91+
// returns true
92+
93+
var arr = ndarray2array( z );
94+
// returns [ [ -1.0, 2.0, -5.0, 6.0, -7.0 ], [ -3.0, 4.0, 8.0, -9.0, 10.0 ] ]
95+
```
96+
97+
The function accepts the following arguments:
98+
99+
- **arrays**: a list of input [ndarrays][@stdlib/ndarray/ctor].
100+
- **out**: output [ndarray][@stdlib/ndarray/ctor]
101+
- **dim**: dimension along which the [ndarrays][@stdlib/ndarray/ctor] are concatenated. Default: `-1`.
73102

74103
</section>
75104

@@ -137,6 +166,8 @@ console.log( ndarray2array( out ) );
137166

138167
<section class="links">
139168

169+
[@stdlib/ndarray/ctor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/ctor
170+
140171
</section>
141172

142173
<!-- /.links -->

lib/node_modules/@stdlib/ndarray/concat/lib/assign.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ var output = require( './output.js' );
4141
*
4242
* @param {ArrayLikeObject<ndarray>} arrays - array-like object containing input ndarrays
4343
* @param {ndarray} out - output ndarray
44-
* @param {integer} dim - dimension along which the arrays are concatenated
44+
* @param {NegativeInteger} dim - dimension along which the ndarrays are concatenated
4545
* @throws {TypeError} first argument must be an array of ndarray-like objects
4646
* @throws {RangeError} first argument must have more than one ndarray
4747
* @throws {TypeError} second argument must be an array of ndarray-like objects
4848
* @returns {ndarray} output ndarray
4949
*
5050
* @example
51-
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
52-
* var Float64Array = require( '@stdlib/array/float64' );
5351
* var ndarray = require( '@stdlib/ndarray/ctor' );
52+
* var Float64Array = require( '@stdlib/array/float64' );
53+
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
5454
*
5555
* var xbuf = new Float64Array( [ -1.0, 2.0, -3.0, 4.0 ] );
5656
* var x = new ndarray( 'float64', xbuf, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
@@ -61,12 +61,13 @@ var output = require( './output.js' );
6161
* var z = new ndarray( 'float64', new Float64Array( 10 ), [ 2, 5 ], [ 5, 1 ], 0, 'row-major' );
6262
*
6363
* var out = assign( [ x, y ], z, -1 );
64+
* // returns <ndarray>
6465
*
6566
* var bool = ( out === z );
6667
* // returns true
6768
*
6869
* var arr = ndarray2array( z );
69-
* // returns [ [ -1.0, 2.0, -5.0, 6.0, 7.0 ], [ -3.0, 4.0, 8.0, 9.0, 10.0 ] ]
70+
* // returns [ [ -1.0, 2.0, -5.0, 6.0, -7.0 ], [ -3.0, 4.0, 8.0, -9.0, 10.0 ] ]
7071
*/
7172
function assign( arrays, out, dim ) {
7273
var istacks;

lib/node_modules/@stdlib/ndarray/concat/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var output = require( './output.js' );
4141
* Concatenates a list of ndarrays along a specified ndarray dimension.
4242
*
4343
* @param {ArrayLikeObject<Object>} arrays - array-like object containing input ndarrays
44-
* @param {NegativeInteger} dim - dimension along which the arrays are concatenated
44+
* @param {NegativeInteger} dim - dimension along which the ndarrays are concatenated
4545
* @throws {TypeError} first argument must be an array of ndarray-like objects
4646
* @throws {RangeError} first argument must have one or more ndarrays
4747
* @throws {TypeError} second argument must be a negative integer

0 commit comments

Comments
 (0)