Comparing version 0.0.1 to 0.0.2
"use strict"; | ||
var ViewN = require("./viewn.js"); | ||
function View1(data, shape, stride, offset) { | ||
@@ -40,36 +42,9 @@ this.data = data; | ||
} | ||
View1.prototype.lo = function(i) { | ||
return new View1(this.data, | ||
[this.shape[0]-i], | ||
this.stride.slice(0), | ||
this.offset + i * this.stride[0]); | ||
} | ||
View1.prototype.hi = function(i) { | ||
return new View1(this.data, | ||
[this.shape[0]-i], | ||
this.stride.slice(0), | ||
this.offset); | ||
} | ||
View1.prototype.step = function(s) { | ||
if(s < 0) { | ||
return new View1(this.data, | ||
[Math.ceil(-this.shape[0]/s)], | ||
[this.stride[0] * s], | ||
this.offset + (this.shape[0]-1) * this.stride[0]); | ||
} else if(s > 0) { | ||
return new View1(this.data, | ||
[Math.ceil(this.shape[0]/s)], | ||
[this.stride[0] * s], | ||
this.offset); | ||
} else { | ||
return new View1(this.data, | ||
this.shape.slice(0), | ||
this.stride.slice(0), | ||
this.offset); | ||
} | ||
} | ||
View1.prototype.transpose = function() { | ||
return new View1(this.data, this.shape.slice(0), this.stride.slice(0), this.offset); | ||
} | ||
View1.prototype.lo = ViewN.prototype.lo; | ||
View1.prototype.hi = ViewN.prototype.hi; | ||
View1.prototype.step = ViewN.prototype.step; | ||
View1.prototype.transpose = ViewN.prototype.transpose; | ||
View1.prototype.toString = ViewN.prototype.toString; | ||
module.exports = View1; |
{ | ||
"name": "ndarray", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Multidimensional Arrays", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
27153
565