From b49dc1655002dc83e22ef6fbdd7f34335328a5d2 Mon Sep 17 00:00:00 2001 From: Gunj Joshi Date: Wed, 28 Oct 2026 20:12:57 +0530 Subject: [PATCH 01/10] feat: add fft/rffti --- 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_pkg_readmes status: passed - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - 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: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/fft/rffti/README.md | 159 ++++++++++++++++ .../fft/rffti/benchmark/benchmark.assign.js | 103 ++++++++++ .../@stdlib/fft/rffti/benchmark/benchmark.js | 101 ++++++++++ .../@stdlib/fft/rffti/docs/repl.txt | 58 ++++++ .../@stdlib/fft/rffti/docs/types/index.d.ts | 115 ++++++++++++ .../@stdlib/fft/rffti/docs/types/test.ts | 133 +++++++++++++ .../@stdlib/fft/rffti/examples/index.js | 35 ++++ .../@stdlib/fft/rffti/lib/assign.js | 83 ++++++++ .../@stdlib/fft/rffti/lib/base.js | 84 +++++++++ .../@stdlib/fft/rffti/lib/defaults.js | 38 ++++ .../@stdlib/fft/rffti/lib/dtypes.js | 36 ++++ .../@stdlib/fft/rffti/lib/index.js | 75 ++++++++ .../@stdlib/fft/rffti/lib/main.js | 109 +++++++++++ .../@stdlib/fft/rffti/package.json | 65 +++++++ .../@stdlib/fft/rffti/test/test.assign.js | 152 +++++++++++++++ .../@stdlib/fft/rffti/test/test.js | 39 ++++ .../@stdlib/fft/rffti/test/test.main.js | 177 ++++++++++++++++++ 17 files changed, 1562 insertions(+) create mode 100644 lib/node_modules/@stdlib/fft/rffti/README.md create mode 100644 lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.assign.js create mode 100644 lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/fft/rffti/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/fft/rffti/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/fft/rffti/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/fft/rffti/examples/index.js create mode 100644 lib/node_modules/@stdlib/fft/rffti/lib/assign.js create mode 100644 lib/node_modules/@stdlib/fft/rffti/lib/base.js create mode 100644 lib/node_modules/@stdlib/fft/rffti/lib/defaults.js create mode 100644 lib/node_modules/@stdlib/fft/rffti/lib/dtypes.js create mode 100644 lib/node_modules/@stdlib/fft/rffti/lib/index.js create mode 100644 lib/node_modules/@stdlib/fft/rffti/lib/main.js create mode 100644 lib/node_modules/@stdlib/fft/rffti/package.json create mode 100644 lib/node_modules/@stdlib/fft/rffti/test/test.assign.js create mode 100644 lib/node_modules/@stdlib/fft/rffti/test/test.js create mode 100644 lib/node_modules/@stdlib/fft/rffti/test/test.main.js diff --git a/lib/node_modules/@stdlib/fft/rffti/README.md b/lib/node_modules/@stdlib/fft/rffti/README.md new file mode 100644 index 000000000000..ffcb718881e6 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/README.md @@ -0,0 +1,159 @@ + + +# rffti + +> Return an initialized one-dimensional workspace [ndarray][@stdlib/ndarray/ctor] for computing a real-valued discrete Fourier transform. + +
+ +## Usage + +```javascript +var rffti = require( '@stdlib/fft/rffti' ); +``` + +#### rffti( n\[, options] ) + +Returns an initialized one-dimensional workspace [ndarray][@stdlib/ndarray/ctor] for computing a real-valued discrete Fourier transform. + +```javascript +var getDType = require( '@stdlib/ndarray/dtype' ); +var getShape = require( '@stdlib/ndarray/shape' ); + +var ws = rffti( 4 ); +// returns + +var dt = getDType( ws ); +// returns 'float64' + +var sh = getShape( ws ); +// returns [ 42 ] +``` + +The function has the following parameters: + +- **n**: sequence length. +- **options**: function options (_optional_). + +The function accepts the following options: + +- **dtype**: workspace [data type][@stdlib/ndarray/dtypes]. Must be a real-valued floating-point [data type][@stdlib/ndarray/dtypes]. Default: `'float64'`. + +To specify the workspace [data type][@stdlib/ndarray/dtypes], provide a `dtype` option. + +```javascript +var getDType = require( '@stdlib/ndarray/dtype' ); + +var ws = rffti( 4, { + 'dtype': 'float32' +}); +// returns + +var dt = getDType( ws ); +// returns 'float32' +``` + +#### rffti.assign( workspace, n ) + +Initializes a provided one-dimensional workspace [ndarray][@stdlib/ndarray/ctor] for computing a real-valued discrete Fourier transform. + +```javascript +var zeros = require( '@stdlib/ndarray/zeros' ); + +var ws = zeros( [ 42 ], { + 'dtype': 'float64' +}); +// returns + +var out = rffti.assign( ws, 4 ); +// returns + +var bool = ( ws === out ); +// returns true +``` + +The function has the following parameters: + +- **workspace**: workspace [ndarray][@stdlib/ndarray/ctor]. Must have a real-valued floating-point [data type][@stdlib/ndarray/dtypes]. +- **n**: sequence length. + +
+ + + +
+ +## Notes + +- The returned workspace [ndarray][@stdlib/ndarray/ctor] has a length of `(2*n) + 34`. +- The workspace contains precomputed twiddle factors and factorization data used by the FFTPACK forward and backward real-valued FFT routines. + +
+ + + +
+ +## Examples + + + +```javascript +var getDType = require( '@stdlib/ndarray/dtype' ); +var getShape = require( '@stdlib/ndarray/shape' ); +var rffti = require( '@stdlib/fft/rffti' ); + +// Initialize a workspace for a sequence of length 8: +var ws = rffti( 8 ); +console.log( 'dtype: %s', getDType( ws ) ); +console.log( 'shape: [%s]', getShape( ws ).join( ', ' ) ); + +// Initialize a single-precision workspace: +var ws32 = rffti( 8, { + 'dtype': 'float32' +}); +console.log( 'dtype: %s', getDType( ws32 ) ); +console.log( 'shape: [%s]', getShape( ws32 ).join( ', ' ) ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.assign.js b/lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.assign.js new file mode 100644 index 000000000000..f929119b0bb5 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.assign.js @@ -0,0 +1,103 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); +var zeros = require( '@stdlib/ndarray/zeros' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var assign = require( './../lib/assign.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - sequence length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var ws = zeros( [ ( 2*len ) + 34 ], options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var out; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + out = assign( ws, len ); + if ( !isndarrayLike( out ) ) { + b.fail( 'should return an ndarray' ); + } + } + b.toc(); + if ( !isndarrayLike( out ) ) { + b.fail( 'should return an ndarray' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:assign:dtype=%s,len=%d', pkg, options.dtype, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.js b/lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.js new file mode 100644 index 000000000000..37bdded76e93 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.js @@ -0,0 +1,101 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var rffti = require( './../lib' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - sequence length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var ws; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + ws = rffti( len, options ); + if ( !isndarrayLike( ws ) ) { + b.fail( 'should return an ndarray' ); + } + } + b.toc(); + if ( !isndarrayLike( ws ) ) { + b.fail( 'should return an ndarray' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:dtype=%s,len=%d', pkg, options.dtype, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/fft/rffti/docs/repl.txt b/lib/node_modules/@stdlib/fft/rffti/docs/repl.txt new file mode 100644 index 000000000000..20c5f3f30b06 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/docs/repl.txt @@ -0,0 +1,58 @@ + +{{alias}}( n[, options] ) + Returns an initialized one-dimensional workspace ndarray for computing a + real-valued discrete Fourier transform. + + Parameters + ---------- + n: integer + Sequence length. + + options: Object (optional) + Function options. + + options.dtype: string (optional) + Output workspace ndarray data type. Must be a real-valued floating-point + data type. Default: 'float64'. + + Returns + ------- + out: ndarray + Output ndarray. + + Examples + -------- + > var out = {{alias}}( 4 ) + + + +{{alias}}.assign( workspace, n ) + Initializes a provided one-dimensional workspace ndarray for computing a + real-valued discrete Fourier transform. + + The function modifies the workspace ndarray in-place and thus mutates the + input ndarray. + + Parameters + ---------- + workspace: ndarray + Workspace ndarray. Must have a real-valued floating-point data type. + + n: integer + Sequence length. + + Returns + ------- + out: ndarray + Input ndarray. + + Examples + -------- + > var ws = {{alias:@stdlib/ndarray/zeros}}( [ 42 ], { 'dtype': 'float64' } ); + > var out = {{alias}}.assign( ws, 4 ) + + > var bool = ( out === ws ) + true + + See Also + -------- diff --git a/lib/node_modules/@stdlib/fft/rffti/docs/types/index.d.ts b/lib/node_modules/@stdlib/fft/rffti/docs/types/index.d.ts new file mode 100644 index 000000000000..8f4f1f33749c --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/docs/types/index.d.ts @@ -0,0 +1,115 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { RealFloatingPointDataType, floatndarray } from '@stdlib/types/ndarray'; + +/** +* Output array. +*/ +type OutputArray = floatndarray; + +/** +* Interface defining options. +*/ +interface Options { + /** + * Workspace data type. + */ + dtype?: RealFloatingPointDataType; +} + +/** +* Interface for initializing a workspace ndarray. +*/ +interface Rffti { + /** + * Returns an initialized one-dimensional workspace ndarray for computing a real-valued discrete Fourier transform. + * + * @param n - sequence length + * @param options - function options + * @returns output ndarray + * + * @example + * var getDType = require( '@stdlib/ndarray/dtype' ); + * + * var ws = rffti( 4 ); + * // returns + * + * var dt = getDType( ws ); + * // returns 'float64' + */ + ( n: number, options?: Options ): OutputArray; + + /** + * Initializes a provided one-dimensional workspace ndarray for computing a real-valued discrete Fourier transform. + * + * @param workspace - workspace ndarray + * @param n - sequence length + * @returns input ndarray + * + * @example + * var zeros = require( '@stdlib/ndarray/zeros' ); + * + * var ws = zeros( [ 42 ], { 'dtype': 'float64' } ); + * + * var out = rffti.assign( ws, 4 ); + * // returns + * + * var bool = ( out === ws ); + * // returns true + */ + assign( workspace: T, n: number ): T; +} + +/** +* Returns an initialized one-dimensional workspace ndarray for computing a real-valued discrete Fourier transform. +* +* @param n - sequence length +* @param options - function options +* @returns output ndarray +* +* @example +* var getDType = require( '@stdlib/ndarray/dtype' ); +* +* var ws = rffti( 4 ); +* // returns +* +* var dt = getDType( ws ); +* // returns 'float64' +* +* @example +* var zeros = require( '@stdlib/ndarray/zeros' ); +* +* var ws = zeros( [ 42 ], { 'dtype': 'float64' } ); +* +* var out = rffti.assign( ws, 4 ); +* // returns +* +* var bool = ( out === ws ); +* // returns true +*/ +declare const rffti: Rffti; + + +// EXPORTS // + +export = rffti; diff --git a/lib/node_modules/@stdlib/fft/rffti/docs/types/test.ts b/lib/node_modules/@stdlib/fft/rffti/docs/types/test.ts new file mode 100644 index 000000000000..5ccdd865d035 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/docs/types/test.ts @@ -0,0 +1,133 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable space-in-parens */ + +/// + +import zeros = require( '@stdlib/ndarray/zeros' ); +import rffti = require( './index' ); + + +// TESTS // + +// The function returns an ndarray... +{ + rffti( 4 ); // $ExpectType floatndarray + rffti( 4, {} ); // $ExpectType floatndarray + rffti( 4, { 'dtype': 'float64' } ); // $ExpectType floatndarray + rffti( 4, { 'dtype': 'float32' } ); // $ExpectType floatndarray +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + rffti( '5' ); // $ExpectError + rffti( true ); // $ExpectError + rffti( false ); // $ExpectError + rffti( null ); // $ExpectError + rffti( void 0 ); // $ExpectError + rffti( [] ); // $ExpectError + rffti( {} ); // $ExpectError + rffti( ( x: number ): number => x ); // $ExpectError + + rffti( '5', {} ); // $ExpectError + rffti( true, {} ); // $ExpectError + rffti( false, {} ); // $ExpectError + rffti( null, {} ); // $ExpectError + rffti( void 0, {} ); // $ExpectError + rffti( [], {} ); // $ExpectError + rffti( {}, {} ); // $ExpectError + rffti( ( x: number ): number => x, {} ); // $ExpectError +} + +// The compiler throws an error if the function is provided an options argument which is not an object... +{ + rffti( 4, '5' ); // $ExpectError + rffti( 4, 5 ); // $ExpectError + rffti( 4, true ); // $ExpectError + rffti( 4, false ); // $ExpectError + rffti( 4, null ); // $ExpectError + rffti( 4, [] ); // $ExpectError + rffti( 4, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an invalid `dtype` option... +{ + rffti( 4, { 'dtype': '5' } ); // $ExpectError + rffti( 4, { 'dtype': 5 } ); // $ExpectError + rffti( 4, { 'dtype': true } ); // $ExpectError + rffti( 4, { 'dtype': false } ); // $ExpectError + rffti( 4, { 'dtype': null } ); // $ExpectError + rffti( 4, { 'dtype': [] } ); // $ExpectError + rffti( 4, { 'dtype': {} } ); // $ExpectError + rffti( 4, { 'dtype': ( x: number ): number => x } ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + rffti(); // $ExpectError + rffti( 4, {}, {} ); // $ExpectError +} + +// Attached to the function is an `assign` method which returns an ndarray... +{ + const ws = zeros( [ 42 ], { + 'dtype': 'float64' + }); + + rffti.assign( ws, 4 ); // $ExpectType float64ndarray +} + +// The compiler throws an error if the `assign` method is provided a first argument which is not an ndarray... +{ + rffti.assign( '5', 4 ); // $ExpectError + rffti.assign( 5, 4 ); // $ExpectError + rffti.assign( true, 4 ); // $ExpectError + rffti.assign( false, 4 ); // $ExpectError + rffti.assign( null, 4 ); // $ExpectError + rffti.assign( void 0, 4 ); // $ExpectError + rffti.assign( {}, 4 ); // $ExpectError + rffti.assign( ( x: number ): number => x, 4 ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided a second argument which is not a number... +{ + const ws = zeros( [ 42 ], { + 'dtype': 'float64' + }); + + rffti.assign( ws, '5' ); // $ExpectError + rffti.assign( ws, true ); // $ExpectError + rffti.assign( ws, false ); // $ExpectError + rffti.assign( ws, null ); // $ExpectError + rffti.assign( ws, void 0 ); // $ExpectError + rffti.assign( ws, [] ); // $ExpectError + rffti.assign( ws, {} ); // $ExpectError + rffti.assign( ws, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... +{ + const ws = zeros( [ 42 ], { + 'dtype': 'float64' + }); + + rffti.assign(); // $ExpectError + rffti.assign( ws ); // $ExpectError + rffti.assign( ws, 4, {} ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/fft/rffti/examples/index.js b/lib/node_modules/@stdlib/fft/rffti/examples/index.js new file mode 100644 index 000000000000..7858dece30d8 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/examples/index.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var getDType = require( '@stdlib/ndarray/dtype' ); +var getShape = require( '@stdlib/ndarray/shape' ); +var rffti = require( './../lib' ); + +// Initialize a workspace for a sequence of length 8: +var ws = rffti( 8 ); +console.log( 'dtype: %s', getDType( ws ) ); +console.log( 'shape: [%s]', getShape( ws ).join( ', ' ) ); + +// Initialize a single-precision workspace: +var ws32 = rffti( 8, { + 'dtype': 'float32' +}); +console.log( 'dtype: %s', getDType( ws32 ) ); +console.log( 'shape: [%s]', getShape( ws32 ).join( ', ' ) ); diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/assign.js b/lib/node_modules/@stdlib/fft/rffti/lib/assign.js new file mode 100644 index 000000000000..e8a9799c6bb8 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/lib/assign.js @@ -0,0 +1,83 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; +var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); +var resolveStr = require( '@stdlib/ndarray/base/dtype-resolve-str' ); +var getDType = require( '@stdlib/ndarray/dtype' ); +var contains = require( '@stdlib/array/base/assert/contains' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var join = require( '@stdlib/array/base/join' ); +var format = require( '@stdlib/string/format' ); +var DTYPES = require( './dtypes.js' ).odtypes; +var base = require( './base.js' ); + + +// MAIN // + +/** +* Initializes a one-dimensional workspace ndarray for computing a real-valued discrete Fourier transform. +* +* @param {ndarrayLike} workspace - workspace ndarray +* @param {PositiveInteger} n - sequence length +* @throws {TypeError} first argument must be an ndarray-like object +* @throws {TypeError} first argument must have a supported data type +* @throws {TypeError} second argument must be a positive integer +* @returns {ndarray} input ndarray +* +* @example +* var zeros = require( '@stdlib/ndarray/zeros' ); +* +* var ws = zeros( [ 42 ], { 'dtype': 'float64' } ); +* +* var out = assign( ws, 4 ); +* // returns +* +* var bool = ( out === ws ); +* // returns true +*/ +function assign( workspace, n ) { + var dt; + + if ( !isndarrayLike( workspace ) ) { + throw new TypeError( format( 'invalid argument. First argument must be an ndarray. Value: `%s`.', workspace ) ); + } + dt = resolveStr( getDType( workspace ) ); + if ( !contains( DTYPES, dt ) ) { + throw new TypeError( format( 'invalid argument. First argument must have one of the following data types: "%s". Data type: `%s`.', join( DTYPES, '", "' ), dt ) ); + } + if ( !isPositiveInteger( n ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', n ) ); + } + + // Initialize the workspace: + base( workspace, scalar2ndarray( n, { + 'dtype': 'int32' + })); + + return workspace; +} + + +// EXPORTS // + +module.exports = assign; diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/base.js b/lib/node_modules/@stdlib/fft/rffti/lib/base.js new file mode 100644 index 000000000000..9b1cb2e82728 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/lib/base.js @@ -0,0 +1,84 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var dtypes = require( '@stdlib/ndarray/dtypes' ); +var factory = require( '@stdlib/ndarray/base/nullary-strided1d-dispatch-factory' ); +var drffti = require( '@stdlib/fft/base/fftpack/ndarray/float64/rffti' ); +var srffti = require( '@stdlib/fft/base/fftpack/ndarray/float32/rffti' ); +var grffti = require( '@stdlib/fft/base/fftpack/ndarray/generic/rffti' ); +var DTYPES = require( './dtypes.js' ).odtypes; + + +// VARIABLES // + +var idtypes0 = dtypes( 'integer_and_generic' ); +var table = { + 'types': [ + 'float64', // workspace + 'float32' // workspace + ], + 'fcns': [ + drffti, + srffti + ], + 'default': grffti +}; + + +// MAIN // + +/** +* Initializes a one-dimensional workspace ndarray for computing a real-valued discrete Fourier transform. +* +* @private +* @name rffti +* @type {Function} +* @param {ndarray} workspace - workspace ndarray +* @param {ndarray} N - zero-dimensional ndarray containing the sequence length +* @throws {TypeError} first argument must be an ndarray-like object +* @throws {TypeError} first argument must have a supported data type +* @throws {TypeError} second argument must be an ndarray-like object +* @throws {TypeError} options argument must be an object +* @throws {RangeError} dimension indices must not exceed input ndarray bounds +* @throws {RangeError} number of dimension indices must not exceed the number of input ndarray dimensions +* @throws {Error} must provide valid options +* @returns {ndarray} workspace ndarray +* +* @example +* var zeros = require( '@stdlib/ndarray/zeros' ); +* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +* +* var ws = zeros( [ 42 ], { +* 'dtype': 'float64' +* }); +* +* var out = rffti( ws, scalar2ndarray( 4, { +* 'dtype': 'int32' +* })); +* // returns +*/ +var rffti = factory( table, [ idtypes0 ], DTYPES ); + + +// EXPORTS // + +module.exports = rffti; diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/defaults.js b/lib/node_modules/@stdlib/fft/rffti/lib/defaults.js new file mode 100644 index 000000000000..e45486496685 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/lib/defaults.js @@ -0,0 +1,38 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MAIN // + +/** +* Returns default options. +* +* @private +* @returns {Object} default options +*/ +function defaults() { + return { + 'dtype': 'float64' + }; +} + + +// EXPORTS // + +module.exports = defaults; diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/dtypes.js b/lib/node_modules/@stdlib/fft/rffti/lib/dtypes.js new file mode 100644 index 000000000000..de783a611979 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/lib/dtypes.js @@ -0,0 +1,36 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var dtypes2strings = require( '@stdlib/ndarray/base/dtypes2strings' ); +var dtypes = require( '@stdlib/ndarray/dtypes' ); + + +// MAIN // + +var dt = { + 'odtypes': dtypes2strings( dtypes( 'real_floating_point' ) ) +}; + + +// EXPORTS // + +module.exports = dt; diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/index.js b/lib/node_modules/@stdlib/fft/rffti/lib/index.js new file mode 100644 index 000000000000..8329d7b09378 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/lib/index.js @@ -0,0 +1,75 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Return an initialized one-dimensional workspace ndarray for computing a real-valued discrete Fourier transform. +* +* @module @stdlib/fft/rffti +* +* @example +* var getDType = require( '@stdlib/ndarray/dtype' ); +* var rffti = require( '@stdlib/fft/rffti' ); +* +* var ws = rffti( 4 ); +* // returns +* +* var dt = getDType( ws ); +* // returns 'float64' +* +* @example +* var getDType = require( '@stdlib/ndarray/dtype' ); +* var rffti = require( '@stdlib/fft/rffti' ); +* +* var ws = rffti( 4, { 'dtype': 'float32' } ); +* // returns +* +* var dt = getDType( ws ); +* // returns 'float32' +* +* @example +* var zeros = require( '@stdlib/ndarray/zeros' ); +* var rffti = require( '@stdlib/fft/rffti' ); +* +* var ws = zeros( [ 42 ], { 'dtype': 'float64' } ); +* +* var out = rffti.assign( ws, 4 ); +* // returns +* +* var bool = ( out === ws ); +* // returns true +*/ + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var main = require( './main.js' ); +var assign = require( './assign.js' ); + + +// MAIN // + +setReadOnly( main, 'assign', assign ); + + +// EXPORTS // + +module.exports = main; + +// exports: { "assign": "main.assign" } diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/main.js b/lib/node_modules/@stdlib/fft/rffti/lib/main.js new file mode 100644 index 000000000000..c860e4deb72f --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/lib/main.js @@ -0,0 +1,109 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var hasOwnProp = require( '@stdlib/assert/has-own-property' ); +var isPlainObject = require( '@stdlib/assert/is-plain-object' ); +var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; +var isDataType = require( '@stdlib/ndarray/base/assert/is-data-type' ); +var resolveStr = require( '@stdlib/ndarray/base/dtype-resolve-str' ); +var contains = require( '@stdlib/array/base/assert/contains' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var zeros = require( '@stdlib/ndarray/zeros' ); +var join = require( '@stdlib/array/base/join' ); +var format = require( '@stdlib/string/format' ); +var DTYPES = require( './dtypes.js' ).odtypes; +var defaults = require( './defaults.js' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Returns an initialized one-dimensional workspace ndarray for computing a real-valued discrete Fourier transform. +* +* @param {PositiveInteger} n - sequence length +* @param {Options} [options] - function options +* @param {string} [options.dtype="float64"] - workspace data type +* @throws {TypeError} first argument must be a positive integer +* @throws {TypeError} options argument must be an object +* @throws {Error} must provide valid options +* @returns {ndarray} output ndarray +* +* @example +* var getDType = require( '@stdlib/ndarray/dtype' ); +* +* var ws = rffti( 4 ); +* // returns +* +* var dt = getDType( ws ); +* // returns 'float64' +* +* @example +* var getDType = require( '@stdlib/ndarray/dtype' ); +* +* var ws = rffti( 4, { 'dtype': 'float32' } ); +* // returns +* +* var dt = getDType( ws ); +* // returns 'float32' +*/ +function rffti( n ) { + var options; + var opts; + var dt; + var ws; + + if ( !isPositiveInteger( n ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', n ) ); + } + options = defaults(); + + if ( arguments.length > 1 ) { + opts = arguments[ 1 ]; + if ( !isPlainObject( opts ) ) { + throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) ); + } + if ( hasOwnProp( opts, 'dtype' ) ) { + dt = resolveStr( opts.dtype ); + if ( !isDataType( opts.dtype ) || !contains( DTYPES, dt ) ) { + throw new TypeError( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'dtype', join( DTYPES, '", "' ), opts.dtype ) ); + } + options.dtype = dt; + } + } + // Create the workspace ndarray: + ws = zeros( [ ( 2*n ) + 34 ], { + 'dtype': options.dtype + }); + + // Initialize the workspace: + base( ws, scalar2ndarray( n, { + 'dtype': 'int32' + })); + + return ws; +} + + +// EXPORTS // + +module.exports = rffti; diff --git a/lib/node_modules/@stdlib/fft/rffti/package.json b/lib/node_modules/@stdlib/fft/rffti/package.json new file mode 100644 index 000000000000..eb27ac331d39 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/package.json @@ -0,0 +1,65 @@ +{ + "name": "@stdlib/fft/rffti", + "version": "0.0.0", + "description": "Return an initialized one-dimensional workspace ndarray for computing a real-valued discrete Fourier transform.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "fft", + "fourier", + "transform", + "workspace", + "initialize", + "rffti", + "ndarray" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/fft/rffti/test/test.assign.js b/lib/node_modules/@stdlib/fft/rffti/test/test.assign.js new file mode 100644 index 000000000000..096bd9420c33 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/test/test.assign.js @@ -0,0 +1,152 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var getDType = require( '@stdlib/ndarray/dtype' ); +var zeros = require( '@stdlib/ndarray/zeros' ); +var assign = require( './../lib/assign.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof assign, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not an ndarray-like object', function test( t ) { + var values; + var i; + + values = [ + '5', + 5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + assign( value, 4 ); + }; + } +}); + +tape( 'the function throws an error if provided a first argument which is not an ndarray-like object having a supported data type', function test( t ) { + var values; + var i; + + values = [ + zeros( [ 42 ], { + 'dtype': 'int32' + }), + zeros( [ 42 ], { + 'dtype': 'generic' + }) + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + assign( value, 4 ); + }; + } +}); + +tape( 'the function throws an error if provided a second argument which is not a positive integer', function test( t ) { + var values; + var ws; + var i; + + ws = zeros( [ 42 ], { + 'dtype': 'float64' + }); + + values = [ + '5', + -1, + 0, + 3.14, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + assign( ws, value ); + }; + } +}); + +tape( 'the function initializes a provided float64 workspace ndarray', function test( t ) { + var out; + var ws; + + ws = zeros( [ 42 ], { + 'dtype': 'float64' + }); + out = assign( ws, 4 ); + + t.strictEqual( out, ws, 'returns expected value' ); + t.strictEqual( String( getDType( out ) ), 'float64', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function initializes a provided float32 workspace ndarray', function test( t ) { + var out; + var ws; + + ws = zeros( [ 42 ], { + 'dtype': 'float32' + }); + out = assign( ws, 4 ); + + t.strictEqual( out, ws, 'returns expected value' ); + t.strictEqual( String( getDType( out ) ), 'float32', 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/fft/rffti/test/test.js b/lib/node_modules/@stdlib/fft/rffti/test/test.js new file mode 100644 index 000000000000..e4d642f9d7e3 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/test/test.js @@ -0,0 +1,39 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isMethod = require( '@stdlib/assert/is-method' ); +var rffti = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof rffti, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is an `assign` method', function test( t ) { + t.strictEqual( isMethod( rffti, 'assign' ), true, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/fft/rffti/test/test.main.js b/lib/node_modules/@stdlib/fft/rffti/test/test.main.js new file mode 100644 index 000000000000..3c92adbabfc3 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/rffti/test/test.main.js @@ -0,0 +1,177 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var getDType = require( '@stdlib/ndarray/dtype' ); +var getShape = require( '@stdlib/ndarray/shape' ); +var rffti = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof rffti, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not a positive integer', function test( t ) { + var values; + var i; + + values = [ + '5', + -1, + 0, + 3.14, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + rffti( value ); + }; + } +}); + +tape( 'the function throws an error if provided a first argument which is not a positive integer (options)', function test( t ) { + var values; + var i; + + values = [ + '5', + -1, + 0, + 3.14, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + rffti( value, {} ); + }; + } +}); + +tape( 'the function throws an error if provided a second argument which is not an object', function test( t ) { + var values; + var i; + + values = [ + '5', + 5, + NaN, + true, + false, + null, + void 0, + [], + function noop() {} + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + rffti( 4, value ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid `dtype` option', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bool', + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + rffti( 4, { + 'dtype': value + }); + }; + } +}); + +tape( 'the function supports specifying an output data type', function test( t ) { + var ws = rffti( 4, { + 'dtype': 'float32' + }); + + t.strictEqual( String( getDType( ws ) ), 'float32', 'returns expected value' ); + t.deepEqual( getShape( ws ), [ 42 ], 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a workspace of correct size', function test( t ) { + var ws; + + ws = rffti( 1 ); + t.deepEqual( getShape( ws ), [ 36 ], 'returns expected value' ); // 2*n + 34 + + ws = rffti( 8 ); + t.deepEqual( getShape( ws ), [ 50 ], 'returns expected value' ); // 2*n + 34 + + ws = rffti( 16 ); + t.deepEqual( getShape( ws ), [ 66 ], 'returns expected value' ); // 2*n + 34 + + t.end(); +}); From f2b84298ed13ccd5c3558f8a4081052bcab02e20 Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 28 Oct 2026 19:21:45 +0100 Subject: [PATCH 02/10] Apply batched suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../@stdlib/fft/rffti/benchmark/benchmark.assign.js | 2 +- lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.assign.js b/lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.assign.js index f929119b0bb5..14cc61d1578f 100644 --- a/lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.assign.js +++ b/lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.assign.js @@ -62,7 +62,7 @@ function createBenchmark( len ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { out = assign( ws, len ); - if ( !isndarrayLike( out ) ) { + if ( typeof out !== 'object' ) { b.fail( 'should return an ndarray' ); } } diff --git a/lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.js b/lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.js index 37bdded76e93..16f0268abe95 100644 --- a/lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.js @@ -60,7 +60,7 @@ function createBenchmark( len ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { ws = rffti( len, options ); - if ( !isndarrayLike( ws ) ) { + if ( typeof ws !== 'object' ) { b.fail( 'should return an ndarray' ); } } From ff11594d6e4d6c4453dad3f39585ad14d66acc4f Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 28 Oct 2026 19:23:12 +0100 Subject: [PATCH 03/10] Apply batched suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/fft/rffti/docs/types/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/fft/rffti/docs/types/index.d.ts b/lib/node_modules/@stdlib/fft/rffti/docs/types/index.d.ts index 8f4f1f33749c..18770cf3d46e 100644 --- a/lib/node_modules/@stdlib/fft/rffti/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/fft/rffti/docs/types/index.d.ts @@ -54,7 +54,7 @@ interface Rffti { * var ws = rffti( 4 ); * // returns * - * var dt = getDType( ws ); + * var dt = String( getDType( ws ) ); * // returns 'float64' */ ( n: number, options?: Options ): OutputArray; @@ -93,7 +93,7 @@ interface Rffti { * var ws = rffti( 4 ); * // returns * -* var dt = getDType( ws ); +* var dt = String( getDType( ws ) ); * // returns 'float64' * * @example From 5febe52693fa46d2dda9834c603ba4763fbb59af Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 28 Oct 2026 19:31:43 +0100 Subject: [PATCH 04/10] Apply suggestion from @kgryte Signed-off-by: Athan --- lib/node_modules/@stdlib/fft/rffti/docs/repl.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/fft/rffti/docs/repl.txt b/lib/node_modules/@stdlib/fft/rffti/docs/repl.txt index 20c5f3f30b06..3c065fe41b1e 100644 --- a/lib/node_modules/@stdlib/fft/rffti/docs/repl.txt +++ b/lib/node_modules/@stdlib/fft/rffti/docs/repl.txt @@ -11,7 +11,7 @@ options: Object (optional) Function options. - options.dtype: string (optional) + options.dtype: string|DataType (optional) Output workspace ndarray data type. Must be a real-valued floating-point data type. Default: 'float64'. From 6ed05a4be8c07ecae77e80cb5402dd4b28be31eb Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 28 Oct 2026 19:38:49 +0100 Subject: [PATCH 05/10] Apply batched suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/fft/rffti/lib/assign.js | 8 ++++---- lib/node_modules/@stdlib/fft/rffti/lib/base.js | 4 ---- lib/node_modules/@stdlib/fft/rffti/lib/dtypes.js | 2 +- lib/node_modules/@stdlib/fft/rffti/lib/index.js | 4 ++-- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/assign.js b/lib/node_modules/@stdlib/fft/rffti/lib/assign.js index e8a9799c6bb8..e095a0c5b166 100644 --- a/lib/node_modules/@stdlib/fft/rffti/lib/assign.js +++ b/lib/node_modules/@stdlib/fft/rffti/lib/assign.js @@ -21,7 +21,7 @@ // MODULES // var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; -var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); +var isvectorLike = require( '@stdlib/assert/is-vector-like' ); var resolveStr = require( '@stdlib/ndarray/base/dtype-resolve-str' ); var getDType = require( '@stdlib/ndarray/dtype' ); var contains = require( '@stdlib/array/base/assert/contains' ); @@ -39,7 +39,7 @@ var base = require( './base.js' ); * * @param {ndarrayLike} workspace - workspace ndarray * @param {PositiveInteger} n - sequence length -* @throws {TypeError} first argument must be an ndarray-like object +* @throws {TypeError} first argument must be a one-dimensional ndarray-like object * @throws {TypeError} first argument must have a supported data type * @throws {TypeError} second argument must be a positive integer * @returns {ndarray} input ndarray @@ -58,8 +58,8 @@ var base = require( './base.js' ); function assign( workspace, n ) { var dt; - if ( !isndarrayLike( workspace ) ) { - throw new TypeError( format( 'invalid argument. First argument must be an ndarray. Value: `%s`.', workspace ) ); + if ( !isvectorLike( workspace ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a one-dimensional ndarray. Value: `%s`.', workspace ) ); } dt = resolveStr( getDType( workspace ) ); if ( !contains( DTYPES, dt ) ) { diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/base.js b/lib/node_modules/@stdlib/fft/rffti/lib/base.js index 9b1cb2e82728..9e6cf6acb19f 100644 --- a/lib/node_modules/@stdlib/fft/rffti/lib/base.js +++ b/lib/node_modules/@stdlib/fft/rffti/lib/base.js @@ -57,10 +57,6 @@ var table = { * @throws {TypeError} first argument must be an ndarray-like object * @throws {TypeError} first argument must have a supported data type * @throws {TypeError} second argument must be an ndarray-like object -* @throws {TypeError} options argument must be an object -* @throws {RangeError} dimension indices must not exceed input ndarray bounds -* @throws {RangeError} number of dimension indices must not exceed the number of input ndarray dimensions -* @throws {Error} must provide valid options * @returns {ndarray} workspace ndarray * * @example diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/dtypes.js b/lib/node_modules/@stdlib/fft/rffti/lib/dtypes.js index de783a611979..7833cdab61cc 100644 --- a/lib/node_modules/@stdlib/fft/rffti/lib/dtypes.js +++ b/lib/node_modules/@stdlib/fft/rffti/lib/dtypes.js @@ -27,7 +27,7 @@ var dtypes = require( '@stdlib/ndarray/dtypes' ); // MAIN // var dt = { - 'odtypes': dtypes2strings( dtypes( 'real_floating_point' ) ) + 'odtypes': dtypes2strings( dtypes( 'real_floating_point_and_generic' ) ) }; diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/index.js b/lib/node_modules/@stdlib/fft/rffti/lib/index.js index 8329d7b09378..27abf12ee058 100644 --- a/lib/node_modules/@stdlib/fft/rffti/lib/index.js +++ b/lib/node_modules/@stdlib/fft/rffti/lib/index.js @@ -30,7 +30,7 @@ * var ws = rffti( 4 ); * // returns * -* var dt = getDType( ws ); +* var dt = String( getDType( ws ) ); * // returns 'float64' * * @example @@ -40,7 +40,7 @@ * var ws = rffti( 4, { 'dtype': 'float32' } ); * // returns * -* var dt = getDType( ws ); +* var dt = String( getDType( ws ) ); * // returns 'float32' * * @example From dcb0ffbc5f35f1581af48e43fc8f977c50d914f0 Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 28 Oct 2026 19:40:59 +0100 Subject: [PATCH 06/10] Apply batched suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/fft/rffti/lib/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/main.js b/lib/node_modules/@stdlib/fft/rffti/lib/main.js index c860e4deb72f..64141d16ec64 100644 --- a/lib/node_modules/@stdlib/fft/rffti/lib/main.js +++ b/lib/node_modules/@stdlib/fft/rffti/lib/main.js @@ -54,7 +54,7 @@ var base = require( './base.js' ); * var ws = rffti( 4 ); * // returns * -* var dt = getDType( ws ); +* var dt = String( getDType( ws ) ); * // returns 'float64' * * @example @@ -63,7 +63,7 @@ var base = require( './base.js' ); * var ws = rffti( 4, { 'dtype': 'float32' } ); * // returns * -* var dt = getDType( ws ); +* var dt = String( getDType( ws ) ); * // returns 'float32' */ function rffti( n ) { From 7aac021da977b1b432b8c54f21ffcdf8eb13754c Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 28 Oct 2026 19:45:04 +0100 Subject: [PATCH 07/10] Apply batched suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/fft/rffti/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/fft/rffti/README.md b/lib/node_modules/@stdlib/fft/rffti/README.md index ffcb718881e6..b08f9d835a06 100644 --- a/lib/node_modules/@stdlib/fft/rffti/README.md +++ b/lib/node_modules/@stdlib/fft/rffti/README.md @@ -41,7 +41,7 @@ var getShape = require( '@stdlib/ndarray/shape' ); var ws = rffti( 4 ); // returns -var dt = getDType( ws ); +var dt = String( getDType( ws ) ); // returns 'float64' var sh = getShape( ws ); @@ -67,7 +67,7 @@ var ws = rffti( 4, { }); // returns -var dt = getDType( ws ); +var dt = String( getDType( ws ) ); // returns 'float32' ``` From 29a82bd51cad03a37804a8ee45ed031f755d996a Mon Sep 17 00:00:00 2001 From: Gunj Joshi Date: Fri, 30 Oct 2026 00:31:18 +0530 Subject: [PATCH 08/10] test: update tests to test for values --- .../@stdlib/fft/rffti/test/test.assign.js | 110 ++++++++++++++++- .../@stdlib/fft/rffti/test/test.main.js | 112 ++++++++++++++++++ 2 files changed, 218 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/fft/rffti/test/test.assign.js b/lib/node_modules/@stdlib/fft/rffti/test/test.assign.js index 096bd9420c33..086ee66f805a 100644 --- a/lib/node_modules/@stdlib/fft/rffti/test/test.assign.js +++ b/lib/node_modules/@stdlib/fft/rffti/test/test.assign.js @@ -21,7 +21,12 @@ // MODULES // var tape = require( 'tape' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); +var Float64Array = require( '@stdlib/array/float64' ); +var Float32Array = require( '@stdlib/array/float32' ); +var Uint32Array = require( '@stdlib/array/uint32' ); var getDType = require( '@stdlib/ndarray/dtype' ); +var getData = require( '@stdlib/ndarray/data-buffer' ); var zeros = require( '@stdlib/ndarray/zeros' ); var assign = require( './../lib/assign.js' ); @@ -122,31 +127,128 @@ tape( 'the function throws an error if provided a second argument which is not a }); tape( 'the function initializes a provided float64 workspace ndarray', function test( t ) { + var expectedTwiddles; + var expectedFactors; + var ulps; var out; + var buf; var ws; + var N; + var y; + var e; + var i; - ws = zeros( [ 42 ], { + N = 8; + ws = zeros( [ ( 2*N ) + 34 ], { 'dtype': 'float64' }); - out = assign( ws, 4 ); + out = assign( ws, N ); t.strictEqual( out, ws, 'returns expected value' ); t.strictEqual( String( getDType( out ) ), 'float64', 'returns expected value' ); + buf = getData( ws ); + + expectedTwiddles = new Float64Array( [ 0.7071067811865476, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + expectedFactors = new Float64Array( [ 8.0, 2.0, 2.0, 4.0 ] ); + + ulps = 1; + for ( i = 0; i < expectedTwiddles.length; i++ ) { + y = buf[ N+i ]; + e = expectedTwiddles[ i ]; + t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within ' + ulps + ' ULPs. N: ' + N + '. y: ' + y + '. E: ' + e ); + } + for ( i = 0; i < expectedFactors.length; i++ ) { + y = buf[ ( 2*N ) + i ]; + e = expectedFactors[ i ]; + t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within ' + ulps + ' ULPs. N: ' + N + '. y: ' + y + '. E: ' + e ); + } + for ( i = 0; i < N; i++ ) { + y = buf[ i ]; + e = 0.0; + t.strictEqual( y, e, 'returns expected value' ); + } t.end(); }); tape( 'the function initializes a provided float32 workspace ndarray', function test( t ) { + var expectedTwiddles; + var expectedFactors; + var fview; + var ulps; var out; + var buf; var ws; + var N; + var y; + var e; + var i; - ws = zeros( [ 42 ], { + N = 8; + ws = zeros( [ ( 2*N ) + 34 ], { 'dtype': 'float32' }); - out = assign( ws, 4 ); + out = assign( ws, N ); t.strictEqual( out, ws, 'returns expected value' ); t.strictEqual( String( getDType( out ) ), 'float32', 'returns expected value' ); + buf = getData( ws ); + + expectedTwiddles = new Float32Array( [ 0.7071067690849304, 0.7071067690849304, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + expectedFactors = new Uint32Array( [ 8, 2, 2, 4 ] ); + + ulps = 1; + for ( i = 0; i < expectedTwiddles.length; i++ ) { + y = buf[ N+i ]; + e = expectedTwiddles[ i ]; + t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within ' + ulps + ' ULPs. N: ' + N + '. y: ' + y + '. E: ' + e ); + } + fview = new Uint32Array( buf.buffer, buf.byteOffset, buf.length ); + for ( i = 0; i < expectedFactors.length; i++ ) { + y = fview[ ( 2*N ) + i ]; + e = expectedFactors[ i ]; + t.strictEqual( y, e, 'returns expected integer factor. N: ' + N + '. y: ' + y + '. E: ' + e ); + } + for ( i = 0; i < N; i++ ) { + y = buf[ i ]; + e = 0.0; + t.strictEqual( y, e, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function initializes a provided generic workspace ndarray', function test( t ) { + var expectedTwiddles; + var expectedFactors; + var out; + var buf; + var ws; + var N; + var i; + + N = 8; + ws = zeros( [ ( 2*N ) + 34 ], { + 'dtype': 'generic' + }); + out = assign( ws, N ); + + t.strictEqual( out, ws, 'returns expected value' ); + t.strictEqual( String( getDType( out ) ), 'generic', 'returns expected value' ); + + buf = getData( ws ); + + expectedTwiddles = [ 0.7071067811865476, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; + expectedFactors = [ 8, 2, 2, 4 ]; + + for ( i = 0; i < N; i++ ) { + t.strictEqual( buf[ N+i ], expectedTwiddles[ i ], 'returns expected twiddle factor at index ' + i ); + } + for ( i = 0; i < expectedFactors.length; i++ ) { + t.strictEqual( buf[ (2*N)+i ], expectedFactors[ i ], 'returns expected integer factor at index ' + i ); + } + for ( i = 0; i < N; i++ ) { + t.strictEqual( buf[ i ], 0, 'returns expected scratch space value at index ' + i ); + } t.end(); }); diff --git a/lib/node_modules/@stdlib/fft/rffti/test/test.main.js b/lib/node_modules/@stdlib/fft/rffti/test/test.main.js index 3c92adbabfc3..d7951a10fa17 100644 --- a/lib/node_modules/@stdlib/fft/rffti/test/test.main.js +++ b/lib/node_modules/@stdlib/fft/rffti/test/test.main.js @@ -21,8 +21,13 @@ // MODULES // var tape = require( 'tape' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); +var Float64Array = require( '@stdlib/array/float64' ); +var Float32Array = require( '@stdlib/array/float32' ); +var Uint32Array = require( '@stdlib/array/uint32' ); var getDType = require( '@stdlib/ndarray/dtype' ); var getShape = require( '@stdlib/ndarray/shape' ); +var getData = require( '@stdlib/ndarray/data-buffer' ); var rffti = require( './../lib' ); @@ -175,3 +180,110 @@ tape( 'the function returns a workspace of correct size', function test( t ) { t.end(); }); + +tape( 'the function returns a float64 workspace ndarray', function test( t ) { + var expectedTwiddles; + var expectedFactors; + var ulps; + var buf; + var ws; + var N; + var y; + var e; + var i; + + N = 8; + ws = rffti( N ); + buf = getData( ws ); + + expectedTwiddles = new Float64Array( [ 0.7071067811865476, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + expectedFactors = new Float64Array( [ 8.0, 2.0, 2.0, 4.0 ] ); + + ulps = 1; + for ( i = 0; i < expectedTwiddles.length; i++ ) { + y = buf[ N+i ]; + e = expectedTwiddles[ i ]; + t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within ' + ulps + ' ULPs. N: ' + N + '. y: ' + y + '. E: ' + e ); + } + for ( i = 0; i < expectedFactors.length; i++ ) { + y = buf[ ( 2*N ) + i ]; + e = expectedFactors[ i ]; + t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within ' + ulps + ' ULPs. N: ' + N + '. y: ' + y + '. E: ' + e ); + } + for ( i = 0; i < N; i++ ) { + y = buf[ i ]; + e = 0.0; + t.strictEqual( y, e, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a float32 workspace ndarray', function test( t ) { + var expectedTwiddles; + var expectedFactors; + var fview; + var ulps; + var buf; + var ws; + var N; + var y; + var e; + var i; + + N = 8; + ws = rffti( N, { + 'dtype': 'float32' + }); + buf = getData( ws ); + + expectedTwiddles = new Float32Array( [ 0.7071067690849304, 0.7071067690849304, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + expectedFactors = new Uint32Array( [ 8, 2, 2, 4 ] ); + + ulps = 1; + for ( i = 0; i < expectedTwiddles.length; i++ ) { + y = buf[ N+i ]; + e = expectedTwiddles[ i ]; + t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within ' + ulps + ' ULPs. N: ' + N + '. y: ' + y + '. E: ' + e ); + } + fview = new Uint32Array( buf.buffer, buf.byteOffset, buf.length ); + for ( i = 0; i < expectedFactors.length; i++ ) { + y = fview[ ( 2*N ) + i ]; + e = expectedFactors[ i ]; + t.strictEqual( y, e, 'returns expected integer factor. N: ' + N + '. y: ' + y + '. E: ' + e ); + } + for ( i = 0; i < N; i++ ) { + y = buf[ i ]; + e = 0.0; + t.strictEqual( y, e, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a generic workspace ndarray', function test( t ) { + var expectedTwiddles; + var expectedFactors; + var buf; + var ws; + var N; + var i; + + N = 8; + ws = rffti( N, { + 'dtype': 'generic' + }); + buf = getData( ws ); + + expectedTwiddles = [ 0.7071067811865476, 0.7071067811865475, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; + expectedFactors = [ 8, 2, 2, 4 ]; + + for ( i = 0; i < N; i++ ) { + t.strictEqual( buf[ N+i ], expectedTwiddles[ i ], 'returns expected twiddle factor at index ' + i ); + } + for ( i = 0; i < expectedFactors.length; i++ ) { + t.strictEqual( buf[ (2*N)+i ], expectedFactors[ i ], 'returns expected integer factor at index ' + i ); + } + for ( i = 0; i < N; i++ ) { + t.strictEqual( buf[ i ], 0, 'returns expected scratch space value at index ' + i ); + } + t.end(); +}); From a9d7fa6715ad9a80f4fbab1b7dcfa142b15dc428 Mon Sep 17 00:00:00 2001 From: Gunj Joshi Date: Fri, 30 Oct 2026 00:33:11 +0530 Subject: [PATCH 09/10] test: update tests to test for values --- lib/node_modules/@stdlib/fft/rffti/test/test.assign.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/node_modules/@stdlib/fft/rffti/test/test.assign.js b/lib/node_modules/@stdlib/fft/rffti/test/test.assign.js index 086ee66f805a..ef2989eb0600 100644 --- a/lib/node_modules/@stdlib/fft/rffti/test/test.assign.js +++ b/lib/node_modules/@stdlib/fft/rffti/test/test.assign.js @@ -74,9 +74,6 @@ tape( 'the function throws an error if provided a first argument which is not an values = [ zeros( [ 42 ], { 'dtype': 'int32' - }), - zeros( [ 42 ], { - 'dtype': 'generic' }) ]; for ( i = 0; i < values.length; i++ ) { From 968fbf5c778384359dd4ab2d56d7204ef134af4f Mon Sep 17 00:00:00 2001 From: Gunj Joshi Date: Fri, 30 Oct 2026 00:57:51 +0530 Subject: [PATCH 10/10] chore: rename to fft/fftpack/rffti --- .../@stdlib/fft/{ => fftpack}/rffti/README.md | 4 ++-- .../fft/{ => fftpack}/rffti/benchmark/benchmark.assign.js | 0 .../fft/{ => fftpack}/rffti/benchmark/benchmark.js | 0 .../@stdlib/fft/{ => fftpack}/rffti/docs/repl.txt | 0 .../@stdlib/fft/{ => fftpack}/rffti/docs/types/index.d.ts | 0 .../@stdlib/fft/{ => fftpack}/rffti/docs/types/test.ts | 0 .../@stdlib/fft/{ => fftpack}/rffti/examples/index.js | 0 .../@stdlib/fft/{ => fftpack}/rffti/lib/assign.js | 0 .../@stdlib/fft/{ => fftpack}/rffti/lib/base.js | 0 .../@stdlib/fft/{ => fftpack}/rffti/lib/defaults.js | 0 .../@stdlib/fft/{ => fftpack}/rffti/lib/dtypes.js | 0 .../@stdlib/fft/{ => fftpack}/rffti/lib/index.js | 8 ++++---- .../@stdlib/fft/{ => fftpack}/rffti/lib/main.js | 0 .../@stdlib/fft/{ => fftpack}/rffti/package.json | 2 +- .../@stdlib/fft/{ => fftpack}/rffti/test/test.assign.js | 0 .../@stdlib/fft/{ => fftpack}/rffti/test/test.js | 0 .../@stdlib/fft/{ => fftpack}/rffti/test/test.main.js | 0 17 files changed, 7 insertions(+), 7 deletions(-) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/README.md (97%) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/benchmark/benchmark.assign.js (100%) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/benchmark/benchmark.js (100%) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/docs/repl.txt (100%) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/docs/types/index.d.ts (100%) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/docs/types/test.ts (100%) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/examples/index.js (100%) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/lib/assign.js (100%) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/lib/base.js (100%) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/lib/defaults.js (100%) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/lib/dtypes.js (100%) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/lib/index.js (89%) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/lib/main.js (100%) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/package.json (97%) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/test/test.assign.js (100%) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/test/test.js (100%) rename lib/node_modules/@stdlib/fft/{ => fftpack}/rffti/test/test.main.js (100%) diff --git a/lib/node_modules/@stdlib/fft/rffti/README.md b/lib/node_modules/@stdlib/fft/fftpack/rffti/README.md similarity index 97% rename from lib/node_modules/@stdlib/fft/rffti/README.md rename to lib/node_modules/@stdlib/fft/fftpack/rffti/README.md index b08f9d835a06..4e1fbaa0c2ba 100644 --- a/lib/node_modules/@stdlib/fft/rffti/README.md +++ b/lib/node_modules/@stdlib/fft/fftpack/rffti/README.md @@ -27,7 +27,7 @@ limitations under the License. ## Usage ```javascript -var rffti = require( '@stdlib/fft/rffti' ); +var rffti = require( '@stdlib/fft/fftpack/rffti' ); ``` #### rffti( n\[, options] ) @@ -119,7 +119,7 @@ The function has the following parameters: ```javascript var getDType = require( '@stdlib/ndarray/dtype' ); var getShape = require( '@stdlib/ndarray/shape' ); -var rffti = require( '@stdlib/fft/rffti' ); +var rffti = require( '@stdlib/fft/fftpack/rffti' ); // Initialize a workspace for a sequence of length 8: var ws = rffti( 8 ); diff --git a/lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.assign.js b/lib/node_modules/@stdlib/fft/fftpack/rffti/benchmark/benchmark.assign.js similarity index 100% rename from lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.assign.js rename to lib/node_modules/@stdlib/fft/fftpack/rffti/benchmark/benchmark.assign.js diff --git a/lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.js b/lib/node_modules/@stdlib/fft/fftpack/rffti/benchmark/benchmark.js similarity index 100% rename from lib/node_modules/@stdlib/fft/rffti/benchmark/benchmark.js rename to lib/node_modules/@stdlib/fft/fftpack/rffti/benchmark/benchmark.js diff --git a/lib/node_modules/@stdlib/fft/rffti/docs/repl.txt b/lib/node_modules/@stdlib/fft/fftpack/rffti/docs/repl.txt similarity index 100% rename from lib/node_modules/@stdlib/fft/rffti/docs/repl.txt rename to lib/node_modules/@stdlib/fft/fftpack/rffti/docs/repl.txt diff --git a/lib/node_modules/@stdlib/fft/rffti/docs/types/index.d.ts b/lib/node_modules/@stdlib/fft/fftpack/rffti/docs/types/index.d.ts similarity index 100% rename from lib/node_modules/@stdlib/fft/rffti/docs/types/index.d.ts rename to lib/node_modules/@stdlib/fft/fftpack/rffti/docs/types/index.d.ts diff --git a/lib/node_modules/@stdlib/fft/rffti/docs/types/test.ts b/lib/node_modules/@stdlib/fft/fftpack/rffti/docs/types/test.ts similarity index 100% rename from lib/node_modules/@stdlib/fft/rffti/docs/types/test.ts rename to lib/node_modules/@stdlib/fft/fftpack/rffti/docs/types/test.ts diff --git a/lib/node_modules/@stdlib/fft/rffti/examples/index.js b/lib/node_modules/@stdlib/fft/fftpack/rffti/examples/index.js similarity index 100% rename from lib/node_modules/@stdlib/fft/rffti/examples/index.js rename to lib/node_modules/@stdlib/fft/fftpack/rffti/examples/index.js diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/assign.js b/lib/node_modules/@stdlib/fft/fftpack/rffti/lib/assign.js similarity index 100% rename from lib/node_modules/@stdlib/fft/rffti/lib/assign.js rename to lib/node_modules/@stdlib/fft/fftpack/rffti/lib/assign.js diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/base.js b/lib/node_modules/@stdlib/fft/fftpack/rffti/lib/base.js similarity index 100% rename from lib/node_modules/@stdlib/fft/rffti/lib/base.js rename to lib/node_modules/@stdlib/fft/fftpack/rffti/lib/base.js diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/defaults.js b/lib/node_modules/@stdlib/fft/fftpack/rffti/lib/defaults.js similarity index 100% rename from lib/node_modules/@stdlib/fft/rffti/lib/defaults.js rename to lib/node_modules/@stdlib/fft/fftpack/rffti/lib/defaults.js diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/dtypes.js b/lib/node_modules/@stdlib/fft/fftpack/rffti/lib/dtypes.js similarity index 100% rename from lib/node_modules/@stdlib/fft/rffti/lib/dtypes.js rename to lib/node_modules/@stdlib/fft/fftpack/rffti/lib/dtypes.js diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/index.js b/lib/node_modules/@stdlib/fft/fftpack/rffti/lib/index.js similarity index 89% rename from lib/node_modules/@stdlib/fft/rffti/lib/index.js rename to lib/node_modules/@stdlib/fft/fftpack/rffti/lib/index.js index 27abf12ee058..1820f27a9f2f 100644 --- a/lib/node_modules/@stdlib/fft/rffti/lib/index.js +++ b/lib/node_modules/@stdlib/fft/fftpack/rffti/lib/index.js @@ -21,11 +21,11 @@ /** * Return an initialized one-dimensional workspace ndarray for computing a real-valued discrete Fourier transform. * -* @module @stdlib/fft/rffti +* @module @stdlib/fft/fftpack/rffti * * @example * var getDType = require( '@stdlib/ndarray/dtype' ); -* var rffti = require( '@stdlib/fft/rffti' ); +* var rffti = require( '@stdlib/fft/fftpack/rffti' ); * * var ws = rffti( 4 ); * // returns @@ -35,7 +35,7 @@ * * @example * var getDType = require( '@stdlib/ndarray/dtype' ); -* var rffti = require( '@stdlib/fft/rffti' ); +* var rffti = require( '@stdlib/fft/fftpack/rffti' ); * * var ws = rffti( 4, { 'dtype': 'float32' } ); * // returns @@ -45,7 +45,7 @@ * * @example * var zeros = require( '@stdlib/ndarray/zeros' ); -* var rffti = require( '@stdlib/fft/rffti' ); +* var rffti = require( '@stdlib/fft/fftpack/rffti' ); * * var ws = zeros( [ 42 ], { 'dtype': 'float64' } ); * diff --git a/lib/node_modules/@stdlib/fft/rffti/lib/main.js b/lib/node_modules/@stdlib/fft/fftpack/rffti/lib/main.js similarity index 100% rename from lib/node_modules/@stdlib/fft/rffti/lib/main.js rename to lib/node_modules/@stdlib/fft/fftpack/rffti/lib/main.js diff --git a/lib/node_modules/@stdlib/fft/rffti/package.json b/lib/node_modules/@stdlib/fft/fftpack/rffti/package.json similarity index 97% rename from lib/node_modules/@stdlib/fft/rffti/package.json rename to lib/node_modules/@stdlib/fft/fftpack/rffti/package.json index eb27ac331d39..a9525c73265d 100644 --- a/lib/node_modules/@stdlib/fft/rffti/package.json +++ b/lib/node_modules/@stdlib/fft/fftpack/rffti/package.json @@ -1,5 +1,5 @@ { - "name": "@stdlib/fft/rffti", + "name": "@stdlib/fft/fftpack/rffti", "version": "0.0.0", "description": "Return an initialized one-dimensional workspace ndarray for computing a real-valued discrete Fourier transform.", "license": "Apache-2.0", diff --git a/lib/node_modules/@stdlib/fft/rffti/test/test.assign.js b/lib/node_modules/@stdlib/fft/fftpack/rffti/test/test.assign.js similarity index 100% rename from lib/node_modules/@stdlib/fft/rffti/test/test.assign.js rename to lib/node_modules/@stdlib/fft/fftpack/rffti/test/test.assign.js diff --git a/lib/node_modules/@stdlib/fft/rffti/test/test.js b/lib/node_modules/@stdlib/fft/fftpack/rffti/test/test.js similarity index 100% rename from lib/node_modules/@stdlib/fft/rffti/test/test.js rename to lib/node_modules/@stdlib/fft/fftpack/rffti/test/test.js diff --git a/lib/node_modules/@stdlib/fft/rffti/test/test.main.js b/lib/node_modules/@stdlib/fft/fftpack/rffti/test/test.main.js similarity index 100% rename from lib/node_modules/@stdlib/fft/rffti/test/test.main.js rename to lib/node_modules/@stdlib/fft/fftpack/rffti/test/test.main.js