You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Applies a ternary callback to elements in three broadcasted input arrays and assigns results to elements in a two-dimensional nested output array.
590
+
*
591
+
* ## Notes
592
+
*
593
+
* - The input array shapes must be broadcast compatible with the output array shape.
594
+
*
595
+
* @param arrays - array containing three input nested arrays and one output nested array
596
+
* @param shapes - array shapes
597
+
* @param fcn - ternary callback
598
+
*
599
+
* @example
600
+
* var ones2d = require( `@stdlib/array/base/ones2d` );
601
+
* var zeros2d = require( `@stdlib/array/base/zeros2d` );
602
+
*
603
+
* function add( x, y, z ) {
604
+
* return x + y + z;
605
+
* }
606
+
*
607
+
* var shapes = [
608
+
* [ 1, 2 ],
609
+
* [ 2, 1 ],
610
+
* [ 1, 1 ],
611
+
* [ 2, 2 ]
612
+
* ];
613
+
*
614
+
* var x = ones2d( shapes[ 0 ] );
615
+
* var y = ones2d( shapes[ 1 ] );
616
+
* var z = ones2d( shapes[ 2 ] );
617
+
* var out = zeros2d( shapes[ 3 ] );
618
+
*
619
+
* ns.bternary2d( [ x, y, z, out ], shapes, add );
620
+
*
621
+
* console.log( out );
622
+
* // => [ [ 3.0, 6.0 ], [ 9.0, 12.0 ] ]
623
+
*/
624
+
bternary2d: typeofbternary2d;
625
+
586
626
/**
587
627
* Applies a unary callback to elements in a broadcasted nested input array and assigns results to elements in a two-dimensional nested output array.
588
628
*
@@ -1627,6 +1667,39 @@ interface Namespace {
1627
1667
*/
1628
1668
take: typeoftake;
1629
1669
1670
+
/**
1671
+
* 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.
1672
+
*
1673
+
* ## Notes
1674
+
*
1675
+
* - The function assumes that the input and output arrays have the same shape.
1676
+
*
1677
+
* @param arrays - array containing three input nested arrays and one output nested array
1678
+
* @param shape - array shape
1679
+
* @param fcn - ternary callback
1680
+
*
1681
+
* @example
1682
+
* var ones2d = require( `@stdlib/array/base/ones2d` );
1683
+
* var zeros2d = require( `@stdlib/array/base/zeros2d` );
1684
+
*
1685
+
* function add( x, y, z ) {
1686
+
* return x + y + z;
1687
+
* }
1688
+
*
1689
+
* var shape = [ 2, 2 ];
1690
+
*
1691
+
* var x = ones2d( shape );
1692
+
* var y = ones2d( shape );
1693
+
* var z = ones2d( shape );
1694
+
* var out = zeros2d( shape );
1695
+
*
1696
+
* ns.ternary2d( [ x, y, z, out ], shape, add );
1697
+
*
1698
+
* console.log( out );
1699
+
* // => [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ]
1700
+
*/
1701
+
ternary2d: typeofternary2d;
1702
+
1630
1703
/**
1631
1704
* Converts an array-like object to a minimal array-like object supporting the accessor protocol.
* Returns a boolean indicating if a provided ndarray data type can be safely cast or, for floating-point data types, downcast to another ndarray data type.
441
+
*
442
+
* @param from - ndarray data type
443
+
* @param to - ndarray data type
444
+
* @returns boolean indicating if a data type can be cast to another data type
445
+
*
446
+
* @example
447
+
* var bool = ns.isMostlySafeDataTypeCast( 'float32', 'float64' );
0 commit comments