Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ndarray

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ndarray - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

78

ndarray.js

@@ -28,12 +28,12 @@ "use strict"

this.stride = c;\
this.offset = d;\
}\
ZeroArray.prototype.size=function(){return 0}\
ZeroArray.prototype.order=function(){return []}\
this.offset = d\
};\
ZeroArray.prototype.size=0;\
ZeroArray.prototype.order=[];\
ZeroArray.prototype.get=function() {\
return Number.NaN\
}\
};\
ZeroArray.prototype.set=function(v) {\
return Number.NaN\
}\
};\
ZeroArray.prototype.lo=\

@@ -50,3 +50,6 @@ ZeroArray.prototype.hi=\

if(dimension === 0) {
var compiledProc = new Function(ZeroArray+"ZeroArray.prototype.dtype='"+dtype+"'")
var compiledProc = new Function([
ZeroArray,
"ZeroArray.prototype.dtype='"+dtype+"'",
"return ZeroArray"].join("\n"))
return compiledProc()

@@ -77,36 +80,43 @@ }

//view.size():
//view.size:
code.push(["Object.defineProperty(proto,'size',{get:function ",className,"_size(){var s=this.shape"].join(""))
code.push(["return ", indices.map(function(i) {
code.push("return " + indices.map(function(i) {
return ["s[",i,"]"].join("")
}).join("*")].join(""))
}).join("*"))
code.push("}})")
//view.order():
code.push(["Object.defineProperty(proto,'order',{get:function ",className,"_order(){"].join(""))
//view.order:
if(dimension === 1) {
code.push("return [0]")
} else if(dimension === 2) {
code.push("return (this.stride[0]>this.stride[1])?[1,0]:[0,1]")
} else if(dimension === 3) {
code.push("var s=this.stride")
code.push("if(s[0] > s[1]){")
code.push("if(s[1]>s[2]){")
code.push("return [2,1,0]")
code.push("}else if(s[0]>s[2]){")
code.push("return [1,2,0]")
code.push("}else{")
code.push("return [1,0,2]")
code.push("proto.order=[0]")
} else {
code.push("Object.defineProperty(proto,'order',{get:")
if(dimension < 4) {
code.push(["function ",className,"_order(){"].join(""))
if(dimension === 2) {
code.push("return (this.stride[0]>this.stride[1])?[1,0]:[0,1]")
} else if(dimension === 3) {
code.push(
"var s=this.stride;\
if(s[0] > s[1]){\
if(s[1]>s[2]){\
return [2,1,0];\
}else if(s[0]>s[2]){\
return [1,2,0];\
}else{\
return [1,0,2];\
}\
}else if(s[0]>s[2]){\
return [2,0,1];\
}else if(s[2]>s[1]){\
return [0,1,2];\
}else{\
return [0,2,1];\
}")
}
code.push("}")
code.push("}else if(s[0]>s[2]){")
code.push("return [2,0,1]")
code.push("}else if(s[2]>s[1]){")
code.push("return [0,1,2]")
code.push("}else{")
code.push("return [0,2,1]")
code.push("}")
} else {
code.push("return ORDER(this.stride)")
} else {
code.push("ORDER")
}
code.push("})")
}
code.push("}})")

@@ -113,0 +123,0 @@ //view.set(i0, ..., v):

{
"name": "ndarray",
"version": "1.0.1",
"version": "1.0.2",
"description": "Multidimensional Arrays",

@@ -14,3 +14,6 @@ "main": "ndarray.js",

"tap": "~0.4.0",
"tape": "~1.0.4"
"tape": "~1.0.4",
"permutation-rank": "0.0.0",
"dup": "0.0.0",
"invert-permutation": "0.0.0"
},

@@ -17,0 +20,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc