ndarray-fill

1.0.2 • Public • Published

ndarray-fill

Initialize an ndarray with a function.

Build Status

Example

var zeros = require("zeros")
var fill = require("ndarray-fill")
 
var x = zeros([5, 5])
 
fill(x, function(i,j) {
  return 10*+ j
})
 
//Now x = 
//
//   0  1  2  3  4
//  10 11 12 13 14
//  20 21 22 23 24
//  30 31 32 33 34
//

Install

npm install ndarray-fill

require("ndarray-fill")(array, func)

Fills an ndarray with a pattern

  • array is an ndarray which will be initialized
  • func is a function that will be used to initialize the array

Returns An initialized ndarray

Credits

(c) 2013 Mikola Lysenko. MIT License

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    73,998
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    73,998
  • 1.0.1
    76
  • 1.0.0
    0
  • 0.1.0
    12
  • 0.0.0
    0

Package Sidebar

Install

npm i ndarray-fill

Weekly Downloads

55,710

Version

1.0.2

License

MIT

Last publish

Collaborators

  • mikolalysenko
  • jaspervdg
  • hughsk
  • planeshifter
  • rreusser