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 Nov 23, 2023
1 parent f3fcd29 commit dcb2555
Show file tree
Hide file tree
Showing 45 changed files with 1,277 additions and 37 deletions.
3 changes: 2 additions & 1 deletion base/binary2d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { Shape2D } from '@stdlib/types/ndarray';
/**
* Binary callback.
*
* @param value - input value
* @param v1 - element from first input array
* @param v2 - element from second input array
* @returns result
*/
type Binary<T, U, V> = ( v1: T, v2: U ) => V;
Expand Down
3 changes: 2 additions & 1 deletion base/binary3d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { Shape3D } from '@stdlib/types/ndarray';
/**
* Binary callback.
*
* @param value - input value
* @param v1 - element from first input array
* @param v2 - element from second input array
* @returns result
*/
type Binary<T, U, V> = ( v1: T, v2: U ) => V;
Expand Down
3 changes: 2 additions & 1 deletion base/binary4d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { Shape4D } from '@stdlib/types/ndarray';
/**
* Binary callback.
*
* @param value - input value
* @param v1 - element from first input array
* @param v2 - element from second input array
* @returns result
*/
type Binary<T, U, V> = ( v1: T, v2: U ) => V;
Expand Down
3 changes: 2 additions & 1 deletion base/binary5d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { Shape5D } from '@stdlib/types/ndarray';
/**
* Binary callback.
*
* @param value - input value
* @param v1 - element from first input array
* @param v2 - element from second input array
* @returns result
*/
type Binary<T, U, V> = ( v1: T, v2: U ) => V;
Expand Down
3 changes: 2 additions & 1 deletion base/binarynd/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { Shape, Shape1D, Shape2D, Shape3D, Shape4D, Shape5D, Shape6D, Shape7D, S
/**
* Binary callback.
*
* @param value - input value
* @param v1 - element from first input array
* @param v2 - element from second input array
* @returns result
*/
type Binary<T, U, V> = ( v1: T, v2: U ) => V;
Expand Down
3 changes: 2 additions & 1 deletion base/broadcasted-binary2d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { Shape1D, Shape2D } from '@stdlib/types/ndarray';
/**
* Binary callback.
*
* @param value - input value
* @param v1 - element from first input array
* @param v2 - element from second input array
* @returns result
*/
type Binary<T, U, V> = ( v1: T, v2: U ) => V;
Expand Down
3 changes: 2 additions & 1 deletion base/broadcasted-binary3d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { Shape1D, Shape2D, Shape3D } from '@stdlib/types/ndarray';
/**
* Binary callback.
*
* @param value - input value
* @param v1 - element from first input array
* @param v2 - element from second input array
* @returns result
*/
type Binary<T, U, V> = ( v1: T, v2: U ) => V;
Expand Down
3 changes: 2 additions & 1 deletion base/broadcasted-binary4d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { Shape1D, Shape2D, Shape3D, Shape4D } from '@stdlib/types/ndarray';
/**
* Binary callback.
*
* @param value - input value
* @param v1 - element from first input array
* @param v2 - element from second input array
* @returns result
*/
type Binary<T, U, V> = ( v1: T, v2: U ) => V;
Expand Down
3 changes: 2 additions & 1 deletion base/broadcasted-binary5d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { Shape1D, Shape2D, Shape3D, Shape4D, Shape5D } from '@stdlib/types/ndarr
/**
* Binary callback.
*
* @param value - input value
* @param v1 - element from first input array
* @param v2 - element from second input array
* @returns result
*/
type Binary<T, U, V> = ( v1: T, v2: U ) => V;
Expand Down
5 changes: 4 additions & 1 deletion base/broadcasted-quaternary2d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ import { Shape1D, Shape2D } from '@stdlib/types/ndarray';
/**
* Quaternary callback.
*
* @param value - input value
* @param v1 - element from first input array
* @param v2 - element from second input array
* @param v3 - element from third input array
* @param v4 - element from fourth input array
* @returns result
*/
type Quaternary<T, U, V, W, X> = ( v1: T, v2: U, v3: V, v4: W ) => X;
Expand Down
6 changes: 5 additions & 1 deletion base/broadcasted-quinary2d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ import { Shape1D, Shape2D } from '@stdlib/types/ndarray';
/**
* Quinary callback.
*
* @param value - input value
* @param v1 - element from first input array
* @param v2 - element from second input array
* @param v3 - element from third input array
* @param v4 - element from fourth input array
* @param v5 - element from fifth input array
* @returns result
*/
type Quinary<T, U, V, W, X, Y> = ( v1: T, v2: U, v3: V, v4: W, v5: X ) => Y;
Expand Down
4 changes: 3 additions & 1 deletion base/broadcasted-ternary2d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ import { Shape1D, Shape2D } from '@stdlib/types/ndarray';
/**
* Ternary callback.
*
* @param value - input value
* @param v1 - element from first input array
* @param v2 - element from second input array
* @param v3 - element from third input array
* @returns result
*/
type Ternary<T, U, V, W> = ( v1: T, v2: U, v3: V ) => W;
Expand Down
2 changes: 1 addition & 1 deletion base/broadcasted-unary2d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { Shape1D, Shape2D } from '@stdlib/types/ndarray';
/**
* Unary callback.
*
* @param value - input value
* @param value - array element
* @returns result
*/
type Unary<T, U> = ( value: T ) => U;
Expand Down
2 changes: 1 addition & 1 deletion base/broadcasted-unary3d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { Shape1D, Shape2D, Shape3D } from '@stdlib/types/ndarray';
/**
* Unary callback.
*
* @param value - input value
* @param value - array element
* @returns result
*/
type Unary<T, U> = ( value: T ) => U;
Expand Down
2 changes: 1 addition & 1 deletion base/broadcasted-unary4d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { Shape1D, Shape2D, Shape3D, Shape4D } from '@stdlib/types/ndarray';
/**
* Unary callback.
*
* @param value - input value
* @param value - array element
* @returns result
*/
type Unary<T, U> = ( value: T ) => U;
Expand Down
2 changes: 1 addition & 1 deletion base/broadcasted-unary5d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { Shape1D, Shape2D, Shape3D, Shape4D, Shape5D } from '@stdlib/types/ndarr
/**
* Unary callback.
*
* @param value - input value
* @param value - array element
* @returns result
*/
type Unary<T, U> = ( value: T ) => U;
Expand Down
9 changes: 9 additions & 0 deletions base/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,15 @@ setReadOnly( ns, 'quaternary3d', require( './../../base/quaternary3d' ) );
*/
setReadOnly( ns, 'quaternary4d', require( './../../base/quaternary4d' ) );

/**
* @name quaternary5d
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/array/base/quaternary5d}
*/
setReadOnly( ns, 'quaternary5d', require( './../../base/quaternary5d' ) );

/**
* @name quinary2d
* @memberof ns
Expand Down
3 changes: 2 additions & 1 deletion base/mskbinary2d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { Shape2D } from '@stdlib/types/ndarray';
/**
* Binary callback.
*
* @param value - input value
* @param v1 - element from first input array
* @param v2 - element from second input array
* @returns result
*/
type Binary<T, U, V> = ( v1: T, v2: U ) => V;
Expand Down
2 changes: 1 addition & 1 deletion base/mskunary2d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { Shape2D } from '@stdlib/types/ndarray';
/**
* Unary callback.
*
* @param value - input value
* @param value - array element
* @returns result
*/
type Unary<T, U> = ( value: T ) => U;
Expand Down
2 changes: 1 addition & 1 deletion base/mskunary3d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { Shape3D } from '@stdlib/types/ndarray';
/**
* Unary callback.
*
* @param value - input value
* @param value - array element
* @returns result
*/
type Unary<T, U> = ( value: T ) => U;
Expand Down
5 changes: 4 additions & 1 deletion base/quaternary2d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ import { Shape2D } from '@stdlib/types/ndarray';
/**
* Quaternary callback.
*
* @param value - input value
* @param v1 - element from first input array
* @param v2 - element from second input array
* @param v3 - element from third input array
* @param v4 - element from fourth input array
* @returns result
*/
type Quaternary<T, U, V, W, X> = ( v1: T, v2: U, v3: V, v4: W ) => X;
Expand Down
5 changes: 4 additions & 1 deletion base/quaternary3d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ import { Shape3D } from '@stdlib/types/ndarray';
/**
* Quaternary callback.
*
* @param value - input value
* @param v1 - element from first input array
* @param v2 - element from second input array
* @param v3 - element from third input array
* @param v4 - element from fourth input array
* @returns result
*/
type Quaternary<T, U, V, W, X> = ( v1: T, v2: U, v3: V, v4: W ) => X;
Expand Down
5 changes: 4 additions & 1 deletion base/quaternary4d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ import { Shape4D } from '@stdlib/types/ndarray';
/**
* Quaternary callback.
*
* @param value - input value
* @param v1 - element from first input array
* @param v2 - element from second input array
* @param v3 - element from third input array
* @param v4 - element from fourth input array
* @returns result
*/
type Quaternary<T, U, V, W, X> = ( v1: T, v2: U, v3: V, v4: W ) => X;
Expand Down
128 changes: 128 additions & 0 deletions base/quaternary5d/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<!--
@license Apache-2.0
Copyright (c) 2023 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.
-->

# quaternary5d

> Apply a quaternary callback to elements in four five-dimensional nested input arrays and assign results to elements in a five-dimensional nested output array.
<section class="intro">

</section>

<!-- /.intro -->

<section class="usage">

## Usage

```javascript
var quaternary5d = require( '@stdlib/array/base/quaternary5d' );
```

#### quaternary5d( arrays, shape, fcn )

Applies a quaternary callback to elements in four five-dimensional nested input arrays and assigns results to elements in a five-dimensional nested output array.

```javascript
var add = require( '@stdlib/math/base/ops/add4' );
var zeros5d = require( '@stdlib/array/base/zeros5d' );

var x = [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ];
var out = zeros5d( [ 1, 1, 1, 2, 2 ] );

var shape = [ 1, 1, 1, 2, 2 ];

quaternary5d( [ x, x, x, x, out ], shape, add );
// out => [ [ [ [ [ 4.0, 8.0 ], [ 12.0, 16.0 ] ] ] ] ]
```

The function accepts the following arguments:

- **arrays**: array-like object containing four input nested arrays and one output nested array.
- **shape**: array shape.
- **fcn**: quaternary function to apply.

</section>

<!-- /.usage -->

<section class="notes">

## Notes

- The function assumes that the input and output arrays have the same shape.

</section>

<!-- /.notes -->

<section class="examples">

## Examples

<!-- eslint no-undef: "error" -->

```javascript
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory;
var filled5dBy = require( '@stdlib/array/base/filled5d-by' );
var zeros5d = require( '@stdlib/array/base/zeros5d' );
var add = require( '@stdlib/math/base/ops/add4' );
var quaternary5d = require( '@stdlib/array/base/quaternary5d' );

var shape = [ 1, 1, 3, 3, 3 ];

var x = filled5dBy( shape, discreteUniform( -100, 100 ) );
console.log( x );

var y = filled5dBy( shape, discreteUniform( -100, 100 ) );
console.log( y );

var z = filled5dBy( shape, discreteUniform( -100, 100 ) );
console.log( z );

var w = filled5dBy( shape, discreteUniform( -100, 100 ) );
console.log( w );

var out = zeros5d( shape );
console.log( out );

quaternary5d( [ x, y, z, w, out ], shape, add );
console.log( out );
```

</section>

<!-- /.examples -->

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

<section class="related">

</section>

<!-- /.related -->

<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="links">

</section>

<!-- /.links -->
Loading

0 comments on commit dcb2555

Please sign in to comment.