Skip to content

Commit

Permalink
build: update scaffolding for creating unary math strided packages
Browse files Browse the repository at this point in the history
  • Loading branch information
gunjjoshi committed Oct 8, 2024
1 parent a9cd099 commit ce2e22b
Show file tree
Hide file tree
Showing 34 changed files with 618 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ limitations under the License.

-->

<!-- THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. -->

# {{ALIAS}}

> {{PKG_DESC}}
Expand Down Expand Up @@ -135,7 +137,7 @@ var y = new {{TYPED_ARRAY_CTOR}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
<!-- eslint no-undef: "error" -->

```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}}' );

Expand All @@ -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 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}}' );
Expand All @@ -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 //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}}' );
Expand All @@ -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 //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}}' );
Expand All @@ -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 //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}}' );
Expand All @@ -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 //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# limitations under the License.
#/

# THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.

# VARIABLES #

ifndef VERBOSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */

/**
* Benchmark `{{ALIAS_SNAKECASE}}`.
*/
Expand Down Expand Up @@ -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;
Expand All @@ -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 );
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */

// TypeScript Version: 4.1

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */

import {{ALIAS}} = require( './index' );


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# limitations under the License.
#/

# THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.

# VARIABLES #

ifndef VERBOSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */

#include "{{PKG_INCLUDE}}.h"
#include <stdint.h>
#include <stdio.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */

'use strict';

// MODULES //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */

'use strict';

// MODULES //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */

'use strict';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */

'use strict';

// MODULES //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */

'use strict';

// MODULES //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */

'use strict';

// MODULES //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */

'use strict';

// MODULES //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# limitations under the License.
#/

# THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.

# VARIABLES #

ifndef VERBOSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */

'use strict';

// MODULES //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */

'use strict';

// MODULES //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */

'use strict';

// MODULES //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */

'use strict';

// MODULES //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */

'use strict';

// MODULES //
Expand Down
Loading

0 comments on commit ce2e22b

Please sign in to comment.