Comparing version 1.1.0 to 1.2.0
{ | ||
"name": "ml-fft", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "fft", | ||
@@ -36,7 +36,7 @@ "main": "src/index.js", | ||
"devDependencies": { | ||
"cheminfo-tools": "^1.0.2", | ||
"mocha": "^2.2.5", | ||
"mocha-better-spec-reporter": "^2.1.1", | ||
"should": "^7.0.2" | ||
"cheminfo-tools": "1.4.1", | ||
"mocha": "^2.5.3", | ||
"mocha-better-spec-reporter": "^3.0.2", | ||
"should": "^9.0.2" | ||
} | ||
} |
@@ -0,1 +1,3 @@ | ||
'use strict' | ||
var FFT = require('./fftlib'); | ||
@@ -252,3 +254,3 @@ | ||
toRadix2:function(data, nRows, nCols){ | ||
var output = data.slice(0, data.length); | ||
//var output = data;//.slice(0, data.length); | ||
var i, padding; | ||
@@ -280,3 +282,17 @@ var cols = nCols, rows = nRows | ||
} | ||
return {data:output, rows:rows, cols:cols}; | ||
return {data:data, rows:rows, cols:cols}; | ||
}, | ||
/** | ||
* Crop the given matrix to fit the corresponding number of rows and columns | ||
*/ | ||
crop:function(data, nRows, nCols, newNRows, newNCols){ | ||
var colsToCrop = nCols-newNCols; | ||
var rowsToCrop = (nRows-newNRows); | ||
data.splice(data.length-rowsToCrop*nCols,rowsToCrop*nCols);//Remove the rows | ||
for(var i=newNRows-1;i>=0;i--){ | ||
data.splice(i*nCols, colsToCrop); | ||
} | ||
return data; | ||
} | ||
@@ -283,0 +299,0 @@ } |
Sorry, the diff of this file is not supported yet
90125
1117