cwise ===== This library can be used to generate cache efficient map/reduce operations for [ndarrays](http://github.com/mikolalysenko/ndarray). [![build status](https://secure.travis-ci.org/scijs/cwise.png)](http://travis-ci.org/scijs/cwise) # Examples For brevity, we will assume the following precedes each example: ```javascript //Import libraries var cwise = require("cwise") , ndarray = require("ndarray") ``` ## Adding two arrays The array equivalent of `+=`: ```javascript //Create operation var addeq = cwise({ args: ["array", "array"], body: function(a, b) { a += b } }) //Create two 2D arrays var X = ndarray(new Float32Array(128*128), [128,128]) var Y = ndarray(new Float32Array(128*128), [128,128]) //Add them together addeq(X, Y) ``` Formally, you can think of `addeq(X,Y)` as being something like the following for-loop, except optimized with respect to the dimension and order of X and Y: ```javascript for(var i=0; i