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: add napi/argv-complex128 #1445

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
1faaaa6
init
Mar 2, 2024
1d45338
added stdlib/napi/argv-complex128
Mar 2, 2024
70e0cb7
feat: add C implementation for `math/base/special/min`
aman-095 Mar 2, 2024
83c859c
feat: add C implementation for `math/base/special/acovercos`
adarshpalaskar1 Mar 2, 2024
a5f357d
feat: add `complex/parse-float32`
Rejoan-Sardar Mar 2, 2024
da16b86
feat: add C implementation for `math/base/special/logaddexp`
aman-095 Mar 2, 2024
036822b
feat: add `array/base/count-if`
PoookieCoder Mar 2, 2024
1e5ba13
chore: update package meta data
stdlib-bot Mar 3, 2024
f1f463b
feat: update error databases
stdlib-bot Mar 3, 2024
aa7d38a
docs: update list of contributors
stdlib-bot Mar 3, 2024
19f8b0b
docs: update REPL namespace documentation
stdlib-bot Mar 3, 2024
c0e5361
feat: add C implementation for `math/base/special/minabs`
aman-095 Mar 3, 2024
739ae39
docs: improve `time/base` README Examples
Oneday12323 Mar 3, 2024
ef37a9f
feat: add C implementation for `math/base/special/log`
aman-095 Mar 3, 2024
2192c36
feat: Add C implementation for `math/base/assert/is-even`
aman-095 Mar 3, 2024
ad90536
refactor: update `blas/ext/base/dfill` to follow current project conv…
Snehil-Shah Mar 3, 2024
87b4900
docs: update REPL namespace documentation
stdlib-bot Mar 3, 2024
5541bd3
docs: update namespace TypeScript declarations
stdlib-bot Mar 3, 2024
9ad9c12
feat: add `assert/is-same-date-object`
adityacodes30 Mar 3, 2024
45aa4cf
bench: update `assert/is-boolean` benchmarks to measure affirmative/n…
Snehil-Shah Mar 3, 2024
365ae8e
feat: add `utils/every-own-by`
PraneGIT Mar 3, 2024
9cd8a84
docs: update list of contributors
stdlib-bot Mar 4, 2024
63e4370
docs: remove blank lines
stdlib-bot Mar 4, 2024
3a0c7dd
feat: add C implementation for `constants/int32/max`
Pranavchiku Mar 4, 2024
1267ce6
refactor: update `blas/ext/base/ssumpw` to follow current project con…
lovelindhoni Mar 4, 2024
995be99
docs: update REPL namespace documentation
stdlib-bot Mar 4, 2024
6e2a4eb
feat: add `utils/none-in-by`
AgPriyanshu18 Mar 5, 2024
7ec1ab8
feat: add `utils/any-in-by`
itsspriyansh Mar 5, 2024
074ae60
feat: add Node-API macros for binary functions
aman-095 Mar 5, 2024
dbb0d4d
docs: update list of contributors
stdlib-bot Mar 5, 2024
05ef806
refactor: update `blas/ext/base/ssumors` to follow current project c…
lovelindhoni Mar 5, 2024
6de884a
docs: update REPL namespace documentation
stdlib-bot Mar 5, 2024
8add443
refactor: update `blas/ext/base/srev` to follow current project conve…
Snehil-Shah Mar 5, 2024
3f0ccb8
docs: update namespace TypeScript declarations
stdlib-bot Mar 5, 2024
2f2788c
docs: fix errors in various C examples
Pranavchiku Mar 5, 2024
b2f82ab
docs: update REPL namespace documentation
stdlib-bot Mar 5, 2024
33b4f70
feat: add C implementation for `math/base/assert/is-odd`
Shashankss1205 Mar 5, 2024
3a9250d
docs: update namespace table of contents
stdlib-bot Mar 5, 2024
132f01f
feat: add C implementation for `math/base/special/coth`
lovelindhoni Mar 5, 2024
44f362e
feat: add `string/base/stickycase`
anudeeps0306 Mar 5, 2024
a5fb268
feat: add `array/base/join`
adityacodes30 Mar 5, 2024
5442566
chore: resolve lint errors
Planeshifter Mar 5, 2024
6b161cd
build: add script to update gypfile fields
Planeshifter Mar 5, 2024
790038d
fix: add missing gypfile field entries
Planeshifter Mar 5, 2024
e85db40
style: use two spaces for indentation
Planeshifter Mar 5, 2024
b6d56eb
build: update gypfile field in workflow
Planeshifter Mar 5, 2024
1bc25a7
docs: update list of contributors
stdlib-bot Mar 6, 2024
e8d2126
docs: remove blank line
stdlib-bot Mar 6, 2024
e72aa33
fix: rename configuration file
Pranavchiku Mar 6, 2024
54d4493
feat: add C implementation for `math/base/special/ellipe`
gunjjoshi Mar 6, 2024
bb3e47f
fix: use correct function name
kgryte Mar 6, 2024
be018c2
fix: update polynomial functions and fix function call
kgryte Mar 6, 2024
d8b8b92
style: fix spacing
kgryte Mar 6, 2024
4ce2d22
feat: add `array/base/take-map`
vr-varad Mar 6, 2024
c4066d8
docs: improve README examples for `stats/base/dists/t` namespace
Jai0401 Mar 6, 2024
db71c7c
feat: add C implementation for `math/base/special/avercos`
Snehil-Shah Mar 6, 2024
794bf64
feat: add C implementation for `math/base/special/aversin`
Snehil-Shah Mar 6, 2024
a034381
docs: update REPL namespace documentation
stdlib-bot Mar 6, 2024
c4d57d4
build: run C examples in workflow
Planeshifter Mar 6, 2024
04f4f1d
build: compile native add-ons in affected tests workflow
Planeshifter Mar 7, 2024
d8c118f
chore: fix gypfile typo in description
Planeshifter Mar 7, 2024
cd45a26
Improved implementation
Mar 7, 2024
d3e5688
Merge branch 'stdlib-js:develop' into feature/@stdlib/napi/argv-compl…
PoookieCoder Mar 7, 2024
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
229 changes: 229 additions & 0 deletions lib/node_modules/@stdlib/napi/argv-complex128/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
<!--

@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.

-->

# argv_complex128

> Convert a Node-API value to a double-precision complex floating-point number.

<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

<section class="intro">

</section>

<!-- /.intro -->

<!-- Package usage documentation. -->

<section class="usage">

## Usage

```javascript
var headerDir = require( '@stdlib/napi/argv-complex128' );
```

#### headerDir

Absolute file path for the directory containing header files for C APIs.

```javascript
var dir = headerDir;
// returns <string>
```

</section>

<!-- /.usage -->

<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="notes">

</section>

<!-- /.notes -->

<!-- Package usage examples. -->

<section class="examples">

## Examples

```javascript
var headerDir = require( '@stdlib/napi/argv-complex128' );

console.log( headerDir );
// => <string>
```

</section>

<!-- /.examples -->

<!-- C interface documentation. -->

* * *

<section class="c">

## C APIs

<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

<section class="intro">

</section>

<!-- /.intro -->

<!-- C usage documentation. -->

<section class="usage">

### Usage

```c
#include "stdlib/napi/argv_complex128.h"
```

#### stdlib_napi_argv_complex128( env, value, \*out, \*message, \*err )

Converts a Node-API value to a double-precision complex floating-point number ( stdlib_complex128_t ).

```c
#include "stdlib/napi/argv_complex128.h"
#include <node_api.h>

static napi_value addon( napi_env env, napi_callback_info info ) {
napi_value value;

// ...

stdlib_complex128_t out;
napi_value err;
napi_status status = stdlib_napi_argv_complex128( env, value, &out, "Must be a Complex128 number.", &err );
assert( status == napi_ok );
if ( err != NULL ) {
assert( napi_throw( env, err ) == napi_ok );
return NULL;
}

// ...
}
```

The function accepts the following arguments:

- **env**: `[in] napi_env` environment under which the function is invoked.
- **value**: `[in] napi_value` Node-API value.
- **out**: `[out] stdlib_complex_128_t*` destination for storing output value.
- **message**: `[in] char*` error message.
- **err**: `[out] napi_value*` pointer for storing a JavaScript error. If not provided a number, the function sets `err` with a JavaScript error; otherwise, `err` is set to `NULL`.

```c
napi_status stdlib_napi_argv_complex128( const napi_env env, const napi_value value, stdlib_complex128_t *out, const char *message, napi_value *err );
```

The function returns a `napi_status` status code indicating success or failure (returns `napi_ok` if success).

#### STDLIB_NAPI_ARGV_COMPLEX128( env, name, argv, index )

Macro for converting an add-on callback argument to a double-precision complex floating-point number.

```c
#include "stdlib/napi/argv_complex128.h"
#include "stdlib/napi/argv.h"
#include "stdlib/complex/float64.h"
#include <node_api.h>

static stdlib_complex128_t fcn( const stdlib_complex128_t v ) {
return v;
}

// ...

static napi_value addon( napi_env env, napi_callback_info info ) {
// Retrieve add-on callback arguments:
STDLIB_NAPI_ARGV( env, info, argv, argc, 1 );

// Convert the first argument to a C type:
STDLIB_NAPI_ARGV_COMPLEX128( env, value, argv, 0 );

// ...

stdlib_complex128_t out = fcn( value );
}
```

The macro expects the following arguments:

- **env**: environment under which the callback is invoked.
- **name**: output variable name.
- **argv**: name of the variable containing add-on callback arguments.
- **index**: argument index.

</section>

<!-- /.usage -->

<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="notes">

</section>

<!-- /.notes -->

<!-- C API usage examples. -->

<section class="examples">

</section>

<!-- /.examples -->

</section>

<!-- /.c -->

<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="references">

</section>

<!-- /.references -->

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

<section class="related">

</section>

<!-- /.related -->

<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="links">

</section>

<!-- /.links -->
Loading
Loading