ndarray-pack
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -17,3 +17,3 @@ "use strict" | ||
module.exports = function convert(arr) { | ||
module.exports = function convert(arr, result) { | ||
var shape = [], c = arr, sz = 1 | ||
@@ -26,7 +26,9 @@ while(c instanceof Array) { | ||
if(shape.length === 0) { | ||
return ndarray([]) | ||
return ndarray() | ||
} | ||
var result = ndarray(new Float64Array(sz), shape) | ||
if(!result) { | ||
result = ndarray(new Float64Array(sz), shape) | ||
} | ||
do_convert(result, arr) | ||
return result | ||
} |
{ | ||
"name": "ndarray-pack", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Packs an array-of-arrays into a single ndarray", | ||
@@ -10,4 +10,4 @@ "main": "convert.js", | ||
"dependencies": { | ||
"cwise": "~0.3.2", | ||
"ndarray": "~1.0.0" | ||
"cwise": "^0.3.2", | ||
"ndarray": "^1.0.13" | ||
}, | ||
@@ -14,0 +14,0 @@ "devDependencies": { |
@@ -22,6 +22,7 @@ ndarray-pack | ||
### `require("ndarray-pack")(nested_array)` | ||
### `require("ndarray-pack")(nested_array[,out])` | ||
Converts the nested array into a packed ndarray. | ||
* `nested_array` is an array-of-arrays (ie a numeric.js array) | ||
* `out` is an optional ndarray that gets the result of unpacking `array` | ||
@@ -28,0 +29,0 @@ **Returns** A packed ndarray representation of the nested arrays. |
3291
29
31
Updatedcwise@^0.3.2
Updatedndarray@^1.0.13