Skip to content

Commit fdc5fe6

Browse files
committed
refactor: update rfftf
--- 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 3db30b3 commit fdc5fe6

File tree

1 file changed

+18
-4
lines changed
  • lib/node_modules/@stdlib/fft/base/fftpack/rfftf/lib

1 file changed

+18
-4
lines changed

lib/node_modules/@stdlib/fft/base/fftpack/rfftf/lib/main.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060

6161
// MODULES //
6262

63+
var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );
64+
var isFloat64Array = require( '@stdlib/assert/is-float64array' );
65+
var isInteger = require( '@stdlib/assert/is-integer' );
6366
var rfftf1 = require( './rfftf1.js' );
6467

6568

@@ -70,24 +73,35 @@ var rfftf1 = require( './rfftf1.js' );
7073
*
7174
* @param {NonNegativeInteger} N - length of the sequence to transform
7275
* @param {Float64Array} r - real-valued input array containing the sequence to be transformed
76+
* @param {integer} strideR - stride length for `r`
7377
* @param {NonNegativeInteger} offsetR - starting index for `r`
7478
* @param {Float64Array} workspace - workspace array containing pre-computed values
79+
* @param {integer} strideW - stride length for `workspace`
7580
* @param {NonNegativeInteger} offsetW - starting index for `workspace`
7681
* @returns {void}
7782
*/
78-
function rfftf( N, r, offsetR, workspace, offsetW ) { // FIXME: add stride support
83+
function rfftf( N, r, strideR, offsetR, workspace, strideW, offsetW ) {
7984
var offsetT;
8085
var offsetF;
8186

87+
if ( !isNonNegativeInteger( N ) || !isFloat64Array( r ) ||
88+
!isInteger( strideR ) || !isNonNegativeInteger( offsetR ) ||
89+
!isFloat64Array( workspace ) || !isInteger( strideW ) ||
90+
!isNonNegativeInteger( offsetW ) ||
91+
workspace.length < offsetW + ( ( ( 2*N ) + 34 ) * strideW ) ) {
92+
return;
93+
}
94+
8295
// When a sub-sequence is a single data point, the FFT is the identity, so no transformation necessary...
8396
if ( N === 1 ) {
8497
return;
8598
}
99+
86100
// Resolve the starting indices for storing twiddle factors and factorization results:
87-
offsetT = offsetW + N; // index offset for twiddle factors
88-
offsetF = offsetT + N; // index offset for factors describing the sub-transforms
101+
offsetT = offsetW + (N * strideW); // index offset for twiddle factors
102+
offsetF = offsetT + (N * strideW); // index offset for factors describing the sub-transforms
89103

90-
rfftf1( N, r, offsetR, workspace, offsetW, workspace, offsetT, workspace, offsetF ); // eslint-disable-line max-len
104+
rfftf1( N, r, strideR, offsetR, workspace, strideW, offsetW, workspace, strideW, offsetT, workspace, strideW, offsetF ); // eslint-disable-line max-len
91105
}
92106

93107

0 commit comments

Comments
 (0)