From ce2e22bb6394b33d4ae735badaf064e65f0e32a1 Mon Sep 17 00:00:00 2001 From: GUNJ JOSHI Date: Tue, 8 Oct 2024 21:03:17 +0530 Subject: [PATCH] build: update scaffolding for creating unary math strided packages --- .../data/README__md.txt | 6 +- .../data/benchmark/benchmark__js.txt | 6 +- .../data/benchmark/benchmark__native__js.txt | 6 +- .../data/benchmark/benchmark__ndarray__js.txt | 6 +- .../benchmark__ndarray__native__js.txt | 6 +- .../data/benchmark/c/Makefile.txt | 2 + .../data/benchmark/c/benchmark__length__c.txt | 8 +- .../data/binding__gyp.txt | 2 + .../data/docs/types/index__d__ts.txt | 2 + .../data/docs/types/test__ts.txt | 2 + .../data/examples/c/Makefile.txt | 2 + .../data/examples/c/example__c.txt | 2 + .../data/examples/index__js.txt | 2 + .../data/include/alias__h.txt | 2 + .../data/include__gypi.txt | 2 + .../data/lib/alias__js.txt | 2 + .../data/lib/alias__native__js.txt | 2 + .../data/lib/index__js.txt | 2 + .../data/lib/main__js.txt | 2 + .../data/lib/native__js.txt | 2 + .../data/lib/ndarray__js.txt | 2 + .../data/lib/ndarray__native__js.txt | 2 + .../data/src/Makefile.txt | 2 + .../data/src/addon__c.txt | 2 + .../data/src/alias__c.txt | 2 + .../data/test/test__alias__js.txt | 2 + .../data/test/test__alias__native__js.txt | 2 + .../data/test/test__js.txt | 2 + .../data/test/test__ndarray__js.txt | 2 + .../data/test/test__ndarray__native__js.txt | 2 + .../scripts/data.json | 149 ++++++++++ .../scripts/generate_data.js | 79 +++++ .../scripts/runner.js | 279 ++++++++++++++++++ .../scripts/scaffold.sh | 66 +++-- 34 files changed, 618 insertions(+), 41 deletions(-) create mode 100644 lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/data.json create mode 100644 lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/generate_data.js create mode 100644 lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/runner.js diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/README__md.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/README__md.txt index f44744eaf80..d571bdb7062 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/README__md.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/README__md.txt @@ -18,6 +18,8 @@ limitations under the License. --> + + # {{ALIAS}} > {{PKG_DESC}} @@ -135,7 +137,7 @@ var y = new {{TYPED_ARRAY_CTOR}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); ```javascript -var uniform = require( '@stdlib/random/base/uniform' ); +var random = require( '@stdlib/random/base/random' ); var {{TYPED_ARRAY_CTOR}} = require( '@stdlib/array/{{TYPED_ARRAY_DTYPE}}' ); var {{ALIAS}} = require( '@{{PKG}}' ); @@ -144,7 +146,7 @@ var y = new {{TYPED_ARRAY_CTOR}}( 10 ); var i; for ( i = 0; i < x.length; i++ ) { - x[ i ] = uniform( {{C_RAND_MIN}}, {{C_RAND_MAX}} ); + x[ i ] = random( {{C_RAND_MIN}}, {{C_RAND_MAX}} ); } console.log( x ); console.log( y ); diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/benchmark__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/benchmark__js.txt index 6725f2de57c..da1194763ae 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/benchmark__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/benchmark__js.txt @@ -16,12 +16,14 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; // MODULES // var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ).factory; +var random = require( '@stdlib/random/base/random' ).factory; var isnan{{C_TYPE_SUFFIX}} = require( '@stdlib/math/base/assert/is-nan{{C_TYPE_SUFFIX}}' ); var pow = require( '@stdlib/math/base/special/pow' ); var {{TYPED_ARRAY_CTOR}} = require( '@stdlib/array/{{TYPED_ARRAY_DTYPE}}' ); @@ -31,7 +33,7 @@ var {{ALIAS}} = require( './../lib/main.js' ); // VARIABLES // -var rand = uniform( {{C_RAND_MIN}}, {{C_RAND_MAX}} ); +var rand = random( {{C_RAND_MIN}}, {{C_RAND_MAX}} ); // FUNCTIONS // diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/benchmark__native__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/benchmark__native__js.txt index b61216acebb..7beef6d1ab7 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/benchmark__native__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/benchmark__native__js.txt @@ -16,13 +16,15 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; // MODULES // var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ).factory; +var random = require( '@stdlib/random/base/random' ).factory; var isnan{{C_TYPE_SUFFIX}} = require( '@stdlib/math/base/assert/is-nan{{C_TYPE_SUFFIX}}' ); var pow = require( '@stdlib/math/base/special/pow' ); var {{TYPED_ARRAY_CTOR}} = require( '@stdlib/array/{{TYPED_ARRAY_DTYPE}}' ); @@ -36,7 +38,7 @@ var {{ALIAS}} = tryRequire( resolve( __dirname, './../lib/{{ALIAS_SNAKECASE}}.na var opts = { 'skip': ( {{ALIAS}} instanceof Error ) }; -var rand = uniform( {{C_RAND_MIN}}, {{C_RAND_MAX}} ); +var rand = random( {{C_RAND_MIN}}, {{C_RAND_MAX}} ); // FUNCTIONS // diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/benchmark__ndarray__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/benchmark__ndarray__js.txt index 24aa1f18825..906dc58a271 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/benchmark__ndarray__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/benchmark__ndarray__js.txt @@ -16,12 +16,14 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; // MODULES // var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ).factory; +var random = require( '@stdlib/random/base/random' ).factory; var isnan{{C_TYPE_SUFFIX}} = require( '@stdlib/math/base/assert/is-nan{{C_TYPE_SUFFIX}}' ); var pow = require( '@stdlib/math/base/special/pow' ); var {{TYPED_ARRAY_CTOR}} = require( '@stdlib/array/{{TYPED_ARRAY_DTYPE}}' ); @@ -31,7 +33,7 @@ var {{ALIAS}} = require( './../lib/ndarray.js' ); // VARIABLES // -var rand = uniform( {{C_RAND_MIN}}, {{C_RAND_MAX}} ); +var rand = random( {{C_RAND_MIN}}, {{C_RAND_MAX}} ); // FUNCTIONS // diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/benchmark__ndarray__native__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/benchmark__ndarray__native__js.txt index e37bb8fb755..31ea98eccf7 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/benchmark__ndarray__native__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/benchmark__ndarray__native__js.txt @@ -16,13 +16,15 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; // MODULES // var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ).factory; +var random = require( '@stdlib/random/base/random' ).factory; var isnan{{C_TYPE_SUFFIX}} = require( '@stdlib/math/base/assert/is-nan{{C_TYPE_SUFFIX}}' ); var pow = require( '@stdlib/math/base/special/pow' ); var {{TYPED_ARRAY_CTOR}} = require( '@stdlib/array/{{TYPED_ARRAY_DTYPE}}' ); @@ -36,7 +38,7 @@ var {{ALIAS}} = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ) var opts = { 'skip': ( {{ALIAS}} instanceof Error ) }; -var rand = uniform( {{C_RAND_MIN}}, {{C_RAND_MAX}} ); +var rand = random( {{C_RAND_MIN}}, {{C_RAND_MAX}} ); // FUNCTIONS // diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/c/Makefile.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/c/Makefile.txt index 93073ba41e8..9410f95fd3c 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/c/Makefile.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/c/Makefile.txt @@ -16,6 +16,8 @@ # limitations under the License. #/ +# THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. + # VARIABLES # ifndef VERBOSE diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/c/benchmark__length__c.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/c/benchmark__length__c.txt index b87f559d63a..5e18928eda3 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/c/benchmark__length__c.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/benchmark/c/benchmark__length__c.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + /** * Benchmark `{{ALIAS_SNAKECASE}}`. */ @@ -85,7 +87,7 @@ double tic() { * * @param a minimum value * @param b maximum value -* @return random number +* @return random number */ double rand_uniform( double a, double b ) { double x; @@ -102,7 +104,7 @@ double rand_uniform( double a, double b ) { * * @param a minimum value * @param b maximum value -* @return random number +* @return random number */ float rand_uniformf( float a, float b ) { return (float)rand_uniform( (double)a, (double)b ); @@ -113,7 +115,7 @@ float rand_uniformf( float a, float b ) { * * @param iterations number of iterations * @param len array length -* @return elapsed time in seconds +* @return elapsed time in seconds */ double benchmark( int iterations, int len ) { double elapsed; diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/binding__gyp.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/binding__gyp.txt index 7f5fd3dface..0762d20fb24 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/binding__gyp.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/binding__gyp.txt @@ -14,6 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +# THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. + # A `.gyp` file for building a Node.js native add-on. # # [1]: https://gyp.gsrc.io/docs/InputFormatReference.md diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/docs/types/index__d__ts.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/docs/types/index__d__ts.txt index 381379d8bf7..03591c0f5f4 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/docs/types/index__d__ts.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/docs/types/index__d__ts.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + // TypeScript Version: 4.1 /** diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/docs/types/test__ts.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/docs/types/test__ts.txt index 7362eb6e92e..03e0d3861c1 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/docs/types/test__ts.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/docs/types/test__ts.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + import {{ALIAS}} = require( './index' ); diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/examples/c/Makefile.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/examples/c/Makefile.txt index e90df47594d..746c2ee5bcf 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/examples/c/Makefile.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/examples/c/Makefile.txt @@ -16,6 +16,8 @@ # limitations under the License. #/ +# THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. + # VARIABLES # ifndef VERBOSE diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/examples/c/example__c.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/examples/c/example__c.txt index 2d04cd9ac13..61f92a5d118 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/examples/c/example__c.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/examples/c/example__c.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + #include "{{PKG_INCLUDE}}.h" #include #include diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/examples/index__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/examples/index__js.txt index 4354cbcb8a8..981278d2de5 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/examples/index__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/examples/index__js.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; var uniform = require( '@stdlib/random/base/uniform' ); diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/include/alias__h.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/include/alias__h.txt index 6abd68f28d5..8999ec31a2a 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/include/alias__h.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/include/alias__h.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + #ifndef {{C_HEADER_GUARD}}_H #define {{C_HEADER_GUARD}}_H diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/include__gypi.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/include__gypi.txt index 9fad714bbcf..570b6a5a75f 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/include__gypi.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/include__gypi.txt @@ -14,6 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +# THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. + # A GYP include file for building a Node.js native add-on. # # Main documentation: diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/alias__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/alias__js.txt index f21ee902785..47ba1b4a8f3 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/alias__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/alias__js.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; // MODULES // diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/alias__native__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/alias__native__js.txt index d445de089bc..8858ae9f9ce 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/alias__native__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/alias__native__js.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; // MODULES // diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/index__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/index__js.txt index 417fd0d7e53..297d211ec8e 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/index__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/index__js.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; /** diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/main__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/main__js.txt index 019b9d5cccd..51af4dd868e 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/main__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/main__js.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; // MODULES // diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/native__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/native__js.txt index a2ae3f80f48..278fed21eef 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/native__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/native__js.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; // MODULES // diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/ndarray__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/ndarray__js.txt index 2abdcb75701..8aeab1da073 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/ndarray__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/ndarray__js.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; // MODULES // diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/ndarray__native__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/ndarray__native__js.txt index 565e9a0ef03..7d96bb68841 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/ndarray__native__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/lib/ndarray__native__js.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; // MODULES // diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/src/Makefile.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/src/Makefile.txt index a64cc31f1b6..ae754ac0008 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/src/Makefile.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/src/Makefile.txt @@ -16,6 +16,8 @@ # limitations under the License. #/ +# THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. + # VARIABLES # ifndef VERBOSE diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/src/addon__c.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/src/addon__c.txt index 956707e00f1..c22298fbda2 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/src/addon__c.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/src/addon__c.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + #include "stdlib/strided/napi/{{STRIDED_APPLY_ALIAS}}.h" #include "{{UNARY_PKG_INCLUDE}}.h" diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/src/alias__c.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/src/alias__c.txt index 28cc7d177f2..e2dfd5c704f 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/src/alias__c.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/src/alias__c.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + #include "{{PKG_INCLUDE}}.h" #include "stdlib/strided/base/{{STRIDED_APPLY_ALIAS}}.h" #include "{{UNARY_PKG_INCLUDE}}.h" diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__alias__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__alias__js.txt index cbbb72b0ff6..24712d362d1 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__alias__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__alias__js.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; // MODULES // diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__alias__native__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__alias__native__js.txt index 898ca55b6d5..8e396efece5 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__alias__native__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__alias__native__js.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; // MODULES // diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__js.txt index 91db0ffb703..c12481d5964 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__js.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; // MODULES // diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__ndarray__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__ndarray__js.txt index 2ed6182307a..0ecac6ca9dc 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__ndarray__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__ndarray__js.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; // MODULES // diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__ndarray__native__js.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__ndarray__native__js.txt index 1e4b17df46b..2ad50944ca3 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__ndarray__native__js.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/test/test__ndarray__native__js.txt @@ -16,6 +16,8 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; // MODULES // diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/data.json b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/data.json new file mode 100644 index 00000000000..86110e6ba6d --- /dev/null +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/data.json @@ -0,0 +1,149 @@ +[ + { + "$schema": "math/base@v1.0", + "base_alias": "cbrt", + "alias": "cbrt", + "pkg_desc": "compute the cube root", + "desc": "computes the cube root", + "short_desc": "cube root", + "parameters": [ + { + "name": "x", + "desc": "input value", + "type": { + "javascript": "number", + "jsdoc": "number", + "c": "double", + "dtype": "float64" + }, + "domain": [ + { + "min": "-infinity", + "max": "infinity" + } + ], + "rand": { + "prng": "random/base/uniform", + "parameters": [ + -10, + 10 + ] + }, + "example_values": [ + 64, + 27, + 0, + 0, + -9, + 8, + -1, + 125, + -10.2, + 11.3, + -12.4, + 3.5, + -1.6, + 15.7, + -16, + 17.9, + -188, + 19.11, + -200, + 21.15 + ] + } + ], + "returns": { + "desc": "cube root", + "type": { + "javascript": "number", + "jsdoc": "number", + "c": "double", + "dtype": "float64" + } + }, + "keywords": [ + "cube", + "root", + "cbrt", + "cubic", + "power" + ], + "extra_keywords": [ + "math.cbrt" + ] + }, + { + "$schema": "math/base@v1.0", + "base_alias": "exp", + "alias": "exp", + "pkg_desc": "evaluate the natural exponential function", + "desc": "evaluates the natural exponential function", + "short_desc": "natural exponential function", + "parameters": [ + { + "name": "x", + "desc": "input value", + "type": { + "javascript": "number", + "jsdoc": "number", + "c": "double", + "dtype": "float64" + }, + "domain": [ + { + "min": "-infinity", + "max": "infinity" + } + ], + "rand": { + "prng": "random/base/uniform", + "parameters": [ + -10, + 10 + ] + }, + "example_values": [ + -1.2, + 2, + -3.1, + -4.7, + 5.5, + 6.7, + 8.9, + -10.2, + 11.3, + -12.4, + 13.5, + 14.6, + -15.7, + 16.8, + -17.9, + 18.1, + -19.11, + 20.12, + -21.15, + 23.78 + ] + } + ], + "returns": { + "desc": "function value", + "type": { + "javascript": "number", + "jsdoc": "number", + "c": "double", + "dtype": "float64" + } + }, + "keywords": [ + "natural", + "exponential", + "exp", + "power" + ], + "extra_keywords": [ + "math.exp" + ] + } +] diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/generate_data.js b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/generate_data.js new file mode 100644 index 00000000000..1cada68fe58 --- /dev/null +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/generate_data.js @@ -0,0 +1,79 @@ +#!/usr/bin/env node + +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 resolve = require( 'path' ).resolve; +var findPkgs = require( '@stdlib/_tools/pkgs/find' ).sync; +var readJSON = require( '@stdlib/fs/read-json' ).sync; +var writeFile = require( '@stdlib/fs/write-file' ).sync; +var rootDir = require( '@stdlib/_tools/utils/root-dir' ); + + +// VARIABLES // + +var ROOT_DIR = rootDir(); +var opts = { + 'encoding': 'utf8' +}; + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var path; + var json; + var pkgs; + var out; + var o; + var i; + + // Resolve unary "special" math packages: + pkgs = findPkgs({ + 'dir': ROOT_DIR, + 'pattern': '**/math/base/special/*/package.json' + }); + + // Filter for package's containing scaffold metadata and which have unary APIs... + out = []; + for ( i = 0; i < pkgs.length; i++ ) { + path = resolve( ROOT_DIR, pkgs[i] ); + json = readJSON( resolve( path, 'package.json' ), opts ); + if ( json instanceof Error ) { + console.error( 'Encountered an error when attempting to read package: %s. Error: %s.', pkgs[ i ], json.message ); + continue; + } + o = json.__stdlib__; // eslint-disable-line no-underscore-dangle + if ( o && o.scaffold && o.scaffold.parameters.length === 1 ) { + out.push( o.scaffold ); + } + } + // Write the metadata to a local file for subsequent consumption by other scripts: + writeFile( resolve( __dirname, 'data.json' ), JSON.stringify( out, null, ' ' )+'\n', opts ); +} + +main(); diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/runner.js b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/runner.js new file mode 100644 index 00000000000..bd50d3fdf7a --- /dev/null +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/runner.js @@ -0,0 +1,279 @@ +#!/usr/bin/env node + +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 resolve = require( 'path' ).resolve; +var shell = require( 'child_process' ).execSync; // eslint-disable-line node/no-sync +var existsSync = require( '@stdlib/fs/exists' ).sync; +var objectKeys = require( '@stdlib/utils/keys' ); +var rootDir = require( '@stdlib/_tools/utils/root-dir' ); +var log = require( '@stdlib/console/log' ); +var capitalize = require( '@stdlib/string/capitalize' ); +var isInteger = require( '@stdlib/math/base/assert/is-integer' ); +var isRealFloatingDataType = require( '@stdlib/array/base/assert/is-real-floating-point-data-type' ); +var DATA = require( './data.json' ); + + +// VARIABLES // + +var CREATE_ONLY = 1; +var SCAFFOLD_SCRIPT = resolve( __dirname, 'scaffold.sh' ); +var ROOT_DIR = resolve( rootDir(), 'lib', 'node_modules' ); + + +// FUNCTIONS // + +/** +* Returns an `ALIAS` environment variable string. +* +* @private +* @param {string} alias - package alias +* @returns {string} environment variable string +* +* @example +* var s = aliasEnvVar( 'abs' ); +* // returns 'ALIAS=abs' +* +* @example +* var s = aliasEnvVar( 'absf' ); +* // returns 'ALIAS=absf' +*/ +function aliasEnvVar( alias ) { + return 'ALIAS=' + alias; +} + +/** +* Returns a `DESC` environment variable string. +* +* @private +* @param {string} desc - default description +* @returns {string} environment variable string +* +* @example +* var s = descEnvVar( 'computes the cube root' ); +* // returns 'DESC=\'computes the cube root\'' +*/ +function descEnvVar( desc ) { + return 'DESC=\'' + desc + '\''; +} + +/** +* Returns a `DESC_LINK_TEXT` environment variable string. +* +* @private +* @param {string} desc - short description +* @returns {string} environment variable string +* +* @example +* var s = linkTextEnvVar( 'cube root' ); +* // returns 'DESC_LINK_TEXT=\'cube root\'' +* +* @example +* var s = linkTextEnvVar( '' ); +* // returns '' +*/ +function linkTextEnvVar( desc ) { + if ( desc === '' ) { + return ''; + } + return 'DESC_LINK_TEXT=\'' + capitalize( desc ) + '\''; +} + +/** +* Returns a `KEYWORDS` environment variable string. +* +* @private +* @param {StringArray} keywords - list of keywords +* @returns {string} environment variable string +* +* @example +* var keywords = [ 'math', 'special' ]; +* +* var s = keywordsEnvVar( keywords ); +* // returns 'KEYWORDS=\'math,special\'' +*/ +function keywordsEnvVar( keywords ) { + return 'KEYWORDS=\'' + keywords.join( ',' ) + '\''; +} + +/** +* Returns a `C_X_VALUES_LEN_8` environment variable string. +* +* @private +* @param {NumberArray} values - example values +* @param {string} dtype - values data type +* @returns {string} environment variable string +* +* @example +* var values = [ 1, 2, 3, 4, 5, 6, 7, 8 ]; +* +* var s = valuesEnvVar( values, 'int32' ); +* // returns 'C_X_VALUES_LEN_8=\'1,2,3,4,5,6,7,8\'' +*/ +function valuesEnvVar( values, dtype ) { + var vals; + var v; + var i; + + if ( isRealFloatingDataType( dtype ) ) { + vals = []; + for ( i = 0; i < 8; i++ ) { + v = values[ i ]; + vals.push( v.toString() ); + if ( isInteger( v ) ) { + vals[ i ] += '.0'; + } + } + } else { + vals = values.slice( 0, 8 ); + } + return 'C_X_VALUES_LEN_8=\'' + vals.join( ',' ) + '\''; +} + +/** +* Returns a string containing environment variable for generating pseudorandom numbers. +* +* @private +* @param {Object} obj - configuration object +* @returns {string} environment variable string +* +* @example +* var o = { +* 'prng': 'random/base/uniform', +* 'parameters': [ -100, 100 ] +* }; +* +* var s = prngEnvVars( o ); +* // returns 'BASE_PRNG=\'uniform\',RAND_MIN=-100,RAND_MAX=100' +*/ +function prngEnvVars( obj ) { + var base; + var min; + var max; + var p; + + p = obj.prng.split( '/' ); + base = p[ p.length-1 ]; + min = obj.parameters[ 0 ]; + max = obj.parameters[ 1 ]; + if ( base === 'uniform' ) { + if ( isInteger( min ) ) { + min = min.toString() + '.0'; + } + if ( isInteger( max ) ) { + max = max.toString() + '.0'; + } + } else { + min = min.toString(); + max = max.toString(); + } + return [ + 'BASE_PRNG=\'' + base + '\'', + 'C_RAND_MIN=' + min, + 'C_RAND_MAX=' + max + ].join( ' ' ); +} + +/** +* Returns a `JAVASCRIPT_RETURN_TYPE` environment variable string. +* +* @private +* @param {string} dt - return type +* @returns {string} environment variable string +* +* @example +* var s = returnTypeEnvVar( 'number' ); +* // returns 'JAVASCRIPT_RETURN_TYPE=\'number\'' +*/ +function returnTypeEnvVar( dt ) { + return 'JAVASCRIPT_RETURN_TYPE=\'' + dt + '\''; +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var keys; + var envs; + var cmd; + var p; + var k; + var v; + var o; + var i; + var j; + + for ( i = 0; i < DATA.length; i++ ) { + o = DATA[ i ]; + p = resolve( ROOT_DIR, '@stdlib/math/strided/special', o.alias, 'package.json' ); + if ( existsSync( p ) ) { + if ( CREATE_ONLY ) { + log( 'Package already exists. Skipping @%s...', 'stdlib/math/strided/special/' + o.alias ); + continue; + } + log( 'Updating package: @%s...', 'stdlib/math/strided/special/' + o.alias ); + } else { + log( 'Creating package: @%s...', 'stdlib/math/strided/special/' + o.alias ); + } + keys = objectKeys( o ); + envs = []; + for ( j = 0; j < keys.length; j++ ) { + k = keys[ j ]; + v = o[ k ]; + if ( k === 'alias' ) { + envs.push( aliasEnvVar( v ) ); + continue; + } + if ( k === 'desc' ) { + envs.push( descEnvVar( v ) ); + continue; + } + if ( k === 'short_desc' ) { + envs.push( linkTextEnvVar( v ) ); + continue; + } + if ( k === 'keywords' ) { + envs.push( keywordsEnvVar( v ) ); + continue; + } + if ( k === 'parameters' ) { + envs.push( valuesEnvVar( v[ 0 ].example_values, v[ 0 ].type.dtype ) ); // eslint-disable-line max-len + envs.push( prngEnvVars( v[ 0 ].rand ) ); + continue; + } + if ( k === 'returns' ) { + envs.push( returnTypeEnvVar( v.type.javascript ) ); + continue; + } + } + cmd = envs.join( ' ' ) + ' . ' + SCAFFOLD_SCRIPT; + shell( cmd ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/scaffold.sh b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/scaffold.sh index 7dd8f794ef7..440d3f117fa 100755 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/scaffold.sh +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/scaffold.sh @@ -22,61 +22,65 @@ # # Environment Variables: # -# ALIAS Main export alias. -# PKG_DESC Package description. -# MODULE_DESC Module description. -# MAIN_DESC Main export description. -# TEST_DESC Test description. -# DESC_LINK_TEXT README link text. -# KEYWORDS List of keywords. -# C_RAND_MIN Minimum value for generated values. -# C_RAND_MAX Maximum value for generated values. -# C_X_VALUES_LEN_8 List of input values. +# ALIAS Main export alias. +# DESC Default description. +# PKG_DESC Package description. +# MODULE_DESC Module description. +# MAIN_DESC Main export description. +# TEST_DESC Test description. +# DESC_LINK_TEXT README link text. +# KEYWORDS List of keywords. +# BASE_PRNG Base name of the package for generating pseudorandom numbers. +# C_RAND_MIN Minimum value for generated values. +# C_RAND_MAX Maximum value for generated values. +# C_X_VALUES_LEN_8 List of input values. +# JAVASCRIPT_RETURN_TYPE JavaScript return value data type. # ## USER-DEFINED VARIABLES ## # Define the main export alias: -alias=${ALIAS:-'ddiracDelta'} +alias=${ALIAS:-'TODO'} # Define the package description: # shellcheck disable=SC2016 -pkg_desc=${PKG_DESC:-'Evaluate the Dirac delta function for each element in a STRIDED_TYPED_ARRAY.'} +pkg_desc=${PKG_DESC:-"${DESC:-'TODO'} for each element in a STRIDED_TYPED_ARRAY."} +pkg_desc=$(echo "${pkg_desc}" | awk '{print toupper(substr($0,1,1)) substr($0,2)}') # Define the module description: # shellcheck disable=SC2016 -module_desc=${MODULE_DESC:-'Evaluate the Dirac delta function for each element in a STRIDED_TYPED_ARRAY `x` and assign the results to elements in a STRIDED_TYPED_ARRAY `y`.'} +module_desc=${MODULE_DESC:-"${DESC:-'TODO'} for each element in a STRIDED_TYPED_ARRAY \`x\` and assign the results to elements in a STRIDED_TYPED_ARRAY \`y\`."} +module_desc=$(echo "${module_desc}" | awk '{print toupper(substr($0,1,1)) substr($0,2)}') # Define main export description: # shellcheck disable=SC2016 -main_desc=${MAIN_DESC:-'Evaluates the Dirac delta function for each element in a STRIDED_TYPED_ARRAY `x` and assigns the results to elements in a STRIDED_TYPED_ARRAY `y`.'} +main_desc=${MAIN_DESC:-"${DESC:-'TODO'} for each element in a STRIDED_TYPED_ARRAY \`x\` and assigns the results to elements in a STRIDED_TYPED_ARRAY \`y\`."} +main_desc=$(echo "${main_desc}" | awk '{print toupper(substr($0,1,1)) substr($0,2)}') # Define the test description: # shellcheck disable=SC2016 -test_desc=${TEST_DESC:-'evaluates the Dirac delta function for each element'} +test_desc=${TEST_DESC:-"${DESC:-'TODO'} for each element"} # Define description text (found in the README) which should be a link to the unary package (NOTE: to not include a link, set to an empty string): -desc_link_text=${DESC_LINK_TEXT:-'Dirac delta function'} +desc_link_text=${DESC_LINK_TEXT:-''} # Define a list of keywords: if [[ -z "${KEYWORDS:-}" ]]; then keywords=( - "stdmath" - "mathematics" - "math" - "dirac" - "delta" - "distribution" - "dist" - "continuous" - "kronecker" - "spike" - "impulse" + "stdmath" + "mathematics" + "math" ) else IFS=','; read -ra keywords <<< "${KEYWORDS}"; IFS=' '; fi +# Define the JavaScript return data type: +javascript_return_type=${JAVASCRIPT_RETURN_TYPE:-'number'} + +# Define a pseudorandom number generator for generating random values: +base_prng=${BASE_PRNG:-'uniform'} + # Define the minimum value of generated values when benchmarking and testing the implementation: c_rand_min=${C_RAND_MIN:-'-100.0'} @@ -140,7 +144,7 @@ this_dir="${base_dir}/@stdlib/_tools/scaffold/math-strided-real-typed-unary" wrap="${base_dir}/@stdlib/_tools/repl-txt/wrap-desc/bin/cli" # Define the unary function alias: -unary_alias="${alias:1}" +unary_alias="${alias}" if [ "${alias:0:1}" == "s" ]; then unary_alias="${unary_alias}f" fi @@ -459,6 +463,9 @@ find_and_replace "${regex}" regex="s/\\{\\{C_UNARY_ALIAS\\}\\}/${c_unary_alias}/g;" find_and_replace "${regex}" +regex="s/\\{\\{BASE_PRNG\\}\\}/${base_prng}/g;" +find_and_replace "${regex}" + regex="s/\\{\\{STRIDED_APPLY_ALIAS\\}\\}/${strided_apply_alias}/g;" find_and_replace "${regex}" @@ -489,6 +496,9 @@ find_and_replace "${regex}" regex="s/\\{\\{C_RAND_MAX\\}\\}/${c_rand_max}/g;" find_and_replace "${regex}" +regex="s/\\{\\{JAVASCRIPT_RETURN_TYPE\\}\\}/${javascript_return_type}/g;" +find_and_replace "${regex}" + keywords_sep='",\n "' if [ "${#keywords[*]}" -eq 0 ]; then words=''