UNPKG
ndarray-fill
Version:
latest (1.0.2)
1.0.2
1.0.1
1.0.0
0.1.0
0.0.0
Fills an ndarray with function
github.com/mikolalysenko/ndarray-fill
mikolalysenko/ndarray-fill
ndarray-fill
/
index.js
16 lines
(12 loc)
•
247 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"use strict"
var
cwise =
require
(
"cwise"
)
var
fill =
cwise
({
args
: [
"index"
,
"array"
,
"scalar"
],
body
:
function
(
idx, out, f
) { out = f.
apply
(
undefined
, idx) } })
module
.
exports
=
function
(
array, f
) {
fill
(array, f)
return
array }