Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: migrate math/base/special/cidentityf to complex/float32/base/identity #6165

Merged
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 @@ -32,7 +32,7 @@
*
* @returns result
*/
type Nullary = () => any;

Check warning on line 35 in lib/node_modules/@stdlib/complex/base/wrap-function/docs/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type

/**
* Unary function accepting complex numbers.
Expand All @@ -40,7 +40,7 @@
* @param x - input value
* @returns result
*/
type Unary = ( x: ComplexLike ) => any;

Check warning on line 43 in lib/node_modules/@stdlib/complex/base/wrap-function/docs/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type

/**
* Unary function accepting both real and complex numbers.
Expand All @@ -48,7 +48,7 @@
* @param x - input value
* @returns result
*/
type WrappedUnary = ( x: RealOrComplex ) => any;

Check warning on line 51 in lib/node_modules/@stdlib/complex/base/wrap-function/docs/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type

/**
* Binary function accepting complex numbers.
Expand All @@ -57,7 +57,7 @@
* @param y - input value
* @returns result
*/
type Binary = ( x: ComplexLike, y: ComplexLike ) => any;

Check warning on line 60 in lib/node_modules/@stdlib/complex/base/wrap-function/docs/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type

/**
* Binary function accepting both real and complex numbers.
Expand All @@ -66,7 +66,7 @@
* @param y - input value
* @returns result
*/
type WrappedBinary = ( x: RealOrComplex, y: RealOrComplex ) => any;

Check warning on line 69 in lib/node_modules/@stdlib/complex/base/wrap-function/docs/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type

/**
* Ternary function accepting complex numbers.
Expand All @@ -76,7 +76,7 @@
* @param z - input value
* @returns result
*/
type Ternary = ( x: ComplexLike, y: ComplexLike, z: ComplexLike ) => any;

Check warning on line 79 in lib/node_modules/@stdlib/complex/base/wrap-function/docs/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type

/**
* Ternary function accepting both real and complex numbers.
Expand All @@ -86,7 +86,7 @@
* @param z - input value
* @returns result
*/
type WrappedTernary = ( x: RealOrComplex, y: RealOrComplex, z: RealOrComplex ) => any;

Check warning on line 89 in lib/node_modules/@stdlib/complex/base/wrap-function/docs/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type

/**
* Quaternary function accepting complex numbers.
Expand All @@ -97,7 +97,7 @@
* @param w - input value
* @returns result
*/
type Quaternary = ( x: ComplexLike, y: ComplexLike, z: ComplexLike, w: ComplexLike ) => any;

Check warning on line 100 in lib/node_modules/@stdlib/complex/base/wrap-function/docs/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type

/**
* Quaternary function accepting both real and complex numbers.
Expand All @@ -108,7 +108,7 @@
* @param w - input value
* @returns result
*/
type WrappedQuaternary = ( x: RealOrComplex, y: RealOrComplex, z: RealOrComplex, w: RealOrComplex ) => any;

Check warning on line 111 in lib/node_modules/@stdlib/complex/base/wrap-function/docs/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type

/**
* Quinary function accepting complex numbers.
Expand All @@ -120,7 +120,7 @@
* @param v - input value
* @returns result
*/
type Quinary = ( x: ComplexLike, y: ComplexLike, z: ComplexLike, w: ComplexLike, v: ComplexLike ) => any;

Check warning on line 123 in lib/node_modules/@stdlib/complex/base/wrap-function/docs/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type

/**
* Quinary function accepting both real and complex numbers.
Expand Down Expand Up @@ -219,7 +219,7 @@
*
* @example
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
* var cidentityf = require( '@stdlib/math/base/special/cidentityf' );
* var cidentityf = require( '@stdlib/complex/float32/base/identity' );
* var realf = require( '@stdlib/complex/float32/real' );
* var imagf = require( '@stdlib/complex/float32/imag' );
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ f(z) = z
```

<!-- <div class="equation" align="center" data-raw-text="f(z) = z" data-equation="eq:identity_function">
<img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@79c18caa8e6697ecbe8bcf813a8d54a470168a75/lib/node_modules/@stdlib/math/base/special/cidentityf/docs/img/equation_identity_function.svg" alt="Identity function">
<img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@79c18caa8e6697ecbe8bcf813a8d54a470168a75/lib/node_modules/@stdlib/complex/float32/base/identity/docs/img/equation_identity_function.svg" alt="Identity function">
<br>
</div> -->

Expand All @@ -50,7 +50,7 @@ for all `z`.
## Usage

```javascript
var cidentityf = require( '@stdlib/math/base/special/cidentityf' );
var cidentityf = require( '@stdlib/complex/float32/base/identity' );
```

#### cidentityf( z )
Expand Down Expand Up @@ -85,7 +85,7 @@ var im = imag( v );
```javascript
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
var Complex64 = require( '@stdlib/complex/float32/ctor' );
var cidentityf = require( '@stdlib/math/base/special/cidentityf' );
var cidentityf = require( '@stdlib/complex/float32/base/identity' );

var z;
var i;
Expand Down Expand Up @@ -122,17 +122,17 @@ for ( i = 0; i < 100; i++ ) {
### Usage

```c
#include "stdlib/math/base/special/cidentityf.h"
#include "stdlib/complex/float32/base/identity.h"
```

#### stdlib_base_cidentityf( z )
#### stdlib_base_complex64_identity( z )

Evaluates the identity function for a single-precision complex floating-point number.

```c
#include <complex.h>

float complex y = stdlib_base_cidentityf( 2.0f+2.0f*I );
float complex y = stdlib_base_complex64_identity( 2.0f+2.0f*I );
// returns 2.0f+2.0f*I
```

Expand All @@ -141,7 +141,7 @@ The function accepts the following arguments:
- **z**: `[in] float complex` input value.

```c
float complex stdlib_base_cidentityf( const float complex z );
float complex stdlib_base_complex64_identity( const float complex z );
```

</section>
Expand All @@ -163,7 +163,7 @@ float complex stdlib_base_cidentityf( const float complex z );
### Examples

```c
#include "stdlib/math/base/special/cidentityf.h"
#include "stdlib/complex/float32/base/identity.h"
#include <stdio.h>
#include <complex.h>

Expand All @@ -175,7 +175,7 @@ int main( void ) {
int i;
for ( i = 0; i < 4; i++ ) {
v = x[ i ];
y = stdlib_base_cidentityf( v );
y = stdlib_base_complex64_identity( v );
printf( "f(%f + %f) = %f + %f\n", crealf( v ), cimagf( v ), crealf( y ), cimagf( y ) );
}
}
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/special/cidentityf.h"
#include "stdlib/complex/float32/base/identity.h"
#include <complex.h>
#include <stdlib.h>
#include <stdio.h>
Expand Down Expand Up @@ -102,7 +102,7 @@ static double benchmark( void ) {
for ( i = 0; i < ITERATIONS; i++ ) {
v = ( 1000.0f*rand_float() ) - 500.0f;
x = v + v*I;
y = stdlib_base_cidentityf( x );
y = stdlib_base_complex64_identity( x );
if ( crealf( y ) != v ) {
printf( "unexpected result\n" );
break;
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/special/cidentityf.h"
#include "stdlib/complex/float32/base/identity.h"
#include <stdio.h>
#include <complex.h>

Expand All @@ -28,7 +28,7 @@ int main( void ) {
int i;
for ( i = 0; i < 4; i++ ) {
v = x[ i ];
y = stdlib_base_cidentityf( v );
y = stdlib_base_complex64_identity( v );
printf( "f(%f + %f) = %f + %f\n", crealf( v ), cimagf( v ), crealf( y ), cimagf( y ) );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* limitations under the License.
*/

#ifndef STDLIB_MATH_BASE_SPECIAL_CIDENTITYF_H
#define STDLIB_MATH_BASE_SPECIAL_CIDENTITYF_H
#ifndef STDLIB_COMPLEX_FLOAT32_BASE_IDENTITY_H
#define STDLIB_COMPLEX_FLOAT32_BASE_IDENTITY_H

#include <complex.h>

Expand All @@ -31,10 +31,10 @@ extern "C" {
/**
* Evaluates the identity function for a single-precision complex floating-point number.
*/
float complex stdlib_base_cidentityf( const float complex z );
float complex stdlib_base_complex64_identity( const float complex z );

#ifdef __cplusplus
}
#endif

#endif // !STDLIB_MATH_BASE_SPECIAL_CIDENTITYF_H
#endif // !STDLIB_COMPLEX_FLOAT32_BASE_IDENTITY_H
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
/**
* Evaluate the identity function for a single-precision complex floating-point number.
*
* @module @stdlib/math/base/special/cidentityf
* @module @stdlib/complex/float32/base/identity
*
* @example
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
* var real = require( '@stdlib/complex/float32/real' );
* var imag = require( '@stdlib/complex/float32/imag' );
* var cidentityf = require( '@stdlib/math/base/special/cidentityf' );
* var cidentityf = require( '@stdlib/complex/float32/base/identity' );
*
* var v = cidentityf( new Complex64( -1.0, 2.0 ) );
* // returns <Complex64>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"options": {},
"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": [
{
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": []
}
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@stdlib/math/base/special/cidentityf",
"name": "@stdlib/complex/float32/base/identity",
"version": "0.0.0",
"description": "Evaluate the identity function for 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,7 +16,7 @@
* limitations under the License.
*/

#include "stdlib/math/base/special/cidentityf.h"
#include "stdlib/complex/float32/base/identity.h"
#include <complex.h>

/**
Expand All @@ -26,8 +26,8 @@
* @return input value
*
* @example
* float complex y = stdlib_base_cidentityf( 3.0f+3.0f*I );
* float complex y = stdlib_base_complex64_identity( 3.0f+3.0f*I );
*/
float complex stdlib_base_cidentityf( const float complex z ) {
float complex stdlib_base_complex64_identity( const float complex z ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: we should be using stdlib_complex64_t. This package needs updating after merging.

return z;
}
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ int main() {

## See Also

- <span class="package-name">[`@stdlib/math/base/special/cidentityf`][@stdlib/math/base/special/cidentityf]</span><span class="delimiter">: </span><span class="description">evaluate the identity function for a single-precision complex floating-point number.</span>
- <span class="package-name">[`@stdlib/complex/float32/base/identity`][@stdlib/complex/float32/base/identity]</span><span class="delimiter">: </span><span class="description">evaluate the identity function for a single-precision complex floating-point number.</span>
- <span class="package-name">[`@stdlib/number/float64/base/identity`][@stdlib/number/float64/base/identity]</span><span class="delimiter">: </span><span class="description">evaluate the identity function for a double-precision floating-point number.</span>

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

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

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

[@stdlib/number/float64/base/identity]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/number/float64/base/identity

Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/math/base/special/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ var fcns = special;
- <span class="signature">[`cexp( z )`][@stdlib/math/base/special/cexp]</span><span class="delimiter">: </span><span class="description">evaluate the exponential function for a double-precision complex floating-point number.</span>
- <span class="signature">[`cflipsign( z, y )`][@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>
- <span class="signature">[`cflipsignf( z, y )`][@stdlib/math/base/special/cflipsignf]</span><span class="delimiter">: </span><span class="description">return a single-precision complex floating-point number with the same magnitude as `z` and the sign of `y*z`.</span>
- <span class="signature">[`cidentityf( z )`][@stdlib/math/base/special/cidentityf]</span><span class="delimiter">: </span><span class="description">evaluate the identity function of a single-precision complex floating-point number.</span>
- <span class="signature">[`cidentityf( z )`][@stdlib/complex/float32/base/identity]</span><span class="delimiter">: </span><span class="description">evaluate the identity function of a single-precision complex floating-point number.</span>
- <span class="signature">[`cinv( z )`][@stdlib/math/base/special/cinv]</span><span class="delimiter">: </span><span class="description">compute the inverse of a double-precision complex floating-point number.</span>
- <span class="signature">[`copysign( x, y )`][@stdlib/math/base/special/copysign]</span><span class="delimiter">: </span><span class="description">return a double-precision floating-point number with the magnitude of `x` and the sign of `y`.</span>
- <span class="signature">[`copysignf( x, y )`][@stdlib/math/base/special/copysignf]</span><span class="delimiter">: </span><span class="description">return a single-precision floating-point number with the magnitude of `x` and the sign of `y`.</span>
Expand Down Expand Up @@ -477,7 +477,7 @@ console.log( objectKeys( special ) );

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

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

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

Expand Down

This file was deleted.

23 changes: 0 additions & 23 deletions lib/node_modules/@stdlib/math/base/special/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ import cflipsign = require( '@stdlib/math/base/special/cflipsign' );
import cflipsignf = require( '@stdlib/math/base/special/cflipsignf' );
import cfloor = require( '@stdlib/math/base/special/cfloor' );
import cfloorn = require( '@stdlib/math/base/special/cfloorn' );
import cidentityf = require( '@stdlib/math/base/special/cidentityf' );
import cinv = require( '@stdlib/math/base/special/cinv' );
import clamp = require( '@stdlib/math/base/special/clamp' );
import clampf = require( '@stdlib/math/base/special/clampf' );
Expand Down Expand Up @@ -2402,28 +2401,6 @@ interface Namespace {
*/
cfloorn: typeof cfloorn;

/**
* Evaluates the identity function for single-precision complex floating-point number.
*
* @param z - input value
* @returns input value
*
* @example
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
* var real = require( '@stdlib/complex/float32/real' );
* var imag = require( '@stdlib/complex/float32/imag' );
*
* var v = ns.cidentityf( new Complex64( -1.0, 2.0 ) );
* // returns <Complex64>
*
* var re = real( v );
* // returns -1.0
*
* var im = imag( v );
* // returns 2.0
*/
cidentityf: typeof cidentityf;

/**
* Computes the inverse of a double-precision complex floating-point number.
*
Expand Down
9 changes: 0 additions & 9 deletions lib/node_modules/@stdlib/math/base/special/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

'use strict';

Check warning on line 19 in lib/node_modules/@stdlib/math/base/special/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`cfloorf` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/math/base/special/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`aversinf` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/math/base/special/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`avercosf` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/math/base/special/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`atandf` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/math/base/special/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`ahaversinf` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/math/base/special/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`ahavercosf` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/math/base/special/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`acoversinf` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/math/base/special/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`acovercosf` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/math/base/special/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`acotdf` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/math/base/special/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`acosdf` should be exported from namespace `index.js`

/*
* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.
Expand Down Expand Up @@ -720,15 +720,6 @@
*/
setReadOnly( special, 'cfloorn', require( '@stdlib/math/base/special/cfloorn' ) );

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

/**
* @name cinv
* @memberof special
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 @@ -207,7 +207,7 @@ base.cflipsignf,"@stdlib/math/base/special/cflipsignf"
base.cfloor,"@stdlib/math/base/special/cfloor"
base.cfloorn,"@stdlib/math/base/special/cfloorn"
base.cidentity,"@stdlib/complex/float64/base/identity"
base.cidentityf,"@stdlib/math/base/special/cidentityf"
base.cidentityf,"@stdlib/complex/float32/base/identity"
base.cinv,"@stdlib/math/base/special/cinv"
base.clamp,"@stdlib/math/base/special/clamp"
base.clampf,"@stdlib/math/base/special/clampf"
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 @@ -352,15 +352,15 @@ ns.push({
'value': require( '@stdlib/complex/float64/base/identity' ),
'type': 'Function',
'related': [
'@stdlib/math/base/special/cidentityf',
'@stdlib/complex/float32/base/identity',
'@stdlib/number/float64/base/identity'
]
});

ns.push({
'alias': 'base.cidentityf',
'path': '@stdlib/math/base/special/cidentityf',
'value': require( '@stdlib/math/base/special/cidentityf' ),
'path': '@stdlib/complex/float32/base/identity',
'value': require( '@stdlib/complex/float32/base/identity' ),
'type': 'Function',
'related': [
'@stdlib/complex/float64/base/identity',
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 @@ -207,7 +207,7 @@
"@stdlib/math/base/special/cfloor",base.cfloor
"@stdlib/math/base/special/cfloorn",base.cfloorn
"@stdlib/complex/float64/base/identity",base.cidentity
"@stdlib/math/base/special/cidentityf",base.cidentityf
"@stdlib/complex/float32/base/identity",base.cidentityf
"@stdlib/math/base/special/cinv",base.cinv
"@stdlib/math/base/special/clamp",base.clamp
"@stdlib/math/base/special/clampf",base.clampf
Expand Down

Large diffs are not rendered by default.

Loading
Loading