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' );
57
57
import flipud = require( '@stdlib/ndarray/base/flipud' ) ;
58
58
import forEach = require( '@stdlib/ndarray/base/for-each' ) ;
59
59
import scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' ) ;
60
+ import scalar2ndarrayLike = require( '@stdlib/ndarray/base/from-scalar-like' ) ;
60
61
import ind = require( '@stdlib/ndarray/base/ind' ) ;
61
62
import ind2sub = require( '@stdlib/ndarray/base/ind2sub' ) ;
62
63
import iterationOrder = require( '@stdlib/ndarray/base/iteration-order' ) ;
@@ -1143,6 +1144,33 @@ interface Namespace {
1143
1144
*/
1144
1145
scalar2ndarray : typeof scalar2ndarray ;
1145
1146
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
+
1146
1174
/**
1147
1175
* Returns an index given an index mode.
1148
1176
*
You can’t perform that action at this time.
0 commit comments