dstructs-matrix
Advanced tools
Comparing version 2.1.1 to 2.1.2
'use strict'; | ||
// MODULES // | ||
var cast = require( 'dstructs-cast-arrays' ), | ||
copy = require( 'utils-copy' ); | ||
// TOJSON // | ||
/** | ||
@@ -12,13 +20,4 @@ * FUNCTION: toJSON() | ||
var prop, | ||
out, | ||
len, | ||
d, | ||
i; | ||
out; | ||
// Copy data to a generic array... | ||
len = this.data.length; | ||
d = new Array( len ); | ||
for ( i = 0; i < len; i++ ) { | ||
d[ i ] = this.data[ i ]; | ||
} | ||
// Build an object containing all Matrix properties needed to revive a serialized Matrix... | ||
@@ -28,5 +27,5 @@ out = {}; | ||
out.dtype = this.dtype; | ||
out.shape = this.shape; | ||
out.shape = copy( this.shape ); | ||
out.offset = this.offset; | ||
out.strides = this.strides; | ||
out.strides = copy( this.strides ); | ||
@@ -36,3 +35,4 @@ prop = Object.getOwnPropertyDescriptor( this, 'data' ); | ||
out.data = d; | ||
// Cast data to a generic array: | ||
out.data = cast( this.data, 'generic' ); | ||
@@ -39,0 +39,0 @@ return out; |
{ | ||
"name": "dstructs-matrix", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Matrices.", | ||
@@ -55,2 +55,3 @@ "author": { | ||
"dstructs-cast-arrays": "^1.0.2", | ||
"utils-copy": "^1.0.0", | ||
"validate.io-array": "^1.0.6", | ||
@@ -57,0 +58,0 @@ "validate.io-contains": "^1.0.0", |
@@ -221,6 +221,8 @@ Matrix | ||
var mat = matrix( data, [10,1] ); | ||
// [ 0 0 0 0 0 0 0 0 0 0 ] | ||
var mat = matrix( data, [1,10] ); | ||
/* | ||
[ 0 0 0 0 0 0 0 0 0 0 ] | ||
*/ | ||
var value = mat.get( 3, 1 ); | ||
var value = mat.get( 1, 3 ); | ||
// returns 0 | ||
@@ -227,0 +229,0 @@ |
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
67119
964
13
1518
+ Addedutils-copy@^1.0.0
+ Addedconst-pinf-float64@1.0.0(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedregex-regex@1.0.0(transitive)
+ Addedtype-name@2.0.2(transitive)
+ Addedutils-copy@1.1.1(transitive)
+ Addedutils-copy-error@1.0.1(transitive)
+ Addedutils-indexof@1.0.0(transitive)
+ Addedutils-regex-from-string@1.0.0(transitive)
+ Addedvalidate.io-buffer@1.0.2(transitive)