Skip to content

Commit

Permalink
fix: fix identation, typos and include stdlib dependency in C impleme…
Browse files Browse the repository at this point in the history
…ntation
  • Loading branch information
steff456 committed Jul 11, 2023
1 parent 3d2cbc8 commit 28ef98c
Show file tree
Hide file tree
Showing 13 changed files with 127 additions and 143 deletions.
13 changes: 3 additions & 10 deletions lib/node_modules/@stdlib/math/base/special/ccis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,17 @@ im = imag( v );

```javascript
var Complex128 = require( '@stdlib/complex/float64' );
var randu = require( '@stdlib/random/base/randu' );
var round = require( '@stdlib/math/base/special/round' );
var uniform = require( '@stdlib/random/base/uniform' );
var ccis = require( '@stdlib/math/base/special/ccis' );

var re;
var im;
var z1;
var z2;
var i;

for ( i = 0; i < 100; i++ ) {
re = round( randu()*100.0 ) - 50.0;
im = round( randu()*100.0 ) - 50.0;
z1 = new Complex128( re, im );

z1 = new Complex128( uniform( -50.0, 50.0 ), uniform( -50.0, 50.0 ) );
z2 = ccis( z1 );

console.log( 'cis(%s) = %s', z1.toString(), z2.toString() );
console.log( 'ccis(%s) = %s', z1.toString(), z2.toString() );
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
import { Complex128 } from '@stdlib/types/object';

/**
* Evaluates the cis function for a double-precision complex floating-point
* number.
* Evaluates the cis function for a double-precision complex floating-point number.
*
* @param z - complex number
* @returns result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import ccis = require( './index' );

// TESTS //

// The function returns an array of numbers...
// The function returns a double-precision complex floating-point number.
{
const z = new Complex128( 1.0, 1.0 );

Expand Down
17 changes: 5 additions & 12 deletions lib/node_modules/@stdlib/math/base/special/ccis/examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,15 @@
'use strict';

var Complex128 = require( '@stdlib/complex/float64' );
var randu = require( '@stdlib/random/base/randu' );
var round = require( '@stdlib/math/base/special/round' );
var cis = require( './../lib' );
var uniform = require( '@stdlib/random/base/uniform' );
var ccis = require( './../lib' );

var re;
var im;
var z1;
var z2;
var i;

for ( i = 0; i < 100; i++ ) {
re = round( randu()*100.0 ) - 50.0;
im = round( randu()*100.0 ) - 50.0;
z1 = new Complex128( re, im );

z2 = cis( z1 );

console.log( 'cis(%s) = %s', z1.toString(), z2.toString() );
z1 = new Complex128( uniform( -50.0, 50.0 ), uniform( -50.0, 50.0 ) );
z2 = ccis( z1 );
console.log( 'ccis(%s) = %s', z1.toString(), z2.toString() );
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ extern "C" {
#endif

/**
* Evaluates the cis function for a double-precision complex floating-point
* number.
* Evaluates the cis function for a double-precision complex floating-point number.
*/
stdlib_complex128_t stdlib_base_ccis( const stdlib_complex128_t z );

Expand Down
3 changes: 1 addition & 2 deletions lib/node_modules/@stdlib/math/base/special/ccis/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
'use strict';

/**
* Evaluate the cis function for a double-precision complex floating-point.
* number.
* Evaluate the cis function for a double-precision complex floating-point number.
*
* @module @stdlib/math/base/special/ccis
*
Expand Down
3 changes: 1 addition & 2 deletions lib/node_modules/@stdlib/math/base/special/ccis/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ var imag = require( '@stdlib/complex/imag' );
// MAIN //

/**
* Evaluates the cis function for a double-precision complex floating-point.
* number.
* Evaluates the cis function for a double-precision complex floating-point number.
*
* @param {Complex128} z - complex number
* @returns {Complex128} result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ var addon = require( './../src/addon.node' );
// MAIN //

/**
* Evaluates the cis function for a double-precision complex floating-point.
* number.
* Evaluates the cis function for a double-precision complex floating-point number.
*
* @private
* @param {Complex128} z - complex number
Expand Down
151 changes: 77 additions & 74 deletions lib/node_modules/@stdlib/math/base/special/ccis/manifest.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,78 @@
{
"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/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/napi/unary",
"@stdlib/complex/float64",
"@stdlib/complex/reim"
]
},
{
"task": "benchmark",
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/complex/float64",
"@stdlib/complex/reim"
]
},
{
"task": "examples",
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/complex/float64",
"@stdlib/complex/reim"
]
}
]
}
"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/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/napi/unary",
"@stdlib/complex/float64",
"@stdlib/complex/reim",
"@stdlib/math/base/special/exp"
]
},
{
"task": "benchmark",
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/complex/float64",
"@stdlib/complex/reim",
"@stdlib/math/base/special/exp"
]
},
{
"task": "examples",
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/complex/float64",
"@stdlib/complex/reim",
"@stdlib/math/base/special/exp"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stdlib/math/base/special/ccis",
"version": "0.0.0",
"description": "Compute the cis function of a double-precision complex floating-point number.",
"description": "Compute the ccis function of a double-precision complex floating-point number.",
"license": "Apache-2.0",
"author": {
"name": "The Stdlib Authors",
Expand Down
10 changes: 5 additions & 5 deletions lib/node_modules/@stdlib/math/base/special/ccis/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
#include "stdlib/math/base/special/ccis.h"
#include "stdlib/complex/float64.h"
#include "stdlib/complex/reim.h"
#include "stdlib/math/base/special/exp.h"
#include <math.h>


/**
* Evaluates the cis function for a double-precision complex floating-point
* number.
* Evaluates the cis function for a double-precision complex floating-point number.
*
* @param z input value
* @return result
Expand Down Expand Up @@ -69,11 +69,11 @@ stdlib_complex128_t stdlib_base_ccis( const stdlib_complex128_t z ) {

stdlib_reim( z, &re, &im );

y = sin( re );
x = cos( re );
y = sin( re ); //TODO: use stdlib function once available
x = cos( re ); //TODO: use stdlib function once available
tmp = y;
if( im != 0.0 ){
e = exp( -im );
e = stdlib_base_exp( -im );
tmp *= e;
x *= e;
}
Expand Down
Loading

0 comments on commit 28ef98c

Please sign in to comment.