Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/AbhijitRaut04/stdlib int…
Browse files Browse the repository at this point in the history
…o develop
  • Loading branch information
AbhijitRaut04 committed Sep 20, 2024
2 parents bb1810a + 08377e0 commit 415c35b
Show file tree
Hide file tree
Showing 122 changed files with 6,130 additions and 561 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
[
{
"$schema": "math/[email protected]",
"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/[email protected]",
"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"
]
}
]
Original file line number Diff line number Diff line change
@@ -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();
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ type GetUint8c = ( arr: Uint8ClampedArray, idx: number ) => number | void;
/**
* Returns an element from a `Complex128Array`.
*
* @param
arr - input array
* @param arr - input array
* @param idx - element index
* @returns element value
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ type GetUint8c = ( arr: Uint8ClampedArray, idx: number ) => number | void;
/**
* Returns an element from a `Complex128Array`.
*
* @param
arr - input array
* @param arr - input array
* @param idx - element index
* @returns element value
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ type GetFloat32 = ( arr: Float32Array, idx: number ) => number | void;
/**
* Returns an element from a `Complex128Array`.
*
* @param
arr - input array
* @param arr - input array
* @param idx - element index
* @returns element value
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ type SetFloat32 = ( arr: Float32Array, idx: number, value: number ) => void;
/**
* Sets an element in a `Complex128Array`.
*
* @param
arr - input array
* @param arr - input array
* @param idx - element index
* @param value - value to set
*/
Expand Down
18 changes: 9 additions & 9 deletions lib/node_modules/@stdlib/blas/base/daxpy-wasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ var mod = new daxpy.Module( mem );
mod.initializeSync();
```

#### mod.main( N, alpha, xptr, strideX, yptr, strideY )
#### daxpy.Module.prototype.main( N, α, xp, sx, yp, sy )

Multiplies a vector `x` by a constant and adds the result to `y`.

Expand Down Expand Up @@ -201,13 +201,13 @@ console.log( view );
The function has the following parameters:

- **N**: number of indexed elements.
- **alpha**: scalar constant.
- **xptr**: input [`Float64Array`][@stdlib/array/float64] pointer (i.e., byte offset).
- **strideX**: index increment for `x`.
- **yptr**: input [`Float64Array`][@stdlib/array/float64] pointer (i.e., byte offset).
- **strideY**: index increment for `y`.
- **α**: scalar constant.
- **xp**: input [`Float64Array`][@stdlib/array/float64] pointer (i.e., byte offset).
- **sx**: index increment for `x`.
- **yp**: input [`Float64Array`][@stdlib/array/float64] pointer (i.e., byte offset).
- **sy**: index increment for `y`.

#### mod.ndarray( N, alpha, xptr, strideX, offsetX, yptr, strideY, offsetY )
#### daxpy.Module.prototype.ndarray( N, α, xp, sx, ox, yp, sy, oy )

Multiplies a vector `x` by a constant and adds the result to `y` using alternative indexing semantics.

Expand Down Expand Up @@ -260,8 +260,8 @@ console.log( view );

The function has the following additional parameters:

- **offsetX**: starting index for `x`.
- **offsetY**: starting index for `y`.
- **ox**: starting index for `x`.
- **oy**: starting index for `y`.

</section>

Expand Down
Loading

0 comments on commit 415c35b

Please sign in to comment.