Skip to content

Commit 9aa3908

Browse files
committed
Auto-generated commit
1 parent 145d48c commit 9aa3908

File tree

17 files changed

+2377
-43
lines changed

17 files changed

+2377
-43
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
### Features
1212

13+
- [`e8064cd`](https://github.com/stdlib-js/stdlib/commit/e8064cdc716fc9381a143620ef291722dba49228) - add `ndarray/vector/float32`
1314
- [`b2cefbe`](https://github.com/stdlib-js/stdlib/commit/b2cefbe2b2192cb705b85c43ffac2f57ca782c42) - add custom `valueOf` method
1415
- [`848f226`](https://github.com/stdlib-js/stdlib/commit/848f226d45aad2d627453c8306ae192c75338ac3) - add `factory` method
1516
- [`916b907`](https://github.com/stdlib-js/stdlib/commit/916b9073d6cf82262233e835f9bbbaca26d685f0) - add `ndarray/vector/ctor`
@@ -391,6 +392,13 @@ A total of 15 issues were closed in this release:
391392

392393
<details>
393394

395+
- [`e8064cd`](https://github.com/stdlib-js/stdlib/commit/e8064cdc716fc9381a143620ef291722dba49228) - **feat:** add `ndarray/vector/float32` _(by Athan Reines)_
396+
- [`fbc6b85`](https://github.com/stdlib-js/stdlib/commit/fbc6b852fae5eb77c36e04208c4aad574d146459) - **docs:** fix comments _(by Athan Reines)_
397+
- [`5471fc4`](https://github.com/stdlib-js/stdlib/commit/5471fc4ca1505d407bc2f0cb13cea076c73341c5) - **docs:** fix descriptions _(by Athan Reines)_
398+
- [`7f4b555`](https://github.com/stdlib-js/stdlib/commit/7f4b555601081338bacc307c2a752ba9cd69107e) - **chore:** fix copyright year _(by Athan Reines)_
399+
- [`6ce1c71`](https://github.com/stdlib-js/stdlib/commit/6ce1c716ea44aded1b140b1a897fd866774b22d8) - **docs:** update examples _(by Athan Reines)_
400+
- [`384bc19`](https://github.com/stdlib-js/stdlib/commit/384bc19cdc6d91ddd4af97c2b1e5a4a0dac2b112) - **docs:** update examples _(by Athan Reines)_
401+
- [`aa0af9e`](https://github.com/stdlib-js/stdlib/commit/aa0af9ec8401bad45f0dcafaeea4b38fd0f60e16) - **chore:** add TODO _(by Athan Reines)_
394402
- [`30e2005`](https://github.com/stdlib-js/stdlib/commit/30e2005330c027b33d1386afacdacc50b3a46c77) - **test:** add tests _(by Athan Reines)_
395403
- [`63756c5`](https://github.com/stdlib-js/stdlib/commit/63756c5110a952dc6f7d874badb99f125312902a) - **test:** add tests _(by Athan Reines)_
396404
- [`01544ae`](https://github.com/stdlib-js/stdlib/commit/01544aef20deb6e2b8c6826462cd29916ce3e45b) - **test:** add tests _(by Athan Reines)_

vector/ctor/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@license Apache-2.0
44
5-
Copyright (c) 2024 The Stdlib Authors.
5+
Copyright (c) 2025 The Stdlib Authors.
66
77
Licensed under the Apache License, Version 2.0 (the "License");
88
you may not use this file except in compliance with the License.

vector/ctor/docs/types/index.d.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ interface GenericVector {
7676
/**
7777
* Creates a vector (i.e., a one-dimensional ndarray).
7878
*
79-
* @param obj - array-like object or iterable from which to generate a typed array
79+
* @param obj - array-like object or iterable from which to generate a vector
8080
* @param options - function options
8181
* @param options.readonly - boolean indicating whether to return a read-only vector
8282
* @param options.mode - specifies how to handle indices which exceed vector dimensions
@@ -116,7 +116,7 @@ interface TypedVector<T extends keyof TypedDataTypeMap> {
116116
/**
117117
* Creates a vector (i.e., a one-dimensional ndarray).
118118
*
119-
* @param obj - array-like object or iterable from which to generate a typed array
119+
* @param obj - array-like object or iterable from which to generate a vector
120120
* @param options - function options
121121
* @param options.readonly - boolean indicating whether to return a read-only vector
122122
* @param options.mode - specifies how to handle indices which exceed vector dimensions
@@ -141,7 +141,7 @@ interface TypedVector<T extends keyof TypedDataTypeMap> {
141141
* Creates a vector (i.e., a one-dimensional ndarray).
142142
*
143143
* @param buffer - underlying ArrayBuffer
144-
* @param byteOffset - integer byte offset specifying the location of the first typed array element
144+
* @param byteOffset - integer byte offset specifying the location of the first vector element
145145
* @param options - function options
146146
* @param options.readonly - boolean indicating whether to return a read-only vector
147147
* @param options.mode - specifies how to handle indices which exceed vector dimensions
@@ -154,7 +154,7 @@ interface TypedVector<T extends keyof TypedDataTypeMap> {
154154
* Creates a vector (i.e., a one-dimensional ndarray).
155155
*
156156
* @param buffer - underlying ArrayBuffer
157-
* @param byteOffset - integer byte offset specifying the location of the first typed array element
157+
* @param byteOffset - integer byte offset specifying the location of the first vector element
158158
* @param length - view length; if not provided, the view spans from the byteOffset to the end of the underlying ArrayBuffer
159159
* @param options - function options
160160
* @param options.readonly - boolean indicating whether to return a read-only vector
@@ -324,7 +324,7 @@ interface Vector {
324324
/**
325325
* Creates a vector (i.e., a one-dimensional ndarray).
326326
*
327-
* @param obj - array-like object or iterable from which to generate a typed array
327+
* @param obj - array-like object or iterable from which to generate a vector
328328
* @param dtype - data type (default: 'float64')
329329
* @param options - function options
330330
* @param options.readonly - boolean indicating whether to return a read-only vector
@@ -376,7 +376,7 @@ interface Vector {
376376
/**
377377
* Creates a vector (i.e., a one-dimensional ndarray).
378378
*
379-
* @param obj - array-like object or iterable from which to generate a typed array
379+
* @param obj - array-like object or iterable from which to generate a vector
380380
* @param options - function options
381381
* @param options.readonly - boolean indicating whether to return a read-only vector
382382
* @param options.mode - specifies how to handle indices which exceed vector dimensions
@@ -487,7 +487,7 @@ interface Vector {
487487
* Creates a vector (i.e., a one-dimensional ndarray).
488488
*
489489
* @param buffer - underlying ArrayBuffer
490-
* @param byteOffset - integer byte offset specifying the location of the first typed array element (default: 0)
490+
* @param byteOffset - integer byte offset specifying the location of the first vector element (default: 0)
491491
* @param dtype - data type (default: 'float64')
492492
* @param options - function options
493493
* @param options.readonly - boolean indicating whether to return a read-only vector
@@ -546,7 +546,7 @@ interface Vector {
546546
* Creates a vector (i.e., a one-dimensional ndarray).
547547
*
548548
* @param buffer - underlying ArrayBuffer
549-
* @param byteOffset - integer byte offset specifying the location of the first typed array element
549+
* @param byteOffset - integer byte offset specifying the location of the first vector element
550550
* @param options - function options
551551
* @param options.readonly - boolean indicating whether to return a read-only vector
552552
* @param options.mode - specifies how to handle indices which exceed vector dimensions
@@ -589,7 +589,7 @@ interface Vector {
589589
* Creates a vector (i.e., a one-dimensional ndarray).
590590
*
591591
* @param buffer - underlying ArrayBuffer
592-
* @param byteOffset - integer byte offset specifying the location of the first typed array element (default: 0)
592+
* @param byteOffset - integer byte offset specifying the location of the first vector element (default: 0)
593593
* @param length - view length; if not provided, the view spans from the byteOffset to the end of the underlying ArrayBuffer
594594
* @param dtype - data type (default: 'float64')
595595
* @param options - function options
@@ -647,7 +647,7 @@ interface Vector {
647647
* Creates a vector (i.e., a one-dimensional ndarray).
648648
*
649649
* @param buffer - underlying ArrayBuffer
650-
* @param byteOffset - integer byte offset specifying the location of the first typed array element
650+
* @param byteOffset - integer byte offset specifying the location of the first vector element
651651
* @param length - view length; if not provided, the view spans from the byteOffset to the end of the underlying ArrayBuffer
652652
* @param options - function options
653653
* @param options.readonly - boolean indicating whether to return a read-only vector
@@ -812,7 +812,7 @@ interface Vector {
812812
* Creates a vector (i.e., a one-dimensional ndarray).
813813
*
814814
* @param arg - length, typed array, array-like object, buffer, or iterable
815-
* @param byteOffset - integer byte offset specifying the location of the first typed array element (default: 0)
815+
* @param byteOffset - integer byte offset specifying the location of the first vector element (default: 0)
816816
* @param length - view length; if not provided, the view spans from the byteOffset to the end of the underlying ArrayBuffer
817817
* @param dtype - data type (default: 'float64')
818818
* @param options - function options

vector/ctor/docs/types/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ import vector = require( './index' );
6161
vector( new ArrayBuffer( 10 ), 8, 0, 'float32', {} ); // $ExpectType float32ndarray
6262
}
6363

64-
// The compiler throws an error if the function is provided a first argument which is not a data type, number, array-like object, iterable, or options objects...
64+
// The compiler throws an error if the function is provided a first argument which is not a data type, number, array-like object, iterable, or options object...
6565
{
6666
vector( true ); // $ExpectError
6767
vector( false ); // $ExpectError
@@ -135,7 +135,7 @@ import vector = require( './index' );
135135
f3( [ 1, 2, 3 ], {} ); // $ExpectType genericndarray<number>
136136
}
137137

138-
// The compiler throws an error if the function returned by the `factory` method is provided a first argument which is not a data type, number, array-like object, iterable, or options objects...
138+
// The compiler throws an error if the function returned by the `factory` method is provided a first argument which is not a data type, number, array-like object, iterable, or options object...
139139
{
140140
const f = vector.factory( 'float64' );
141141

vector/ctor/lib/index.js

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,93 +24,107 @@
2424
* @module @stdlib/ndarray/vector/ctor
2525
*
2626
* @example
27-
* var Vector = require( '@stdlib/ndarray/vector/ctor' );
27+
* var getDType = require( '@stdlib/ndarray/dtype' );
28+
* var numel = require( '@stdlib/ndarray/numel' );
29+
* var vector = require( '@stdlib/ndarray/vector/ctor' );
2830
*
29-
* var v = new Vector();
31+
* var v = vector();
3032
* // returns <ndarray>
3133
*
32-
* var len = v.length;
34+
* var len = numel( v );
3335
* // returns 0
3436
*
35-
* var dt = v.dtype;
37+
* var dt = getDType( v );
3638
* // returns 'float64'
3739
*
3840
* @example
39-
* var Vector = require( '@stdlib/ndarray/vector/ctor' );
41+
* var getDType = require( '@stdlib/ndarray/dtype' );
42+
* var numel = require( '@stdlib/ndarray/numel' );
43+
* var vector = require( '@stdlib/ndarray/vector/ctor' );
4044
*
41-
* var v = new Vector( 2 );
45+
* var v = vector( 2 );
4246
* // returns <ndarray>
4347
*
44-
* var len = v.length;
48+
* var len = numel( v );
4549
* // returns 2
4650
*
47-
* var dt = v.dtype;
51+
* var dt = getDType( v );
4852
* // returns 'float64'
4953
*
5054
* @example
51-
* var Vector = require( '@stdlib/ndarray/vector/ctor' );
55+
* var getDType = require( '@stdlib/ndarray/dtype' );
56+
* var numel = require( '@stdlib/ndarray/numel' );
57+
* var vector = require( '@stdlib/ndarray/vector/ctor' );
5258
*
53-
* var v = new Vector( [ 1.0, 2.0 ] );
59+
* var v = vector( [ 1.0, 2.0 ] );
5460
* // returns <ndarray>
5561
*
56-
* var len = v.length;
62+
* var len = numel( v );
5763
* // returns 2
5864
*
59-
* var dt = v.dtype;
65+
* var dt = getDType( v );
6066
* // returns 'float64'
6167
*
6268
* @example
63-
* var Vector = require( '@stdlib/ndarray/vector/ctor' );
69+
* var getDType = require( '@stdlib/ndarray/dtype' );
70+
* var numel = require( '@stdlib/ndarray/numel' );
71+
* var vector = require( '@stdlib/ndarray/vector/ctor' );
6472
*
65-
* var v = new Vector( [ 1.0, 2.0 ], 'float32' );
73+
* var v = vector( [ 1.0, 2.0 ], 'float32' );
6674
* // returns <ndarray>
6775
*
68-
* var len = v.length;
76+
* var len = numel( v );
6977
* // returns 2
7078
*
71-
* var dt = v.dtype;
79+
* var dt = getDType( v );
7280
* // returns 'float32'
7381
*
7482
* @example
7583
* var ArrayBuffer = require( '@stdlib/array/buffer' );
76-
* var Vector = require( '@stdlib/ndarray/vector/ctor' );
84+
* var getDType = require( '@stdlib/ndarray/dtype' );
85+
* var numel = require( '@stdlib/ndarray/numel' );
86+
* var vector = require( '@stdlib/ndarray/vector/ctor' );
7787
*
7888
* var buf = new ArrayBuffer( 32 );
79-
* var v = new Vector( buf );
89+
* var v = vector( buf );
8090
* // returns <ndarray>
8191
*
82-
* var len = v.length;
92+
* var len = numel( v );
8393
* // returns 4
8494
*
85-
* var dt = v.dtype;
95+
* var dt = getDType( v );
8696
* // returns 'float64'
8797
*
8898
* @example
8999
* var ArrayBuffer = require( '@stdlib/array/buffer' );
90-
* var Vector = require( '@stdlib/ndarray/vector/ctor' );
100+
* var getDType = require( '@stdlib/ndarray/dtype' );
101+
* var numel = require( '@stdlib/ndarray/numel' );
102+
* var vector = require( '@stdlib/ndarray/vector/ctor' );
91103
*
92104
* var buf = new ArrayBuffer( 32 );
93-
* var v = new Vector( buf, 16 );
105+
* var v = vector( buf, 16 );
94106
* // returns <ndarray>
95107
*
96-
* var len = v.length;
108+
* var len = numel( v );
97109
* // returns 2
98110
*
99-
* var dt = v.dtype;
111+
* var dt = getDType( v );
100112
* // returns 'float64'
101113
*
102114
* @example
103115
* var ArrayBuffer = require( '@stdlib/array/buffer' );
104-
* var Vector = require( '@stdlib/ndarray/vector/ctor' );
116+
* var getDType = require( '@stdlib/ndarray/dtype' );
117+
* var numel = require( '@stdlib/ndarray/numel' );
118+
* var vector = require( '@stdlib/ndarray/vector/ctor' );
105119
*
106120
* var buf = new ArrayBuffer( 64 );
107-
* var v = new Vector( buf, 16, 2 );
121+
* var v = vector( buf, 16, 2 );
108122
* // returns <ndarray>
109123
*
110-
* var len = v.length;
124+
* var len = numel( v );
111125
* // returns 2
112126
*
113-
* var dt = v.dtype;
127+
* var dt = getDType( v );
114128
* // returns 'float64'
115129
*/
116130

vector/ctor/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function resolveOrder( options ) {
149149
* var len = numel( v );
150150
* // returns 2
151151
*/
152-
function arraybuffer2vector( dtype, buffer, length, stride, byteOffset, order, options ) {
152+
function arraybuffer2vector( dtype, buffer, length, stride, byteOffset, order, options ) { // TODO: consider moving to `@stdlib/ndarray/from-arraybuffer` and generalize to n-dimensions such that `length` becomes `shape` and `stride` becomes `strides`
153153
var buf;
154154
var sh;
155155
var st;

0 commit comments

Comments
 (0)