Skip to content

Commit

Permalink
upgrade to semver 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolalysenko committed Sep 27, 2014
1 parent dbd82e5 commit 75ade45
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
21 changes: 10 additions & 11 deletions fft.js
@@ -1,10 +1,9 @@
"use strict"
'use strict'

var ops = require("ndarray-ops")
var cwise = require("cwise")
var ndarray = require("ndarray")
var fftm = require("./lib/fft-matrix.js")
var pool = require("typedarray-pool")
var ops = require('ndarray-ops')
var ndarray = require('ndarray')
var pool = require('typedarray-pool')
var fftm = require('./lib/fft-matrix.js')

function ndfft(dir, x, y) {
var shape = x.shape
Expand All @@ -18,14 +17,14 @@ function ndfft(dir, x, y) {
size *= shape[i]
pad = Math.max(pad, fftm.scratchMemory(shape[i]))
if(x.shape[i] !== y.shape[i]) {
throw new Error("Shape mismatch, real and imaginary arrays must have same size")
throw new Error('Shape mismatch, real and imaginary arrays must have same size')
}
}
var buf_size = 4 * size + pad
var buffer
if( x.dtype === "array" ||
x.dtype === "float64" ||
x.dtype === "custom" ) {
if( x.dtype === 'array' ||
x.dtype === 'float64' ||
x.dtype === 'custom' ) {
buffer = pool.mallocDouble(buf_size)
} else {
buffer = pool.mallocFloat(buf_size)
Expand Down Expand Up @@ -80,4 +79,4 @@ function ndfft(dir, x, y) {
pool.free(buffer)
}

module.exports = ndfft
module.exports = ndfft
2 changes: 1 addition & 1 deletion lib/fft-matrix.js
@@ -1,4 +1,4 @@
var bits = require("bit-twiddle")
var bits = require('bit-twiddle')

function fft(dir, nrows, ncols, buffer, x_ptr, y_ptr, scratch_ptr) {
dir |= 0
Expand Down
23 changes: 13 additions & 10 deletions package.json
@@ -1,22 +1,22 @@
{
"name": "ndarray-fft",
"version": "0.1.0",
"version": "1.0.0",
"description": "FFT for ndarrays",
"main": "fft.js",
"directories": {
"test": "test"
},
"dependencies": {
"bit-twiddle": "~0.0.2",
"ndarray": "~1.0.0",
"ndarray-ops": "~1.1.0",
"cwise": "~0.3.2",
"typedarray-pool": "~0.1.1"
"bit-twiddle": "^1.0.2",
"ndarray": "^1.0.15",
"ndarray-ops": "^1.2.2",
"cwise": "^1.0.4",
"typedarray-pool": "^1.0.0"
},
"devDependencies": {
"almost-equal": "~0.0.0",
"tap": "~0.4.2",
"zeros": "~0.0.0"
"tape": "^3.0.0",
"zeros": "0.0.0",
"almost-equal": "0.0.0"
},
"scripts": {
"test": "tap test/*.js"
Expand All @@ -42,5 +42,8 @@
"author": "Mikola Lysenko",
"license": "MIT",
"readmeFilename": "README.md",
"gitHead": "1847ab09f0f2fdc1103bca773b7bc0b0bd55b12d"
"gitHead": "1847ab09f0f2fdc1103bca773b7bc0b0bd55b12d",
"browserify": {
"transform": "cwise"
}
}
2 changes: 1 addition & 1 deletion test/test.js
Expand Up @@ -8,7 +8,7 @@ var almostEqual = require("almost-equal")

var EPSILON = almostEqual.FLT_EPSILON

require("tap").test("ndarray-fft", function(t) {
require("tape")("ndarray-fft", function(t) {

function test_spike(n) {
var i, j
Expand Down

0 comments on commit 75ade45

Please sign in to comment.