Skip to content

Commit 949c89a

Browse files
committed
docs: add docs for accessor arrays
--- 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: na - 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: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent 022fc9b commit 949c89a

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

lib/node_modules/@stdlib/stats/base/min/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ var v = min.ndarray( 4, x, 2, 1 );
109109
## Notes
110110

111111
- If `N <= 0`, both functions return `NaN`.
112+
- Both functions support array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/base/accessor`][@stdlib/array/base/accessor]).
112113
- Depending on the environment, the typed versions ([`dmin`][@stdlib/stats/base/dmin], [`smin`][@stdlib/stats/base/smin], etc.) are likely to be significantly more performant.
113114

114115
</section>
@@ -163,6 +164,8 @@ console.log( v );
163164

164165
[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
165166

167+
[@stdlib/array/base/accessor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/accessor
168+
166169
[@stdlib/stats/base/dmin]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/dmin
167170

168171
[@stdlib/stats/base/smin]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/smin

lib/node_modules/@stdlib/stats/base/min/docs/types/index.d.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { NumericArray } from '@stdlib/types/array';
23+
import { NumericArray, Collection, AccessorArrayLike } from '@stdlib/types/array';
24+
25+
/**
26+
* Input array.
27+
*/
28+
type InputArray = NumericArray | Collection<number> | AccessorArrayLike<number>;
2429

2530
/**
2631
* Interface describing `min`.
@@ -40,7 +45,7 @@ interface Routine {
4045
* var v = min( x.length, x, 1 );
4146
* // returns -2.0
4247
*/
43-
( N: number, x: NumericArray, strideX: number ): number;
48+
( N: number, x: InputArray, strideX: number ): number;
4449

4550
/**
4651
* Computes the minimum value of a strided array using alternative indexing semantics.
@@ -57,7 +62,7 @@ interface Routine {
5762
* var v = min.ndarray( x.length, x, 1, 0 );
5863
* // returns -2.0
5964
*/
60-
ndarray( N: number, x: NumericArray, strideX: number, offsetX: number ): number;
65+
ndarray( N: number, x: InputArray, strideX: number, offsetX: number ): number;
6166
}
6267

6368
/**

lib/node_modules/@stdlib/stats/base/min/docs/types/test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* limitations under the License.
1717
*/
1818

19+
import AccessorArray = require( '@stdlib/array/base/accessor' );
1920
import min = require( './index' );
2021

2122

@@ -26,6 +27,7 @@ import min = require( './index' );
2627
const x = new Float64Array( 10 );
2728

2829
min( x.length, x, 1 ); // $ExpectType number
30+
min( x.length, new AccessorArray( x ), 1 ); // $ExpectType number
2931
}
3032

3133
// The compiler throws an error if the function is provided a first argument which is not a number...
@@ -85,6 +87,7 @@ import min = require( './index' );
8587
const x = new Float64Array( 10 );
8688

8789
min.ndarray( x.length, x, 1, 0 ); // $ExpectType number
90+
min.ndarray( x.length, new AccessorArray( x ), 1, 0 ); // $ExpectType number
8891
}
8992

9093
// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...

0 commit comments

Comments
 (0)