Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ limitations under the License.
## Usage

```javascript
var cneg = require( '@stdlib/math/base/ops/cneg' );
var cneg = require( '@stdlib/complex/float64/base/neg' );
```

#### cneg( z )
Expand Down Expand Up @@ -106,7 +106,7 @@ im = imag( out );
```javascript
var Complex128 = require( '@stdlib/complex/float64/ctor' );
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
var cneg = require( '@stdlib/math/base/ops/cneg' );
var cneg = require( '@stdlib/complex/float64/base/neg' );

function randomComplex() {
var re = discreteUniform( -50, 50 );
Expand Down Expand Up @@ -152,10 +152,10 @@ for ( i = 0; i < 100; i++ ) {
### Usage

```c
#include "stdlib/math/base/ops/cneg.h"
#include "stdlib/complex/float64/base/neg.h"
```

#### stdlib_base_cneg( z )
#### stdlib_base_complex128_neg( z )

Negates a double-precision complex floating-point number.

Expand All @@ -166,7 +166,7 @@ Negates a double-precision complex floating-point number.

stdlib_complex128_t z = stdlib_complex128( 3.0, -2.0 );

stdlib_complex128_t out = stdlib_base_cneg( z );
stdlib_complex128_t out = stdlib_base_complex128_neg( z );

double re = stdlib_complex128_real( out );
// returns -3.0
Expand All @@ -180,7 +180,7 @@ The function accepts the following arguments:
- **z**: `[in] stdlib_complex128_t` input value.

```c
stdlib_complex128_t stdlib_base_cneg( const stdlib_complex128_t z );
stdlib_complex128_t stdlib_base_complex128_neg( const stdlib_complex128_t z );
```

</section>
Expand All @@ -202,7 +202,7 @@ stdlib_complex128_t stdlib_base_cneg( const stdlib_complex128_t z );
### Examples

```c
#include "stdlib/math/base/ops/cneg.h"
#include "stdlib/complex/float64/base/neg.h"
#include "stdlib/complex/float64/ctor.h"
#include "stdlib/complex/float64/reim.h"
#include <stdio.h>
Expand All @@ -225,7 +225,7 @@ int main( void ) {
stdlib_complex128_reim( v, &re, &im );
printf( "z = %lf + %lfi\n", re, im );

y = stdlib_base_cneg( v );
y = stdlib_base_complex128_neg( v );
stdlib_complex128_reim( y, &re, &im );
printf( "cneg(z) = %lf + %lfi\n", re, im );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

#include "stdlib/math/base/ops/cneg.h"
#include "stdlib/complex/float64/base/neg.h"
#include "stdlib/complex/float64/ctor.h"
#include "stdlib/complex/float64/reim.h"
#include <stdlib.h>
Expand Down Expand Up @@ -107,7 +107,7 @@ static double benchmark( void ) {
im = ( 1000.0*rand_double() ) - 500.0;
z1 = stdlib_complex128( re, im );

z2 = stdlib_base_cneg( z1 );
z2 = stdlib_base_complex128_neg( z1 );
stdlib_complex128_reim( z2, &re, &im );
if ( re != re ) {
printf( "should not return NaN\n" );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Parameters
----------
z: Complex128
Complex number.
Complex number.

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

#include "stdlib/math/base/ops/cneg.h"
#include "stdlib/complex/float64/base/neg.h"
#include "stdlib/complex/float64/ctor.h"
#include "stdlib/complex/float64/reim.h"
#include <stdio.h>
Expand All @@ -39,7 +39,7 @@ int main( void ) {
stdlib_complex128_reim( v, &re, &im );
printf( "z = %lf + %lfi\n", re, im );

y = stdlib_base_cneg( v );
y = stdlib_base_complex128_neg( v );
stdlib_complex128_reim( y, &re, &im );
printf( "cneg(z) = %lf + %lfi\n", re, im );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* limitations under the License.
*/

#ifndef STDLIB_MATH_BASE_OPS_CNEG_H
#define STDLIB_MATH_BASE_OPS_CNEG_H
#ifndef STDLIB_COMPLEX_FLOAT64_BASE_NEG_H
#define STDLIB_COMPLEX_FLOAT64_BASE_NEG_H

#include "stdlib/complex/float64/ctor.h"

Expand All @@ -31,10 +31,10 @@ extern "C" {
/**
* Negates a double-precision complex floating-point number.
*/
stdlib_complex128_t stdlib_base_cneg( const stdlib_complex128_t z );
stdlib_complex128_t stdlib_base_complex128_neg( const stdlib_complex128_t z );

#ifdef __cplusplus
}
#endif

#endif // !STDLIB_MATH_BASE_OPS_CNEG_H
#endif // !STDLIB_COMPLEX_FLOAT64_BASE_NEG_H
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
/**
* Negate a double-precision complex floating-point number.
*
* @module @stdlib/math/base/ops/cneg
* @module @stdlib/complex/float64/base/neg
*
* @example
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
* var real = require( '@stdlib/complex/float64/real' );
* var imag = require( '@stdlib/complex/float64/imag' );
* var cneg = require( '@stdlib/math/base/ops/cneg' );
* var cneg = require( '@stdlib/complex/float64/base/neg' );
*
* var z = new Complex128( -4.2, 5.5 );
* // returns <Complex128>
Expand All @@ -45,7 +45,7 @@
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
* var real = require( '@stdlib/complex/float64/real' );
* var imag = require( '@stdlib/complex/float64/imag' );
* var cneg = require( '@stdlib/math/base/ops/cneg' );
* var cneg = require( '@stdlib/complex/float64/base/neg' );
*
* var z = new Complex128( 0.0, 0.0 );
* // returns <Complex128>
Expand All @@ -63,7 +63,7 @@
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
* var real = require( '@stdlib/complex/float64/real' );
* var imag = require( '@stdlib/complex/float64/imag' );
* var cneg = require( '@stdlib/math/base/ops/cneg' );
* var cneg = require( '@stdlib/complex/float64/base/neg' );
*
* var z = new Complex128( NaN, NaN );
* // returns <Complex128>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@stdlib/math/base/ops/cneg",
"name": "@stdlib/complex/float64/base/neg",
"version": "0.0.0",
"description": "Negate a double-precision complex floating-point number.",
"license": "Apache-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* limitations under the License.
*/

#include "stdlib/math/base/ops/cneg.h"
#include "stdlib/complex/float64/base/neg.h"
#include "stdlib/math/base/napi/unary.h"

// cppcheck-suppress shadowFunction
STDLIB_MATH_BASE_NAPI_MODULE_Z_Z( stdlib_base_cneg )
STDLIB_MATH_BASE_NAPI_MODULE_Z_Z( stdlib_base_complex128_neg )
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

#include "stdlib/math/base/ops/cneg.h"
#include "stdlib/complex/float64/base/neg.h"
#include "stdlib/complex/float64/ctor.h"
#include "stdlib/complex/float64/reim.h"

Expand All @@ -33,15 +33,15 @@
*
* stdlib_complex128_t z = stdlib_complex128( 3.0, -2.0 );
*
* stdlib_complex128_t out = stdlib_base_cneg( z );
* stdlib_complex128_t out = stdlib_base_complex128_neg( z );
*
* double re = stdlib_complex128_real( out );
* // returns -3.0
*
* double im = stdlib_complex128_imag( out );
* // returns 2.0
*/
stdlib_complex128_t stdlib_base_cneg( const stdlib_complex128_t z ) {
stdlib_complex128_t stdlib_base_complex128_neg( const stdlib_complex128_t z ) {
double re;
double im;
stdlib_complex128_reim( z, &re, &im );
Expand Down
3 changes: 0 additions & 3 deletions lib/node_modules/@stdlib/math/base/ops/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ The namespace contains the following functions:

<div class="namespace-toc">

- <span class="signature">[`cneg( z )`][@stdlib/math/base/ops/cneg]</span><span class="delimiter">: </span><span class="description">negate a double-precision complex floating-point number.</span>
- <span class="signature">[`cnegf( z )`][@stdlib/math/base/ops/cnegf]</span><span class="delimiter">: </span><span class="description">negate a single-precision complex floating-point number.</span>
- <span class="signature">[`csub( z1, z2 )`][@stdlib/math/base/ops/csub]</span><span class="delimiter">: </span><span class="description">subtract two double-precision complex floating-point numbers.</span>
- <span class="signature">[`csubf( z1, z2 )`][@stdlib/math/base/ops/csubf]</span><span class="delimiter">: </span><span class="description">subtract two single-precision complex floating-point numbers.</span>
Expand Down Expand Up @@ -90,8 +89,6 @@ console.log( ns );

<!-- <toc-links> -->

[@stdlib/math/base/ops/cneg]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/ops/cneg

[@stdlib/math/base/ops/cnegf]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/ops/cnegf

[@stdlib/math/base/ops/csub]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/ops/csub
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/math/base/ops/cnegf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ int main( void ) {

## See Also

- <span class="package-name">[`@stdlib/math/base/ops/cneg`][@stdlib/math/base/ops/cneg]</span><span class="delimiter">: </span><span class="description">negate a double-precision complex floating-point number.</span>
- <span class="package-name">[`@stdlib/complex/float64/base/neg`][@stdlib/complex/float64/base/neg]</span><span class="delimiter">: </span><span class="description">negate a double-precision complex floating-point number.</span>
- <span class="package-name">[`@stdlib/math/base/special/cabsf`][@stdlib/math/base/special/cabsf]</span><span class="delimiter">: </span><span class="description">compute the absolute value of a single-precision complex floating-point number.</span>

</section>
Expand All @@ -268,7 +268,7 @@ int main( void ) {

<!-- <related-links> -->

[@stdlib/math/base/ops/cneg]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/ops/cneg
[@stdlib/complex/float64/base/neg]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/complex/float64/base/neg

[@stdlib/math/base/special/cabsf]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/cabsf

Expand Down
60 changes: 0 additions & 60 deletions lib/node_modules/@stdlib/math/base/ops/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import caddf = require( '@stdlib/complex/float32/base/add' );
import cmulf = require( '@stdlib/complex/float32/base/mul' );
import cadd = require( '@stdlib/complex/float64/base/add' );
import cmul = require( '@stdlib/complex/float64/base/mul' );
import cneg = require( '@stdlib/math/base/ops/cneg' );
import cnegf = require( '@stdlib/math/base/ops/cnegf' );
import csub = require( '@stdlib/math/base/ops/csub' );
import csubf = require( '@stdlib/math/base/ops/csubf' );
Expand Down Expand Up @@ -203,65 +202,6 @@ interface Namespace {
*/
cmul: typeof cmul;

/**
* Negates a double-precision complex floating-point number.
*
* @param z - complex number
* @returns result
*
* @example
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
* var real = require( '@stdlib/complex/float64/real' );
* var imag = require( '@stdlib/complex/float64/imag' );
*
* var z1 = new Complex128( -4.2, 5.5 );
* // returns <Complex128>
*
* var out = ns.cneg( z1 );
* // returns <Complex128>
*
* var re = real( out );
* // returns 4.2
*
* var im = imag( out );
* // returns -5.5
*
* @example
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
* var real = require( '@stdlib/complex/float64/real' );
* var imag = require( '@stdlib/complex/float64/imag' );
*
* var z2 = new Complex128( 0.0, 0.0 );
* // returns <Complex128>
*
* var out = ns.cneg( z2 );
* // returns <Complex128>
*
* var re = real( out );
* // returns -0.0
*
* var im = imag( out );
* // returns -0.0
*
* @example
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
* var real = require( '@stdlib/complex/float64/real' );
* var imag = require( '@stdlib/complex/float64/imag' );
*
* var z3 = new Complex128( NaN, NaN );
* // returns <Complex128>
*
* var out = ns.cneg( z3 );
* // returns <Complex128>
*
* var re = real( out );
* // returns NaN
*
* var im = imag( out );
* // returns NaN
*/
cneg: typeof cneg;

/**
* Negates a single-precision complex floating-point number.
*
Expand Down
9 changes: 0 additions & 9 deletions lib/node_modules/@stdlib/math/base/ops/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,6 @@ setReadOnly( ns, 'cadd', require( '@stdlib/complex/float64/base/add' ) );
*/
setReadOnly( ns, 'cmul', require( '@stdlib/complex/float64/base/mul' ) );

/**
* @name cneg
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/math/base/ops/cneg}
*/
setReadOnly( ns, 'cneg', require( '@stdlib/math/base/ops/cneg' ) );

/**
* @name cnegf
* @memberof ns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ int main( void ) {

## See Also

- <span class="package-name">[`@stdlib/math/base/ops/cneg`][@stdlib/math/base/ops/cneg]</span><span class="delimiter">: </span><span class="description">negate a double-precision complex floating-point number.</span>
- <span class="package-name">[`@stdlib/complex/float64/base/neg`][@stdlib/complex/float64/base/neg]</span><span class="delimiter">: </span><span class="description">negate a double-precision complex floating-point number.</span>
- <span class="package-name">[`@stdlib/math/base/special/csignum`][@stdlib/math/base/special/csignum]</span><span class="delimiter">: </span><span class="description">evaluate the signum function of a double-precision complex floating-point number.</span>

</section>
Expand All @@ -240,7 +240,7 @@ int main( void ) {

<!-- <related-links> -->

[@stdlib/math/base/ops/cneg]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/ops/cneg
[@stdlib/complex/float64/base/neg]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/complex/float64/base/neg

[@stdlib/math/base/special/csignum]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/csignum

Expand Down
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/namespace/alias2pkg/data/data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ base.clamp,"@stdlib/math/base/special/clamp"
base.clampf,"@stdlib/math/base/special/clampf"
base.cmul,"@stdlib/complex/float64/base/mul"
base.cmulf,"@stdlib/complex/float32/base/mul"
base.cneg,"@stdlib/math/base/ops/cneg"
base.cneg,"@stdlib/complex/float64/base/neg"
base.cnegf,"@stdlib/math/base/ops/cnegf"
base.codePointAt,"@stdlib/string/base/code-point-at"
base.constantcase,"@stdlib/string/base/constantcase"
Expand Down

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions lib/node_modules/@stdlib/namespace/lib/namespace/base/c.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
});

ns.push({
'alias': 'base.cabsf',

Check warning on line 66 in lib/node_modules/@stdlib/namespace/lib/namespace/base/c.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "cabsf"
'path': '@stdlib/math/base/special/cabsf',
'value': require( '@stdlib/math/base/special/cabsf' ),
'type': 'Function',
Expand All @@ -75,7 +75,7 @@
});

ns.push({
'alias': 'base.cadd',

Check warning on line 78 in lib/node_modules/@stdlib/namespace/lib/namespace/base/c.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "cadd"
'path': '@stdlib/complex/float64/base/add',
'value': require( '@stdlib/complex/float64/base/add' ),
'type': 'Function',
Expand All @@ -87,7 +87,7 @@
});

ns.push({
'alias': 'base.caddf',

Check warning on line 90 in lib/node_modules/@stdlib/namespace/lib/namespace/base/c.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "caddf"
'path': '@stdlib/complex/float32/base/add',
'value': require( '@stdlib/complex/float32/base/add' ),
'type': 'Function',
Expand Down Expand Up @@ -135,7 +135,7 @@
});

ns.push({
'alias': 'base.cbrtf',

Check warning on line 138 in lib/node_modules/@stdlib/namespace/lib/namespace/base/c.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "cbrtf"
'path': '@stdlib/math/base/special/cbrtf',
'value': require( '@stdlib/math/base/special/cbrtf' ),
'type': 'Function',
Expand All @@ -147,7 +147,7 @@
});

ns.push({
'alias': 'base.cceil',

Check warning on line 150 in lib/node_modules/@stdlib/namespace/lib/namespace/base/c.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "cceil"
'path': '@stdlib/math/base/special/cceil',
'value': require( '@stdlib/math/base/special/cceil' ),
'type': 'Function',
Expand All @@ -159,7 +159,7 @@
});

ns.push({
'alias': 'base.cceilf',

Check warning on line 162 in lib/node_modules/@stdlib/namespace/lib/namespace/base/c.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "cceilf"
'path': '@stdlib/math/base/special/cceilf',
'value': require( '@stdlib/math/base/special/cceilf' ),
'type': 'Function',
Expand All @@ -172,7 +172,7 @@
});

ns.push({
'alias': 'base.cceiln',

Check warning on line 175 in lib/node_modules/@stdlib/namespace/lib/namespace/base/c.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "cceiln"
'path': '@stdlib/math/base/special/cceiln',
'value': require( '@stdlib/math/base/special/cceiln' ),
'type': 'Function',
Expand All @@ -184,7 +184,7 @@
});

ns.push({
'alias': 'base.ccis',

Check warning on line 187 in lib/node_modules/@stdlib/namespace/lib/namespace/base/c.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "ccis"
'path': '@stdlib/math/base/special/ccis',
'value': require( '@stdlib/math/base/special/ccis' ),
'type': 'Function',
Expand All @@ -192,7 +192,7 @@
});

ns.push({
'alias': 'base.cdiv',

Check warning on line 195 in lib/node_modules/@stdlib/namespace/lib/namespace/base/c.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "cdiv"
'path': '@stdlib/complex/float64/base/div',
'value': require( '@stdlib/complex/float64/base/div' ),
'type': 'Function',
Expand Down Expand Up @@ -242,7 +242,7 @@
});

ns.push({
'alias': 'base.ceilb',

Check warning on line 245 in lib/node_modules/@stdlib/namespace/lib/namespace/base/c.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "ceilb"
'path': '@stdlib/math/base/special/ceilb',
'value': require( '@stdlib/math/base/special/ceilb' ),
'type': 'Function',
Expand Down Expand Up @@ -305,7 +305,7 @@
'value': require( '@stdlib/math/base/special/cflipsign' ),
'type': 'Function',
'related': [
'@stdlib/math/base/ops/cneg',
'@stdlib/complex/float64/base/neg',
'@stdlib/math/base/special/csignum'
]
});
Expand Down Expand Up @@ -427,8 +427,8 @@

ns.push({
'alias': 'base.cneg',
'path': '@stdlib/math/base/ops/cneg',
'value': require( '@stdlib/math/base/ops/cneg' ),
'path': '@stdlib/complex/float64/base/neg',
'value': require( '@stdlib/complex/float64/base/neg' ),
'type': 'Function',
'related': [
'@stdlib/math/base/special/cabs'
Expand All @@ -441,7 +441,7 @@
'value': require( '@stdlib/math/base/ops/cnegf' ),
'type': 'Function',
'related': [
'@stdlib/math/base/ops/cneg',
'@stdlib/complex/float64/base/neg',
'@stdlib/math/base/special/cabsf'
]
});
Expand Down
Loading