Skip to content

Commit b773d06

Browse files
committed
docs: add comment and TODOs
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 410012e commit b773d06

File tree

13 files changed

+48
-21
lines changed

13 files changed

+48
-21
lines changed

lib/node_modules/@stdlib/fft/base/fftpack/lib/cosqb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var TSQRT2 = 2.0 * SQRT_TWO;
8282
* @param {number} wptr - starting index for `wsave`
8383
* @returns {void}
8484
*/
85-
function cosqb( n, x, xptr, wsave, wptr ) {
85+
function cosqb( n, x, xptr, wsave, wptr ) { // TODO: consider moving to a separate package `fft/base/fftpack/cosqb` after this package has been refactored
8686
var x1;
8787

8888
wptr -= 1;

lib/node_modules/@stdlib/fft/base/fftpack/lib/cosqf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ var cosqf1 = require( './cosqf1.js' );
7676
* @param {number} wptr - starting index for `wsave`
7777
* @returns {void}
7878
*/
79-
function cosqf( n, x, xptr, wsave, wptr ) {
79+
function cosqf( n, x, xptr, wsave, wptr ) { // TODO: consider moving to a separate package `fft/base/fftpack/cosqf` after this package has been refactored
8080
var tsqx;
8181

8282
wptr -= 1;

lib/node_modules/@stdlib/fft/base/fftpack/lib/cosqi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var rffti = require( './rffti.js' );
7575
* @param {number} wptr - starting index for `wsave`
7676
* @returns {void}
7777
*/
78-
function cosqi( n, wsave, wptr ) {
78+
function cosqi( n, wsave, wptr ) { // TODO: consider moving to a separate package `fft/base/fftpack/cosqi` after this package has been refactored
7979
var fk;
8080
var dt;
8181
var k;

lib/node_modules/@stdlib/fft/base/fftpack/lib/cost.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var rfftf = require( './rfftf.js' );
7575
* @param {number} wptr - starting index for wsave
7676
* @returns {void}
7777
*/
78-
function cost( n, x, xptr, wsave, wptr ) {
78+
function cost( n, x, xptr, wsave, wptr ) { // TODO: consider moving to a separate package `fft/base/fftpack/cost` after this package has been refactored
7979
var x1p3;
8080
var xim2;
8181
var modn;

lib/node_modules/@stdlib/fft/base/fftpack/lib/costi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var rffti = require( './rffti.js' );
7575
* @param {number} wptr - starting index for `wsave`
7676
* @returns {void}
7777
*/
78-
function costi( n, wsave, wptr ) {
78+
function costi( n, wsave, wptr ) { // TODO: consider moving to a separate package `fft/base/fftpack/costi` after this package has been refactored
7979
var nm1;
8080
var np1;
8181
var ns2;

lib/node_modules/@stdlib/fft/base/fftpack/lib/decompose.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ var floor = require( '@stdlib/math/base/special/floor' );
6666
// MAIN //
6767

6868
/**
69-
* Factorizes a sequence length into its prime factors.
69+
* Factorizes a sequence length into a product of integers.
7070
*
7171
* ## Notes
7272
*
7373
* - Factorization results are stored in the input array as follows:
7474
*
7575
* ```text
76-
* [ sequence_length | number_of_factors | prime_factors | unused_storage ]
76+
* [ sequence_length | number_of_factors | integer_factors | unused_storage ]
7777
* ```
7878
*
7979
* - The function mutates the input array.
@@ -96,7 +96,7 @@ var floor = require( '@stdlib/math/base/special/floor' );
9696
* // Initialize an array for storing factorization results:
9797
* var factors = [ 0, 0, 0, 0, 0, 0, 0 ];
9898
*
99-
* // Factorize the sequence length into its prime factors:
99+
* // Factorize the sequence length into a product of integers:
100100
* var numFactors = decompose( N, initial, factors, 1, 0 );
101101
* // returns 5
102102
*
@@ -113,14 +113,14 @@ var floor = require( '@stdlib/math/base/special/floor' );
113113
* // Initialize an array for storing factorization results:
114114
* var factors = [ 0, 0, 0, 0 ];
115115
*
116-
* // Factorize the sequence length into its prime factors:
116+
* // Factorize the sequence length into its a product of integers:
117117
* var numFactors = decompose( N, initial, factors, 1, 0 );
118118
* // returns 2
119119
*
120120
* var f = factors.slice();
121121
* // returns [ 8, 2, 2, 4 ]
122122
*/
123-
function decompose( N, initial, out, stride, offset ) {
123+
function decompose( N, initial, out, stride, offset ) { // TODO: consider moving to a separate utility package
124124
var divisor;
125125
var ntrials;
126126
var nl;

lib/node_modules/@stdlib/fft/base/fftpack/lib/print_real_workspace.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var strided2array = require( '@stdlib/array/base/from-strided' );
3535
* @param {NonNegativeInteger} offsetW - starting index for `workspace`
3636
* @returns {void}
3737
*/
38-
function printWorkspace( N, workspace, strideW, offsetW ) {
38+
function printWorkspace( N, workspace, strideW, offsetW ) { // FIXME: remove this file and function once we've clean-up this package
3939
var offsetT;
4040
var offsetF;
4141
var tmp;

lib/node_modules/@stdlib/fft/base/fftpack/lib/radb2.js

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,36 @@ function iptr( i, j, k, M, stride, offset ) {
117117
*
118118
* ## Notes
119119
*
120-
* When writing to an output array stored in linear memory, we can reinterpret the array as a three-dimensional logical view containing `L` independent sub-sequences having two "columns" corresponding to the real and imaginary parts of a folded complex vector and where each "column" has `M` elements.
120+
* When writing to an output array stored in linear memory, we can reinterpret the array as a three-dimensional logical view containing `L` independent sub-sequences having two "rows" corresponding to the two parts of the butterfly (`even + odd` and `even - odd`, respectively) and where each "row" has `M*L` elements.
121121
*
122-
* Accordingly, the following is a logical view of an input array (zero-based indexing) which contains `L = 3` transforms and in which each "column" sub-sequence has length `M = 4`:
122+
* Accordingly, the following is a logical view of an input array (zero-based indexing) which contains `L = 3` transforms and in which each sub-sequence has length `M = 4`:
123+
*
124+
* ```text
125+
* │ k = 0 k = 1 k = 2
126+
* │ ───────────────────────────────────────────────────────────────────────────────→ k
127+
* j = 0 (even+odd) │ out(0,0,0) ... out(3,0,0) out(0,1,0) ... out(3,1,0) out(0,2,0) ... out(3,2,0)
128+
* │
129+
* j = 1 (even-odd) │ out(0,0,1) ... out(3,0,1) out(0,1,1) ... out(3,1,1) out(0,2,1) ... out(3,2,1)
130+
* └────────────────────────────────────────────────────────────────────────────────→ i
131+
* ↑ ↑ ↑ ↑ ↑ ↑
132+
* i = 0 M-1 0 M-1 0 M-1
133+
* ```
134+
*
135+
* In the above,
136+
*
137+
* - `i` is the fastest varying index, which walks within one short sub-sequence corresponding to either the `even + odd` or `even - odd` part of the butterfly.
138+
* - `j` selects between the `even + odd` and `even - odd` part of the butterfly.
139+
* - `k` specifies the index of one of the `L` independent transforms we are processing.
140+
*
141+
* In linear memory, the three-dimensional logical view is arranged as follows:
142+
*
143+
* ```text
144+
* | out(0,0,0)...out(3,0,0) ... out(0,2,0)...out(3,2,0) | out(0,0,1)...out(3,0,1) ... out(0,2,1)...out(3,2,1) |
145+
* ```
146+
*
147+
* As may be observed, when resolving an index in the output array, the `j` and `k` dimensions are swapped. This stems from `radb2` being only one stage in a multi-stage driver which alternates between using `ch` and `out` as workspace buffers. After each stage, the next stage reads what the previous stage wrote.
148+
*
149+
* Each stage expects a transpose, and, in order to avoid explicit transposition between the stages, we swap the last two logical dimensions while still maintaining cache locality within the inner loop logical dimension, as indexed by `i`.
123150
*
124151
* @private
125152
* @param {NonNegativeInteger} i - index of an element within a sub-sequence
@@ -204,9 +231,6 @@ function radb2( M, L, cc, oc, out, oo, twiddles, ot ) { // FIXME: support stride
204231
for ( i = 2; i < M; i += 2 ) {
205232
ic = MP1 - i;
206233

207-
it1 = i - 1 + ot;
208-
it2 = i + ot;
209-
210234
ip1 = iptr( i, 0, k, M, sc, oc );
211235
ip2 = iptr( ic-1, 1, k, M, sc, oc );
212236
tr2 = cc[ ip1 ] - cc[ ip2 ];
@@ -221,6 +245,9 @@ function radb2( M, L, cc, oc, out, oo, twiddles, ot ) { // FIXME: support stride
221245
io = optr( i+1, k, 0, L, M, so, oo );
222246
out[ io ] = cc[ ip1 ] - cc[ ip2 ];
223247

248+
it1 = i - 1 + ot;
249+
it2 = i + ot;
250+
224251
io = optr( i, k, 1, L, M, so, oo );
225252
out[ io ] = ( twiddles[ it1 ] * tr2 ) - ( twiddles[ it2 ] * ti2 );
226253

lib/node_modules/@stdlib/fft/base/fftpack/lib/sinqb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var cosqb = require( './cosqb.js' );
7575
* @param {number} wptr - starting index for `wsave`
7676
* @returns {void}
7777
*/
78-
function sinqb( n, x, xptr, wsave, wptr ) {
78+
function sinqb( n, x, xptr, wsave, wptr ) { // TODO: consider moving to a separate package `fft/base/fftpack/sinqb` after this package has been refactored
7979
var xhold;
8080
var ns2;
8181
var kc;

lib/node_modules/@stdlib/fft/base/fftpack/lib/sinqf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var cosqb = require( './cosqb.js' );
7575
* @param {number} wptr - starting index for `wsave`
7676
* @returns {void}
7777
*/
78-
function sinqf( n, x, xptr, wsave, wptr ) {
78+
function sinqf( n, x, xptr, wsave, wptr ) { // TODO: consider moving to a separate package `fft/base/fftpack/sinqf` after this package has been refactored
7979
var xhold;
8080
var ns2;
8181
var kc;

0 commit comments

Comments
 (0)