Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Jun 29, 2024
1 parent 2b15994 commit dc681a3
Show file tree
Hide file tree
Showing 13 changed files with 474 additions and 66 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ jobs:
# Replace branch in README.md link definitions for badges with the new version:
find . -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/branch([=:])[^ ]+/branch\1v${NEW_VERSION}/g"
# Rewrite CHANGELOG.md to replace "Unreleased" with the new version:
sed -Ei "s/Unreleased/${NEW_VERSION}/g" CHANGELOG.md
sed -Ei "s/unreleased/v${NEW_VERSION}/g" CHANGELOG.md
# Create a new commit and tag:
git add package.json README.md
git commit -m "Release v${NEW_VERSION}"
Expand Down
123 changes: 122 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,125 @@

> Package changelog.
See [GitHub Releases](https://github.com/stdlib-js/array-filled/releases) for the changelog.
<section class="release" id="unreleased">

## Unreleased (2024-06-29)

<section class="features">

### Features

- [`8a55ea2`](https://github.com/stdlib-js/stdlib/commit/8a55ea29ae7cc04e9ebef428ee90900641bbabe1) - add boolean dtype support to `array/filled` [(#2471)](https://github.com/stdlib-js/stdlib/pull/2471)

</section>

<!-- /.features -->

<section class="commits">

### Commits

<details>

- [`8a55ea2`](https://github.com/stdlib-js/stdlib/commit/8a55ea29ae7cc04e9ebef428ee90900641bbabe1) - **feat:** add boolean dtype support to `array/filled` [(#2471)](https://github.com/stdlib-js/stdlib/pull/2471) _(by Jaysukh Makvana, Athan Reines)_
- [`75d4f83`](https://github.com/stdlib-js/stdlib/commit/75d4f83cb85610d23a04dc21a03f8075f6d3665f) - **refactor:** update require and include paths _(by Athan Reines)_

</details>

</section>

<!-- /.commits -->

<section class="contributors">

### Contributors

A total of 2 people contributed to this release. Thank you to the following contributors:

- Athan Reines
- Jaysukh Makvana

</section>

<!-- /.contributors -->

</section>

<!-- /.release -->

<section class="release" id="v0.2.1">

## 0.2.1 (2024-02-25)

<section class="features">

### Features

- [`819d2e4`](https://github.com/stdlib-js/stdlib/commit/819d2e407146d4dcc17f8bab53b591b3d573f8a1) - add data type maps and replace use of overloads [(#1317)](https://github.com/stdlib-js/stdlib/pull/1317)
- [`e29732d`](https://github.com/stdlib-js/stdlib/commit/e29732dee616e2d94e91f87f78afd8aceb806017) - update minimum TypeScript version

</section>

<!-- /.features -->

<section class="bug-fixes">

### Bug Fixes

- [`14bacb3`](https://github.com/stdlib-js/stdlib/commit/14bacb3cbfced427bcbadae7cbc649a62bb62b69) - update import path for `Collection` type definition

</section>

<!-- /.bug-fixes -->

<section class="breaking-changes">

### BREAKING CHANGES

- [`e29732d`](https://github.com/stdlib-js/stdlib/commit/e29732dee616e2d94e91f87f78afd8aceb806017): update minimum TypeScript version
- [`e29732d`](https://github.com/stdlib-js/stdlib/commit/e29732dee616e2d94e91f87f78afd8aceb806017): update minimum TypeScript version to 4.1

- To migrate, users should upgrade their TypeScript version to at least version 4.1.

</section>

<!-- /.breaking-changes -->

<section class="commits">

### Commits

<details>

- [`819d2e4`](https://github.com/stdlib-js/stdlib/commit/819d2e407146d4dcc17f8bab53b591b3d573f8a1) - **feat:** add data type maps and replace use of overloads [(#1317)](https://github.com/stdlib-js/stdlib/pull/1317) _(by Philipp Burckhardt, Athan Reines)_
- [`4d8b0d9`](https://github.com/stdlib-js/stdlib/commit/4d8b0d994a16840105f4453add42cca59de1392f) - **refactor:** query default dtype _(by Athan Reines)_
- [`dea49e0`](https://github.com/stdlib-js/stdlib/commit/dea49e03ab5571233e3da26835a6a6d3256d5737) - **docs:** use single quotes in require calls instead of backticks _(by Philipp Burckhardt)_
- [`e3fc2d4`](https://github.com/stdlib-js/stdlib/commit/e3fc2d48bf55690a3ead6cc37eed3472f34561c0) - **docs:** update links _(by Athan Reines)_
- [`3b59a50`](https://github.com/stdlib-js/stdlib/commit/3b59a503252cfe16765f84eab3bdb0ca06f6bb79) - **build:** remove vestiges of tslint directives _(by Philipp Burckhardt)_
- [`df3c9b3`](https://github.com/stdlib-js/stdlib/commit/df3c9b368d8a3dd7dd38f8768deb53c2a780c055) - **build:** remove tslint directives _(by Philipp Burckhardt)_
- [`e29732d`](https://github.com/stdlib-js/stdlib/commit/e29732dee616e2d94e91f87f78afd8aceb806017) - **feat:** update minimum TypeScript version _(by Philipp Burckhardt)_
- [`14bacb3`](https://github.com/stdlib-js/stdlib/commit/14bacb3cbfced427bcbadae7cbc649a62bb62b69) - **fix:** update import path for `Collection` type definition _(by Athan Reines)_

</details>

</section>

<!-- /.commits -->

<section class="contributors">

### Contributors

A total of 2 people contributed to this release. Thank you to the following contributors:

- Athan Reines
- Philipp Burckhardt

</section>

<!-- /.contributors -->

</section>

<!-- /.release -->

3 changes: 2 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Pushpendra Chandravanshi <[email protected]>
Raunak Kumar Gupta <[email protected]>
Rejoan Sardar <[email protected]>
Ricky Reusser <[email protected]>
Ridam Garg <[email protected]>
Robert Gislason <[email protected]>
Roman Stetsyk <[email protected]>
Rutam <[email protected]>
Expand All @@ -75,7 +76,7 @@ Shraddheya Shendre <[email protected]>
Shubh Mehta <[email protected]>
Shubham Mishra <[email protected]>
Sivam Das <[email protected]>
Snehil Shah <[email protected].com>
Snehil Shah <snehilshah.989@gmail.com>
Soumajit Chatterjee <[email protected]>
Spandan Barve <[email protected]>
Stephannie Jiménez Gacha <[email protected]>
Expand Down
25 changes: 6 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@license Apache-2.0
Copyright (c) 2020 The Stdlib Authors.
Copyright (c) 2024 The Stdlib Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -29,7 +29,7 @@ limitations under the License.
<p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
</details>

# Filled Array
# filledarray

[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->

Expand Down Expand Up @@ -75,29 +75,14 @@ var filledarray = require( '@stdlib/array-filled' );

#### filledarray( \[dtype] )

Creates a filled array having a specified data type `dtype`.
Creates a filled array having a specified [data type][@stdlib/array/dtypes] `dtype`.

```javascript
var arr = filledarray();
// returns <Float64Array>
```

The function recognizes the following data types:

- `float64`: double-precision floating-point numbers (IEEE 754)
- `float32`: single-precision floating-point numbers (IEEE 754)
- `complex128`: double-precision complex floating-point numbers
- `complex64`: single-precision complex floating-point numbers
- `int32`: 32-bit two's complement signed integers
- `uint32`: 32-bit unsigned integers
- `int16`: 16-bit two's complement signed integers
- `uint16`: 16-bit unsigned integers
- `int8`: 8-bit two's complement signed integers
- `uint8`: 8-bit unsigned integers
- `uint8c`: 8-bit unsigned integers clamped to `0-255`
- `generic`: generic JavaScript values

By default, the output array data type is `float64` (i.e., a [typed array][mdn-typed-array]). To specify an alternative data type, provide a `dtype` argument.
By default, the output array [data type][@stdlib/array/dtypes] is `float64` (i.e., a [typed array][mdn-typed-array]). To specify an alternative [data type][@stdlib/array/dtypes], provide a `dtype` argument.

```javascript
var arr = filledarray( 'int32' );
Expand Down Expand Up @@ -336,6 +321,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].

[mdn-arraybuffer]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer

[@stdlib/array/dtypes]: https://github.com/stdlib-js/array-dtypes

<!-- <related-links> -->

[@stdlib/array/filled-by]: https://github.com/stdlib-js/array-filled-by
Expand Down
18 changes: 18 additions & 0 deletions benchmark/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,24 @@ bench( pkg+':dtype=float32', function benchmark( b ) {
b.end();
});

bench( pkg+':dtype=bool', function benchmark( b ) {
var arr;
var i;
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr = filledarray( true, 0, 'bool' );
if ( arr.length !== 0 ) {
b.fail( 'should have length 0' );
}
}
b.toc();
if ( !isTypedArrayLike( arr ) ) {
b.fail( 'should return a typed array' );
}
b.pass( 'benchmark finished' );
b.end();
});

bench( pkg+':dtype=complex128', function benchmark( b ) {
var arr;
var v;
Expand Down
93 changes: 93 additions & 0 deletions benchmark/benchmark.length.bool.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2024 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var bench = require( '@stdlib/bench-harness' );
var pow = require( '@stdlib/math-base-special-pow' );
var isTypedArrayLike = require( '@stdlib/assert-is-typed-array-like' );
var pkg = require( './../package.json' ).name;
var filledarray = require( './../lib' );


// FUNCTIONS //

/**
* Creates a benchmark function.
*
* @private
* @param {PositiveInteger} len - array length
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
return benchmark;

/**
* Benchmark function.
*
* @private
* @param {Benchmark} b - benchmark instance
*/
function benchmark( b ) {
var arr;
var i;

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr = filledarray( true, len, 'bool' );
if ( arr.length !== len ) {
b.fail( 'unexpected length' );
}
}
b.toc();
if ( !isTypedArrayLike( arr ) ) {
b.fail( 'should return a typed array' );
}
b.pass( 'benchmark finished' );
b.end();
}
}


// MAIN //

/**
* Main execution sequence.
*
* @private
*/
function main() {
var len;
var min;
var max;
var f;
var i;

min = 1; // 10^min
max = 6; // 10^max

for ( i = min; i <= max; i++ ) {
len = pow( 10, i );
f = createBenchmark( len );
bench( pkg+':dtype=bool,len='+len, f );
}
}

main();
22 changes: 18 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dc681a3

Please sign in to comment.