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 f44744eaf80e..60d22e53a111 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,17 +137,16 @@ 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/array/uniform' ); +var zeros = require( '@stdlib/array/zeros' ); var {{TYPED_ARRAY_CTOR}} = require( '@stdlib/array/{{TYPED_ARRAY_DTYPE}}' ); var {{ALIAS}} = require( '@{{PKG}}' ); -var x = new {{TYPED_ARRAY_CTOR}}( 10 ); -var y = new {{TYPED_ARRAY_CTOR}}( 10 ); +var x = random( 10, {{C_RAND_MIN}}, {{C_RAND_MAX}}, { + 'dtype': '{{TYPED_ARRAY_DTYPE}}' +}); +var y = zeros( 10, '{{TYPED_ARRAY_DTYPE}}' ); -var i; -for ( i = 0; i < x.length; i++ ) { - x[ i ] = uniform( {{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 6725f2de57ca..3e4f3e133b5f 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,15 @@ * 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/array/uniform' ); +var zeros = require( '@stdlib/array/zeros' ); 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}}' ); @@ -29,11 +32,6 @@ var pkg = require( './../package.json' ).name; var {{ALIAS}} = require( './../lib/main.js' ); -// VARIABLES // - -var rand = uniform( {{C_RAND_MIN}}, {{C_RAND_MAX}} ); - - // FUNCTIONS // /** @@ -48,11 +46,10 @@ function createBenchmark( len ) { var y; var i; - x = new {{TYPED_ARRAY_CTOR}}( len ); - y = new {{TYPED_ARRAY_CTOR}}( len ); - for ( i = 0; i < x.length; i++ ) { - x[ i ] = rand(); - } + x = random( len, {{C_RAND_MIN}}, {{C_RAND_MAX}}, { + 'dtype': '{{TYPED_ARRAY_DTYPE}}' + }); + y = zeros( len, '{{TYPED_ARRAY_DTYPE}}' ); return benchmark; /** 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 b61216acebbb..25a0c105235e 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,16 @@ * 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/array/uniform' ); +var zeros = require( '@stdlib/array/zeros' ); 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 +39,6 @@ var {{ALIAS}} = tryRequire( resolve( __dirname, './../lib/{{ALIAS_SNAKECASE}}.na var opts = { 'skip': ( {{ALIAS}} instanceof Error ) }; -var rand = uniform( {{C_RAND_MIN}}, {{C_RAND_MAX}} ); // FUNCTIONS // @@ -53,11 +55,10 @@ function createBenchmark( len ) { var y; var i; - x = new {{TYPED_ARRAY_CTOR}}( len ); - y = new {{TYPED_ARRAY_CTOR}}( len ); - for ( i = 0; i < x.length; i++ ) { - x[ i ] = rand(); - } + x = random( len, {{C_RAND_MIN}}, {{C_RAND_MAX}}, { + 'dtype': '{{TYPED_ARRAY_DTYPE}}' + }); + y = zeros( len, '{{TYPED_ARRAY_DTYPE}}' ); return benchmark; /** 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 24aa1f188250..ad158b9ce9fc 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,15 @@ * 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/array/uniform' ); +var zeros = require( '@stdlib/array/zeros' ); 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}}' ); @@ -29,11 +32,6 @@ var pkg = require( './../package.json' ).name; var {{ALIAS}} = require( './../lib/ndarray.js' ); -// VARIABLES // - -var rand = uniform( {{C_RAND_MIN}}, {{C_RAND_MAX}} ); - - // FUNCTIONS // /** @@ -48,11 +46,10 @@ function createBenchmark( len ) { var y; var i; - x = new {{TYPED_ARRAY_CTOR}}( len ); - y = new {{TYPED_ARRAY_CTOR}}( len ); - for ( i = 0; i < x.length; i++ ) { - x[ i ] = rand(); - } + x = random( len, {{C_RAND_MIN}}, {{C_RAND_MAX}}, { + 'dtype': '{{TYPED_ARRAY_DTYPE}}' + }); + y = zeros( len, '{{TYPED_ARRAY_DTYPE}}' ); return benchmark; /** 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 e37bb8fb755a..035de63af01e 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,16 @@ * 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/array/uniform' ); +var zeros = require( '@stdlib/array/zeros' ); 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 +39,6 @@ var {{ALIAS}} = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ) var opts = { 'skip': ( {{ALIAS}} instanceof Error ) }; -var rand = uniform( {{C_RAND_MIN}}, {{C_RAND_MAX}} ); // FUNCTIONS // @@ -53,11 +55,10 @@ function createBenchmark( len ) { var y; var i; - x = new {{TYPED_ARRAY_CTOR}}( len ); - y = new {{TYPED_ARRAY_CTOR}}( len ); - for ( i = 0; i < x.length; i++ ) { - x[ i ] = rand(); - } + x = random( len, {{C_RAND_MIN}}, {{C_RAND_MAX}}, { + 'dtype': '{{TYPED_ARRAY_DTYPE}}' + }); + y = zeros( len, '{{TYPED_ARRAY_DTYPE}}' ); return benchmark; /** 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 93073ba41e89..9410f95fd3ca 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 b87f559d63a9..9a423f3063a3 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,9 +16,8 @@ * limitations under the License. */ -/** -* Benchmark `{{ALIAS_SNAKECASE}}`. -*/ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + #include "{{PKG_INCLUDE}}.h" #include #include @@ -35,7 +34,7 @@ /** * Prints the TAP version. */ -void print_version() { +static void print_version() { printf( "TAP version 13\n" ); } @@ -45,7 +44,7 @@ void print_version() { * @param total total number of tests * @param passing total number of passing tests */ -void print_summary( int total, int passing ) { +static void print_summary( int total, int passing ) { printf( "#\n" ); printf( "1..%d\n", total ); // TAP plan printf( "# total %d\n", total ); @@ -60,7 +59,7 @@ void print_summary( int total, int passing ) { * @param iterations number of iterations * @param elapsed elapsed time in seconds */ -void print_results( int iterations, double elapsed ) { +static void print_results( int iterations, double elapsed ) { double rate = (double)iterations / elapsed; printf( " ---\n" ); printf( " iterations: %d\n", iterations ); @@ -74,7 +73,7 @@ void print_results( int iterations, double elapsed ) { * * @return clock time */ -double tic() { +static double tic() { struct timeval now; gettimeofday( &now, NULL ); return (double)now.tv_sec + (double)now.tv_usec/1.0e6; @@ -85,9 +84,9 @@ double tic() { * * @param a minimum value * @param b maximum value -* @return random number +* @return random number */ -double rand_uniform( double a, double b ) { +static double rand_uniform( double a, double b ) { double x; int r; @@ -102,9 +101,9 @@ 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 ) { +static float rand_uniformf( float a, float b ) { return (float)rand_uniform( (double)a, (double)b ); } @@ -113,9 +112,9 @@ 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 ) { +static double benchmark( int iterations, int len ) { double elapsed; {{C_TYPE}} x[ len ]; {{C_TYPE}} y[ len ]; 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 7f5fd3dface7..0762d20fb24a 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 381379d8bf7b..03591c0f5f44 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 7362eb6e92ea..03e0d3861c11 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 e90df47594d9..746c2ee5bcf2 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 2d04cd9ac13e..495103b72137 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,8 +16,9 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + #include "{{PKG_INCLUDE}}.h" -#include #include int main( void ) { @@ -25,14 +26,14 @@ int main( void ) { const {{C_TYPE}} x[] = { {{C_X_VALUES_LEN_8}} }; // Create an output strided array: - {{C_TYPE}} y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + {{C_TYPE}} y[] = { 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}} }; - // Specify the number of elements: - const int64_t N = 4; + // Specify the number of indexed elements: + const int N = 4; - // Specify the stride lengths: - const int64_t strideX = 2; - const int64_t strideY = 2; + // Specify stride lengths: + const int strideX = 2; + const int strideY = 2; // Compute the results: stdlib_strided_{{ALIAS_SNAKECASE}}( N, x, strideX, y, strideY ); 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 4354cbcb8a86..6155cfecfba1 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,20 +16,20 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + 'use strict'; -var uniform = require( '@stdlib/random/base/uniform' ); -var {{TYPED_ARRAY_CTOR}} = require( '@stdlib/array/{{TYPED_ARRAY_DTYPE}}' ); +var random = require( '@stdlib/random/array/uniform' ); +var zeros = require( '@stdlib/array/zeros' ); var {{ALIAS}} = require( './../lib' ); -var x = new {{TYPED_ARRAY_CTOR}}( 10 ); -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}} ); -} +var x = random( 10, {{C_RAND_MIN}}, {{C_RAND_MAX}}, { + 'dtype': '{{TYPED_ARRAY_DTYPE}}' +}); console.log( x ); + +var y = zeros( 10, '{{TYPED_ARRAY_DTYPE}}' ); console.log( y ); {{ALIAS}}.ndarray( x.length, x, 1, 0, y, -1, y.length-1 ); 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 6abd68f28d53..b458541ca04b 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,10 +16,12 @@ * limitations under the License. */ +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + #ifndef {{C_HEADER_GUARD}}_H #define {{C_HEADER_GUARD}}_H -#include +#include "stdlib/blas/base/shared.h" /* * If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. @@ -31,7 +33,12 @@ extern "C" { /** * {{C_MAIN_DESC}} */ -void stdlib_strided_{{ALIAS_SNAKECASE}}( const int64_t N, const {{C_TYPE}} *X, const int64_t strideX, {{C_TYPE}} *Y, const int64_t strideY ); +void stdlib_strided_{{ALIAS_SNAKECASE}}( const CBLAS_INT N, const {{C_TYPE}} *X, const CBLAS_INT strideX, {{C_TYPE}} *Y, const CBLAS_INT strideY ); + +/** +* {{C_NDARRAY_DESC}} +*/ +void stdlib_strided_{{ALIAS_SNAKECASE}}_ndarray( const CBLAS_INT N, const {{C_TYPE}} *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, {{C_TYPE}} *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ); #ifdef __cplusplus } 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 9fad714bbcf4..570b6a5a75fa 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 f21ee9027853..47ba1b4a8f3a 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 d445de089bc9..8858ae9f9ce9 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 417fd0d7e531..297d211ec8ef 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 019b9d5cccd0..51af4dd868e7 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 a2ae3f80f483..278fed21eef1 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 2abdcb75701d..8aeab1da073f 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 565e9a0ef037..7d96bb688414 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/manifest__json.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/manifest__json.txt index 07855a617a83..aebbee95e694 100644 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/manifest__json.txt +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/manifest__json.txt @@ -1,75 +1,103 @@ { - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/{{ALIAS_SNAKECASE}}.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@{{UNARY_PKG}}", - "@stdlib/strided/base/{{STRIDED_APPLY_ALIAS}}", - "@stdlib/strided/napi/{{STRIDED_APPLY_ALIAS}}" - ] - }, - { - "task": "examples", - "src": [ - "./src/{{ALIAS_SNAKECASE}}.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@{{UNARY_PKG}}", - "@stdlib/strided/base/{{STRIDED_APPLY_ALIAS}}" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/{{ALIAS_SNAKECASE}}.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@{{UNARY_PKG}}", - "@stdlib/strided/base/{{STRIDED_APPLY_ALIAS}}" - ] - } - ] + "options": { + "task": "build", + "wasm": false + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "task": "build", + "wasm": false, + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@{{UNARY_PKG}}", + "@stdlib/strided/base/{{STRIDED_APPLY_ALIAS}}", + "@stdlib/strided/base/stride2offset", + "@stdlib/blas/base/shared", + "@stdlib/strided/napi/{{STRIDED_APPLY_ALIAS}}" + ] + }, + { + "task": "examples", + "wasm": false, + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@{{UNARY_PKG}}", + "@stdlib/strided/base/{{STRIDED_APPLY_ALIAS}}", + "@stdlib/strided/base/stride2offset", + "@stdlib/blas/base/shared" + ] + }, + { + "task": "benchmark", + "wasm": false, + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@{{UNARY_PKG}}", + "@stdlib/strided/base/{{STRIDED_APPLY_ALIAS}}", + "@stdlib/strided/base/stride2offset", + "@stdlib/blas/base/shared" + ] + }, + { + "task": "build", + "wasm": true, + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@{{UNARY_PKG}}", + "@stdlib/strided/base/{{STRIDED_APPLY_ALIAS}}", + "@stdlib/strided/base/stride2offset", + "@stdlib/blas/base/shared" + ] + } + ] } 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 a64cc31f1b68..ae754ac00082 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 956707e00f1e..b499c465ec0d 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,7 +16,10 @@ * 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" -STDLIB_STRIDED_NAPI_MODULE_{{C_STRIDED_APPLY_MACRO_ALIAS}}( stdlib_{{C_UNARY_ALIAS}} ) +STDLIB_STRIDED_NAPI_MODULE_{{C_STRIDED_APPLY_MACRO_ALIAS}}( stdlib_{{C_UNARY_ALIAS}} ); +STDLIB_STRIDED_NAPI_MODULE_{{C_STRIDED_APPLY_MACRO_ALIAS}}_NDARRAY( stdlib_{{C_UNARY_ALIAS}} ); 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 deleted file mode 100644 index 28cc7d177f2b..000000000000 --- a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/src/alias__c.txt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) {{YEAR}} {{COPYRIGHT}}. -* -* 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. -*/ - -#include "{{PKG_INCLUDE}}.h" -#include "stdlib/strided/base/{{STRIDED_APPLY_ALIAS}}.h" -#include "{{UNARY_PKG_INCLUDE}}.h" -#include - -/** -* {{C_MAIN_DESC}} -* -* @param N number of indexed elements -* @param X input array -* @param strideX X stride length -* @param Y destination array -* @param strideY Y stride length -* -* @example -* #include -* -* // Create an input strided array: -* const {{C_TYPE}} x[] = { {{C_X_VALUES_LEN_8}} }; -* -* // Create an output strided array: -* {{C_TYPE}} y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -* -* // Specify the number of elements: -* const int64_t N = 4; -* -* // Specify the stride lengths: -* const int64_t strideX = 2; -* const int64_t strideY = 2; -* -* // Compute the results: -* stdlib_strided_{{ALIAS_SNAKECASE}}( N, x, strideX, y, strideY ); -*/ -void stdlib_strided_{{ALIAS_SNAKECASE}}( const int64_t N, const {{C_TYPE}} *X, const int64_t strideX, {{C_TYPE}} *Y, const int64_t strideY ) { - stdlib_strided_{{STRIDED_APPLY_ALIAS}}( N, X, strideX, Y, strideY, stdlib_{{C_UNARY_ALIAS}} ); -} diff --git a/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/src/main__c.txt b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/src/main__c.txt new file mode 100644 index 000000000000..c3b1053acbc7 --- /dev/null +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/data/src/main__c.txt @@ -0,0 +1,92 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) {{YEAR}} {{COPYRIGHT}}. +* +* 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. +*/ + +/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ + +#include "{{PKG_INCLUDE}}.h" +#include "{{UNARY_PKG_INCLUDE}}.h" +#include "stdlib/strided/base/{{STRIDED_APPLY_ALIAS}}.h" +#include "stdlib/strided/base/stride2offset.h" +#include "stdlib/blas/base/shared.h" +#include + +/** +* {{C_MAIN_DESC}} +* +* @param N number of indexed elements +* @param X input array +* @param strideX X stride length +* @param Y output array +* @param strideY Y stride length +* +* @example +* // Create an input strided array: +* const {{C_TYPE}} x[] = { {{C_X_VALUES_LEN_8}} }; +* +* // Create an output strided array: +* {{C_TYPE}} y[] = { 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}} }; +* +* // Specify the number of indexed elements: +* const int N = 4; +* +* // Specify stride lengths: +* const int strideX = 2; +* const int strideY = 2; +* +* // Compute the results: +* stdlib_strided_{{ALIAS_SNAKECASE}}( N, x, strideX, y, strideY ); +*/ +void stdlib_strided_{{ALIAS_SNAKECASE}}( const CBLAS_INT N, const {{C_TYPE}} *X, const CBLAS_INT strideX, {{C_TYPE}} *Y, const CBLAS_INT strideY ) { + stdlib_strided_{{ALIAS_SNAKECASE}}_ndarray( N, X, strideX, stdlib_strided_stride2offset( N, strideX ), strideY, stdlib_strided_stride2offset( N, strideY ), stdlib_{{C_UNARY_ALIAS}} ); +} + +/** +* {{C_NDARRAY_DESC}} +* +* @param N number of indexed elements +* @param X input array +* @param strideX X stride length +* @param offsetX starting index for X +* @param Y output array +* @param strideY Y stride length +* @param offsetY starting index for Y +* +* @example +* // Create an input strided array: +* const {{C_TYPE}} x[] = { {{C_X_VALUES_LEN_8}} }; +* +* // Create an output strided array: +* {{C_TYPE}} y[] = { 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}}, 0.0{{C_TYPE_SUFFIX}} }; +* +* // Specify the number of indexed elements: +* const int N = 4; +* +* // Specify stride lengths: +* const int strideX = 2; +* const int strideY = 2; +* +* // Specify index offsets: +* const int offsetX = 0; +* const int offsetY = 1; +* +* // Compute the results: +* stdlib_strided_{{ALIAS_SNAKECASE}}_ndarray( N, x, strideX, offsetX, y, strideY, offsetY ); +*/ +void stdlib_strided_{{ALIAS_SNAKECASE}}_ndarray( const CBLAS_INT N, const {{C_TYPE}} *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, {{C_TYPE}} *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) { + stdlib_strided_{{STRIDED_APPLY_ALIAS}}_ndarray( N, X, strideX, offsetX, Y, strideY, offsetY, stdlib_{{C_UNARY_ALIAS}} ); +} 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 cbbb72b0ff6c..24712d362d1c 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 898ca55b6d57..8e396efece53 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 91db0ffb7032..c12481d5964b 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 2ed6182307ad..0ecac6ca9dcf 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 1e4b17df46ba..2ad50944ca3f 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 000000000000..86110e6ba6df --- /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 000000000000..74c8964143bc --- /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) 2025 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 000000000000..821a543b9b0d --- /dev/null +++ b/lib/node_modules/@stdlib/_tools/scaffold/math-strided-real-typed-unary/scripts/runner.js @@ -0,0 +1,280 @@ +#!/usr/bin/env node + +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 === 'base_alias' ) { + envs.push( aliasEnvVar( v ) ); + continue; + } + // FIXME: generate pkg, module, and main descriptions + 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 7dd8f794ef70..39198383605a 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:-"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:-"TODO for each element in a STRIDED_TYPED_ARRAY and assign the results to elements in a STRIDED_TYPED_ARRAY."} +module_desc=$(echo "${module_desc}" | awk '{print toupper(substr($0,1,1)) substr($0,2)}') -# Define main export description: +# Define the 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 and assigns the results to elements in a STRIDED_TYPED_ARRAY."} +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'} @@ -213,15 +217,20 @@ pkg_desc="${pkg_desc//STRIDED_TYPED_ARRAY/${strided_typed_array}}" module_desc="${module_desc//STRIDED_TYPED_ARRAY/${strided_typed_array}}" main_desc="${main_desc//STRIDED_TYPED_ARRAY/${strided_typed_array}}" -# Define the main C description: -# shellcheck disable=SC2016 -c_main_desc=$(echo "${main_desc}" | perl -pe 's/(\`[a-z]\`)/uc($&)/ge;') - # Define the ndarray method description: # shellcheck disable=SC2001 ndarray_desc=$(echo "${main_desc}" | sed 's/\.$//') ndarray_desc="${ndarray_desc} using alternative indexing semantics." +# Define the main C description: +# shellcheck disable=SC2016 +c_main_desc=$(echo "${main_desc}" | perl -pe 's/(\`[a-z]\`)/uc($&)/ge;') + +# Define the ndarray C description: +# shellcheck disable=SC2016 +c_ndarray_desc=$(echo "${c_main_desc}" | sed 's/\.$//') +c_ndarray_desc="${c_ndarray_desc} using alternative indexing semantics." + # Define the REPL text main export description (note: 4 space indent and wrap at 80 characters): repl_text_main_desc=$(echo -n "${main_desc}" | "${wrap}") repl_text_main_desc="${repl_text_main_desc/ /}" @@ -331,7 +340,7 @@ files=( "lib/ndarray.js" "lib/ndarray.native.js" "src/addon.c" - "src/alias.c" + "src/main.c" "src/Makefile" "test/test.alias.js" "test/test.alias.native.js" @@ -426,6 +435,9 @@ find_and_replace "${regex}" regex="s/\\{\\{C_MAIN_DESC\\}\\}/${c_main_desc}/g;" find_and_replace "${regex}" +regex="s/\\{\\{C_NDARRAY_DESC\\}\\}/${c_ndarray_desc}/g;" +find_and_replace "${regex}" + regex="s/\\{\\{REPL_TEXT_MAIN_DESC\\}\\}/${repl_text_main_desc}/g;" find_and_replace "${regex}" @@ -459,6 +471,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 +504,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=''