From 9181fa849eeadec6298b98ca6e2ed087edeb7674 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Tue, 31 Oct 2023 05:59:18 +0000 Subject: [PATCH] Auto-generated commit --- base/docs/types/index.d.ts | 73 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/base/docs/types/index.d.ts b/base/docs/types/index.d.ts index ec2cca25..b7d8aa4f 100644 --- a/base/docs/types/index.d.ts +++ b/base/docs/types/index.d.ts @@ -37,6 +37,7 @@ import bbinary2d = require( './../../../base/broadcasted-binary2d' ); import bbinary3d = require( './../../../base/broadcasted-binary3d' ); import bbinary4d = require( './../../../base/broadcasted-binary4d' ); import bbinary5d = require( './../../../base/broadcasted-binary5d' ); +import bternary2d = require( './../../../base/broadcasted-ternary2d' ); import bunary2d = require( './../../../base/broadcasted-unary2d' ); import bunary3d = require( './../../../base/broadcasted-unary3d' ); import bunary4d = require( './../../../base/broadcasted-unary4d' ); @@ -86,6 +87,7 @@ import ones5d = require( './../../../base/ones5d' ); import onesnd = require( './../../../base/onesnd' ); import setter = require( './../../../base/setter' ); import take = require( './../../../base/take' ); +import ternary2d = require( './../../../base/ternary2d' ); import toAccessorArray = require( './../../../base/to-accessor-array' ); import unary2d = require( './../../../base/unary2d' ); import unary2dBy = require( './../../../base/unary2d-by' ); @@ -583,6 +585,44 @@ interface Namespace { */ bbinary5d: typeof bbinary5d; + /** + * Applies a ternary callback to elements in three broadcasted input arrays and assigns results to elements in a two-dimensional nested output array. + * + * ## Notes + * + * - The input array shapes must be broadcast compatible with the output array shape. + * + * @param arrays - array containing three input nested arrays and one output nested array + * @param shapes - array shapes + * @param fcn - ternary callback + * + * @example + * var ones2d = require( `@stdlib/array/base/ones2d` ); + * var zeros2d = require( `@stdlib/array/base/zeros2d` ); + * + * function add( x, y, z ) { + * return x + y + z; + * } + * + * var shapes = [ + * [ 1, 2 ], + * [ 2, 1 ], + * [ 1, 1 ], + * [ 2, 2 ] + * ]; + * + * var x = ones2d( shapes[ 0 ] ); + * var y = ones2d( shapes[ 1 ] ); + * var z = ones2d( shapes[ 2 ] ); + * var out = zeros2d( shapes[ 3 ] ); + * + * ns.bternary2d( [ x, y, z, out ], shapes, add ); + * + * console.log( out ); + * // => [ [ 3.0, 6.0 ], [ 9.0, 12.0 ] ] + */ + bternary2d: typeof bternary2d; + /** * Applies a unary callback to elements in a broadcasted nested input array and assigns results to elements in a two-dimensional nested output array. * @@ -1627,6 +1667,39 @@ interface Namespace { */ take: typeof take; + /** + * Applies a ternary callback to elements in three two-dimensional nested input arrays and assigns results to elements in a two-dimensional nested output array. + * + * ## Notes + * + * - The function assumes that the input and output arrays have the same shape. + * + * @param arrays - array containing three input nested arrays and one output nested array + * @param shape - array shape + * @param fcn - ternary callback + * + * @example + * var ones2d = require( `@stdlib/array/base/ones2d` ); + * var zeros2d = require( `@stdlib/array/base/zeros2d` ); + * + * function add( x, y, z ) { + * return x + y + z; + * } + * + * var shape = [ 2, 2 ]; + * + * var x = ones2d( shape ); + * var y = ones2d( shape ); + * var z = ones2d( shape ); + * var out = zeros2d( shape ); + * + * ns.ternary2d( [ x, y, z, out ], shape, add ); + * + * console.log( out ); + * // => [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] + */ + ternary2d: typeof ternary2d; + /** * Converts an array-like object to a minimal array-like object supporting the accessor protocol. *