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 cnegf = require( '@stdlib/math/base/ops/cnegf' );
var cnegf = require( '@stdlib/complex/float32/base/neg' );
```

#### cnegf( z )
Expand Down Expand Up @@ -106,7 +106,7 @@ im = imagf( out );
```javascript
var Complex64 = require( '@stdlib/complex/float32/ctor' );
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
var cnegf = require( '@stdlib/math/base/ops/cnegf' );
var cnegf = require( '@stdlib/complex/float32/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/cnegf.h"
#include "stdlib/complex/float32/base/neg.h"
```

#### stdlib_base_cnegf( z )
#### stdlib_base_complex64_neg( z )

Negates a single-precision complex floating-point number.

Expand All @@ -165,7 +165,7 @@ Negates a single-precision complex floating-point number.
#include "stdlib/complex/float32/imag.h"

stdlib_complex64_t z = stdlib_complex64( 3.0f, -2.0f );
stdlib_complex64_t out = stdlib_base_cnegf( z );
stdlib_complex64_t out = stdlib_base_complex64_neg( z );

float re = stdlib_complex64_real( out );
// returns -3.0f
Expand All @@ -179,7 +179,7 @@ The function accepts the following arguments:
- **z**: `[in] stdlib_complex64_t` input value.

```c
stdlib_complex64_t stdlib_base_cnegf( const stdlib_complex64_t z );
stdlib_complex64_t stdlib_base_complex64_neg( const stdlib_complex64_t z );
```

</section>
Expand All @@ -201,7 +201,7 @@ stdlib_complex64_t stdlib_base_cnegf( const stdlib_complex64_t z );
### Examples

```c
#include "stdlib/math/base/ops/cnegf.h"
#include "stdlib/complex/float32/base/neg.h"
#include "stdlib/complex/float32/ctor.h"
#include "stdlib/complex/float32/reim.h"
#include <stdio.h>
Expand All @@ -224,7 +224,7 @@ int main( void ) {
stdlib_complex64_reim( v, &re, &im );
printf( "z = %f + %fi\n", re, im );

y = stdlib_base_cnegf( v );
y = stdlib_base_complex64_neg( v );
stdlib_complex64_reim( y, &re, &im );
printf( "cnegf(z) = %f + %fi\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/cnegf.h"
#include "stdlib/complex/float32/base/neg.h"
#include "stdlib/complex/float32/ctor.h"
#include "stdlib/complex/float32/reim.h"
#include <stdlib.h>
Expand Down Expand Up @@ -107,7 +107,7 @@ static double benchmark( void ) {
im = ( 1000.0f*rand_float() ) - 500.0f;
z1 = stdlib_complex64( re, im );

z2 = stdlib_base_cnegf( z1 );
z2 = stdlib_base_complex64_neg( z1 );
stdlib_complex64_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: Complex64
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/cnegf.h"
#include "stdlib/complex/float32/base/neg.h"
#include "stdlib/complex/float32/ctor.h"
#include "stdlib/complex/float32/reim.h"
#include <stdio.h>
Expand All @@ -39,7 +39,7 @@ int main( void ) {
stdlib_complex64_reim( v, &re, &im );
printf( "z = %f + %fi\n", re, im );

y = stdlib_base_cnegf( v );
y = stdlib_base_complex64_neg( v );
stdlib_complex64_reim( y, &re, &im );
printf( "cnegf(z) = %f + %fi\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_CNEGF_H
#define STDLIB_MATH_BASE_OPS_CNEGF_H
#ifndef STDLIB_COMPLEX_FLOAT32_BASE_NEG_H
#define STDLIB_COMPLEX_FLOAT32_BASE_NEG_H

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

Expand All @@ -31,10 +31,10 @@ extern "C" {
/**
* Negates a single-precision complex floating-point number.
*/
stdlib_complex64_t stdlib_base_cnegf( const stdlib_complex64_t z );
stdlib_complex64_t stdlib_base_complex64_neg( const stdlib_complex64_t z );

#ifdef __cplusplus
}
#endif

#endif // !STDLIB_MATH_BASE_OPS_CNEGF_H
#endif // !STDLIB_COMPLEX_FLOAT32_BASE_NEG_H
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
/**
* Negate a single-precision complex floating-point number.
*
* @module @stdlib/math/base/ops/cnegf
* @module @stdlib/complex/float32/base/neg
*
* @example
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
* var realf = require( '@stdlib/complex/float32/real' );
* var imagf = require( '@stdlib/complex/float32/imag' );
* var cnegf = require( '@stdlib/math/base/ops/cnegf' );
* var cnegf = require( '@stdlib/complex/float32/base/neg' );
*
* var z = new Complex64( -4.0, 5.0 );
* // returns <Complex64>
Expand All @@ -45,7 +45,7 @@
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
* var realf = require( '@stdlib/complex/float32/real' );
* var imagf = require( '@stdlib/complex/float32/imag' );
* var cnegf = require( '@stdlib/math/base/ops/cnegf' );
* var cnegf = require( '@stdlib/complex/float32/base/neg' );
*
* var z = new Complex64( 0.0, 0.0 );
* // returns <Complex64>
Expand All @@ -63,7 +63,7 @@
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
* var realf = require( '@stdlib/complex/float32/real' );
* var imagf = require( '@stdlib/complex/float32/imag' );
* var cnegf = require( '@stdlib/math/base/ops/cnegf' );
* var cnegf = require( '@stdlib/complex/float32/base/neg' );
*
* var z = new Complex64( NaN, NaN );
* // returns <Complex64>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@stdlib/math/base/ops/cnegf",
"name": "@stdlib/complex/float32/base/neg",
"version": "0.0.0",
"description": "Negate a single-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/cnegf.h"
#include "stdlib/complex/float32/base/neg.h"
#include "stdlib/math/base/napi/unary.h"

// cppcheck-suppress shadowFunction
STDLIB_MATH_BASE_NAPI_MODULE_C_C( stdlib_base_cnegf )
STDLIB_MATH_BASE_NAPI_MODULE_C_C( stdlib_base_complex64_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/cnegf.h"
#include "stdlib/complex/float32/base/neg.h"
#include "stdlib/complex/float32/ctor.h"
#include "stdlib/complex/float32/reim.h"

Expand All @@ -32,15 +32,15 @@
* #include "stdlib/complex/float32/imag.h"
*
* stdlib_complex64_t z = stdlib_complex64( 3.0f, -2.0f );
* stdlib_complex64_t out = stdlib_base_cnegf( z );
* stdlib_complex64_t out = stdlib_base_complex64_neg( z );
*
* float re = stdlib_complex64_real( out );
* // returns -3.0f
*
* float im = stdlib_complex64_imag( out );
* // returns 2.0f
*/
stdlib_complex64_t stdlib_base_cnegf( const stdlib_complex64_t z ) {
stdlib_complex64_t stdlib_base_complex64_neg( const stdlib_complex64_t z ) {
float re;
float im;

Expand Down
4 changes: 2 additions & 2 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,7 @@ The namespace contains the following functions:

<div class="namespace-toc">

- <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">[`cnegf( z )`][@stdlib/complex/float32/base/neg]</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 @@ -89,7 +89,7 @@ console.log( ns );

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

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

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

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 cnegf = require( '@stdlib/math/base/ops/cnegf' );
import csub = require( '@stdlib/math/base/ops/csub' );
import csubf = require( '@stdlib/math/base/ops/csubf' );
import div = require( '@stdlib/number/float64/base/div' );
Expand Down Expand Up @@ -202,65 +201,6 @@ interface Namespace {
*/
cmul: typeof cmul;

/**
* Negates a single-precision complex floating-point number.
*
* @param z - complex number
* @returns result
*
* @example
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
* var realf = require( '@stdlib/complex/float32/real' );
* var imagf = require( '@stdlib/complex/float32/imag' );
*
* var z = new Complex64( -4.2, 5.5 );
* // returns <Complex64>
*
* var out = ns.cnegf( z );
* // returns <Complex64>
*
* var re = realf( out );
* // returns 4.2
*
* var im = imagf( out );
* // returns -5.5
*
* @example
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
* var realf = require( '@stdlib/complex/float32/real' );
* var imagf = require( '@stdlib/complex/float32/imag' );
*
* var z = new Complex64( 0.0, 0.0 );
* // returns <Complex64>
*
* var out = ns.cnegf( z );
* // returns <Complex64>
*
* var re = realf( out );
* // returns -0.0
*
* var im = imagf( out );
* // returns -0.0
*
* @example
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
* var realf = require( '@stdlib/complex/float32/real' );
* var imagf = require( '@stdlib/complex/float32/imag' );
*
* var z = new Complex64( NaN, NaN );
* // returns <Complex64>
*
* var out = ns.cnegf( z );
* // returns <Complex64>
*
* var re = realf( out );
* // returns NaN
*
* var im = imagf( out );
* // returns NaN
*/
cnegf: typeof cnegf;

/**
* Subtracts two double-precision complex floating-point numbers.
*
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 cnegf
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/math/base/ops/cnegf}
*/
setReadOnly( ns, 'cnegf', require( '@stdlib/math/base/ops/cnegf' ) );

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

## See Also

- <span class="package-name">[`@stdlib/math/base/ops/cnegf`][@stdlib/math/base/ops/cnegf]</span><span class="delimiter">: </span><span class="description">negate a single-precision complex floating-point number.</span>
- <span class="package-name">[`@stdlib/complex/float32/base/neg`][@stdlib/complex/float32/base/neg]</span><span class="delimiter">: </span><span class="description">negate a single-precision complex floating-point number.</span>
- <span class="package-name">[`@stdlib/math/base/special/cflipsign`][@stdlib/math/base/special/cflipsign]</span><span class="delimiter">: </span><span class="description">return a double-precision complex floating-point number with the same magnitude as `z` and the sign of `y*z`.</span>

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

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

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

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

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 @@ -214,7 +214,7 @@ base.clampf,"@stdlib/math/base/special/clampf"
base.cmul,"@stdlib/complex/float64/base/mul"
base.cmulf,"@stdlib/complex/float32/base/mul"
base.cneg,"@stdlib/complex/float64/base/neg"
base.cnegf,"@stdlib/math/base/ops/cnegf"
base.cnegf,"@stdlib/complex/float32/base/neg"
base.codePointAt,"@stdlib/string/base/code-point-at"
base.constantcase,"@stdlib/string/base/constantcase"
base.continuedFraction,"@stdlib/math/base/tools/continued-fraction"
Expand Down

Large diffs are not rendered by default.

6 changes: 3 additions & 3 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 @@ -316,7 +316,7 @@
'value': require( '@stdlib/math/base/special/cflipsignf' ),
'type': 'Function',
'related': [
'@stdlib/math/base/ops/cnegf',
'@stdlib/complex/float32/base/neg',
'@stdlib/math/base/special/cflipsign',
'@stdlib/math/base/special/csignumf'
]
Expand Down Expand Up @@ -437,8 +437,8 @@

ns.push({
'alias': 'base.cnegf',
'path': '@stdlib/math/base/ops/cnegf',
'value': require( '@stdlib/math/base/ops/cnegf' ),
'path': '@stdlib/complex/float32/base/neg',
'value': require( '@stdlib/complex/float32/base/neg' ),
'type': 'Function',
'related': [
'@stdlib/complex/float64/base/neg',
Expand Down
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/namespace/pkg2alias/data/data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
"@stdlib/complex/float64/base/mul",base.cmul
"@stdlib/complex/float32/base/mul",base.cmulf
"@stdlib/complex/float64/base/neg",base.cneg
"@stdlib/math/base/ops/cnegf",base.cnegf
"@stdlib/complex/float32/base/neg",base.cnegf
"@stdlib/string/base/code-point-at",base.codePointAt
"@stdlib/string/base/constantcase",base.constantcase
"@stdlib/math/base/tools/continued-fraction",base.continuedFraction
Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/namespace/pkg2related/data/data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
"@stdlib/math/base/special/ceilsd","@stdlib/math/base/special/ceil,@stdlib/math/base/special/floorsd,@stdlib/math/base/special/roundsd,@stdlib/math/base/special/truncsd"
"@stdlib/math/base/special/cexp",""
"@stdlib/math/base/special/cflipsign","@stdlib/complex/float64/base/neg,@stdlib/math/base/special/csignum"
"@stdlib/math/base/special/cflipsignf","@stdlib/math/base/ops/cnegf,@stdlib/math/base/special/cflipsign"
"@stdlib/math/base/special/cflipsignf","@stdlib/complex/float32/base/neg,@stdlib/math/base/special/cflipsign"
"@stdlib/math/base/special/cfloor","@stdlib/math/base/special/cceil,@stdlib/math/base/special/cfloorn,@stdlib/math/base/special/cround"
"@stdlib/math/base/special/cfloorn","@stdlib/math/base/special/cceiln,@stdlib/math/base/special/cfloor,@stdlib/math/base/special/croundn"
"@stdlib/math/base/special/cidentity","@stdlib/math/base/special/cidentityf,@stdlib/math/base/special/identity"
Expand All @@ -214,7 +214,7 @@
"@stdlib/complex/float64/base/mul","@stdlib/complex/float64/base/add,@stdlib/complex/float64/base/div,@stdlib/math/base/ops/csub"
"@stdlib/complex/float32/base/mul","@stdlib/complex/float32/base/add,@stdlib/complex/float64/base/mul,@stdlib/math/base/ops/csubf"
"@stdlib/complex/float64/base/neg","@stdlib/math/base/special/cabs"
"@stdlib/math/base/ops/cnegf","@stdlib/complex/float64/base/neg,@stdlib/math/base/special/cabsf"
"@stdlib/complex/float32/base/neg","@stdlib/complex/float64/base/neg,@stdlib/math/base/special/cabsf"
"@stdlib/string/base/code-point-at",""
"@stdlib/string/base/constantcase","@stdlib/string/base/camelcase,@stdlib/string/base/lowercase,@stdlib/string/base/snakecase,@stdlib/string/base/uppercase"
"@stdlib/math/base/tools/continued-fraction",""
Expand Down

Large diffs are not rendered by default.

Loading