File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
lib/node_modules/@stdlib/ndarray/base/docs/types Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ import fliplr = require( '@stdlib/ndarray/base/fliplr' );
5757import flipud = require( '@stdlib/ndarray/base/flipud' ) ;
5858import forEach = require( '@stdlib/ndarray/base/for-each' ) ;
5959import scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ) ;
60+ import scalar2ndarrayLike = require( '@stdlib/ndarray/base/from-scalar-like' ) ;
6061import ind = require( '@stdlib/ndarray/base/ind' ) ;
6162import ind2sub = require( '@stdlib/ndarray/base/ind2sub' ) ;
6263import iterationOrder = require( '@stdlib/ndarray/base/iteration-order' ) ;
@@ -1143,6 +1144,33 @@ interface Namespace {
11431144 */
11441145 scalar2ndarray : typeof scalar2ndarray ;
11451146
1147+ /**
1148+ * Returns a zero-dimensional ndarray containing a provided scalar value and having the same data type as a provided input ndarray.
1149+ *
1150+ * @param x - input array
1151+ * @param value - scalar value
1152+ * @returns zero-dimensional ndarray
1153+ *
1154+ * @example
1155+ * var zeros = require( '@stdlib/ndarray/base/zeros' );
1156+ *
1157+ * var x = zeros( 'float64', [ 2, 2 ], 'row-major' );
1158+ * // returns <ndarray>
1159+ *
1160+ * var y = ns.scalar2ndarrayLike( x, 1.0 );
1161+ * // returns <ndarray>
1162+ *
1163+ * var sh = y.shape;
1164+ * // returns []
1165+ *
1166+ * var dt = y.dtype;
1167+ * // returns 'generic'
1168+ *
1169+ * var v = y.get();
1170+ * // returns 1.0
1171+ */
1172+ scalar2ndarrayLike : typeof scalar2ndarrayLike ;
1173+
11461174 /**
11471175 * Returns an index given an index mode.
11481176 *
You can’t perform that action at this time.
0 commit comments