ndarray-ops
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -415,4 +415,5 @@ var cwise = require("cwise") | ||
} | ||
var result = ndarray(array.data.slice(0, tsz), array.shape.slice(0), stride, 0) | ||
var ndata = new array.data.constructor(array.data.slice(0, tsz*array.data.BYTES_PER_ELEMENT)) | ||
var result = ndarray(ndata, array.shape.slice(0), stride, 0) | ||
return exports.assign(result, array) | ||
} |
{ | ||
"name": "ndarray-ops", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Common operations for ndarray arrays", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
var ops = require("../index.js") | ||
, ndarray = require("ndarray") | ||
for(var i in ops) { | ||
console.log("*", i) | ||
} | ||
require("tap").test("clone", function(t) { | ||
var x = ndarray.zeros([3]) | ||
x.set(0, 1) | ||
x.set(1, 2) | ||
x.set(2, 3) | ||
var y = ops.clone(x) | ||
t.equals(y.get(0), 1) | ||
t.equals(y.get(1), 2) | ||
t.equals(y.get(2), 3) | ||
y.set(0, 1000) | ||
t.equals(x.get(0), 1) | ||
t.equals(x.get(1), 2) | ||
t.equals(x.get(2), 3) | ||
t.equals(y.get(0), 1000) | ||
t.equals(y.get(1), 2) | ||
t.equals(y.get(2), 3) | ||
t.end() | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16878
411