@@ -17,51 +17,4 @@ fft( 3 , 4 , u , 0 , 8 , v , 0 , 8 ) ;
17
17
[ ![ Code Climate] ( http://img.shields.io/codeclimate/github/aureooms/js-fft.svg?style=flat )] ( https://codeclimate.com/github/aureooms/js-fft )
18
18
[ ![ NPM downloads per month] ( http://img.shields.io/npm/dm/aureooms-js-fft.svg?style=flat )] ( https://www.npmjs.org/package/aureooms-js-fft )
19
19
[ ![ GitHub issues] ( http://img.shields.io/github/issues/aureooms/js-fft.svg?style=flat )] ( https://github.com/aureooms/js-fft/issues )
20
-
21
-
22
- ## Use
23
-
24
- ``` js
25
- /**
26
- * Initialization with complex numbers in double precision.
27
- */
28
-
29
- const number = require ( " aureooms-js-number" ) ;
30
- const complex = require ( " aureooms-js-complex" ) ;
31
-
32
- const kernel = complex .cartesian .kernel .compile ( number , " i" ) ;
33
- const cartesian = complex .cartesian .array .compile ( kernel ) ;
34
-
35
- const $ = fft .compile ( cartesian ) ;
36
-
37
- // ...
38
-
39
- /**
40
- * Fast multiplication of two polynomials u and v in C[x]
41
- * ( little endian , double precision )
42
- */
43
-
44
- const array = require ( " aureooms-js-array" ) ;
45
-
46
- const l = Math .ceil ( Math .log2 ( Math .max ( u .length , v .length ) ) ) ;
47
- const m = Math .pow ( 2 , l ) | 0 ;
48
- const n = m << 1 ;
49
-
50
- const _u = array .alloc ( n ) ;
51
- array .copy ( u , 0 , u .length , _u , 0 ) ;
52
- array .fillfn ( _u , u .length , n , cartesian .$0 ) ;
53
-
54
- const _v = array .alloc ( n ) ;
55
- array .copy ( v , 0 , v .length , _v , 0 ) ;
56
- array .fillfn ( _v , v .length , n , cartesian .$0 ) ;
57
-
58
- const $u = array .alloc ( n ) ;
59
- const $v = array .alloc ( n ) ;
60
-
61
- $ .fft ( l , m , _u , 0 , n , $u , 0 , n ) ; // O(n log n)
62
- $ .fft ( l , m , _v , 0 , n , $v , 0 , n ) ; // O(n log n)
63
-
64
- for ( let i = 0 ; i < n ; ++ i ) $u[i] = cartesian .imul ( $u[i] , $v[i] ) ; // O(n)
65
-
66
- $ .ifft ( l , m , $u , 0 , n , _u , 0 , n ) ; // O(n log n)
67
- ```
20
+ [ ![ Documentation] ( https://aureooms.github.io/js-fft/badge.svg )] ( https://aureooms.github.io/js-fft/source.html )
0 commit comments