Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 50c83ec

Browse files
committedDec 27, 2024·
Auto-generated commit
1 parent 923803a commit 50c83ec

File tree

6 files changed

+95
-134
lines changed

6 files changed

+95
-134
lines changed
 

‎CHANGELOG.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2024-12-23)
7+
## Unreleased (2024-12-27)
88

99
<section class="commits">
1010

1111
### Commits
1212

1313
<details>
1414

15+
- [`3377bfa`](https://github.com/stdlib-js/stdlib/commit/3377bfa5fe3d3fb575382d46c0239b607146ab00) - **refactor:** update `stats/base/dvarianceyc` native addon from C++ to C [(#4284)](https://github.com/stdlib-js/stdlib/pull/4284) _(by Vivek maurya)_
1516
- [`62364f6`](https://github.com/stdlib-js/stdlib/commit/62364f62ea823a3b52c2ad25660ecd80c71f8f36) - **style:** fix C comment alignment _(by Philipp Burckhardt)_
1617
- [`9e689ff`](https://github.com/stdlib-js/stdlib/commit/9e689ffcb7c6223afc521f1e574b42f10921cf5e) - **chore:** fix indentation in manifest.json files _(by Philipp Burckhardt)_
1718
- [`272ae7a`](https://github.com/stdlib-js/stdlib/commit/272ae7ac5c576c68cfab1b6e304c86407faa20cd) - **docs:** remove comment _(by Athan Reines)_
@@ -27,10 +28,11 @@
2728

2829
### Contributors
2930

30-
A total of 2 people contributed to this release. Thank you to the following contributors:
31+
A total of 3 people contributed to this release. Thank you to the following contributors:
3132

3233
- Athan Reines
3334
- Philipp Burckhardt
35+
- Vivek maurya
3436

3537
</section>
3638

‎include.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Source files:
3838
'src_files': [
39-
'<(src_dir)/addon.cpp',
39+
'<(src_dir)/addon.c',
4040
'<!@(node -e "var arr = require(\'@stdlib/utils-library-manifest\')(\'./manifest.json\',{},{\'basedir\':process.cwd(),\'paths\':\'posix\'}).src; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }")',
4141
],
4242

‎manifest.json

+39-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"options": {},
2+
"options": {
3+
"task": "build"
4+
},
35
"fields": [
46
{
57
"field": "src",
@@ -24,6 +26,42 @@
2426
],
2527
"confs": [
2628
{
29+
"task": "build",
30+
"src": [
31+
"./src/dvarianceyc.c"
32+
],
33+
"include": [
34+
"./include"
35+
],
36+
"libraries": [
37+
"-lm"
38+
],
39+
"libpath": [],
40+
"dependencies": [
41+
"@stdlib/napi-export",
42+
"@stdlib/napi-argv",
43+
"@stdlib/napi-argv-int64",
44+
"@stdlib/napi-argv-double",
45+
"@stdlib/napi-argv-strided-float64array",
46+
"@stdlib/napi-create-double"
47+
]
48+
},
49+
{
50+
"task": "benchmark",
51+
"src": [
52+
"./src/dvarianceyc.c"
53+
],
54+
"include": [
55+
"./include"
56+
],
57+
"libraries": [
58+
"-lm"
59+
],
60+
"libpath": [],
61+
"dependencies": []
62+
},
63+
{
64+
"task": "examples",
2765
"src": [
2866
"./src/dvarianceyc.c"
2967
],

‎package.json

+6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@
4242
},
4343
"dependencies": {
4444
"@stdlib/assert-is-error": "^0.2.2",
45+
"@stdlib/napi-argv": "^0.2.2",
46+
"@stdlib/napi-argv-double": "^0.2.1",
47+
"@stdlib/napi-argv-int64": "^0.2.2",
48+
"@stdlib/napi-argv-strided-float64array": "^0.2.2",
49+
"@stdlib/napi-create-double": "^0.0.2",
50+
"@stdlib/napi-export": "^0.2.2",
4551
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",
4652
"@stdlib/utils-library-manifest": "^0.2.2",
4753
"@stdlib/utils-try-require": "^0.2.2"

‎src/addon.c

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2024 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
#include "stdlib/stats/base/dvarianceyc.h"
20+
#include "stdlib/napi/export.h"
21+
#include "stdlib/napi/argv.h"
22+
#include "stdlib/napi/argv_int64.h"
23+
#include "stdlib/napi/argv_double.h"
24+
#include "stdlib/napi/argv_strided_float64array.h"
25+
#include "stdlib/napi/create_double.h"
26+
#include <node_api.h>
27+
28+
/**
29+
* Receives JavaScript callback invocation data.
30+
*
31+
* @param env environment under which the function is invoked
32+
* @param info callback data
33+
* @return Node-API value
34+
*/
35+
static napi_value addon( napi_env env, napi_callback_info info ) {
36+
STDLIB_NAPI_ARGV( env, info, argv, argc, 4 );
37+
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
38+
STDLIB_NAPI_ARGV_INT64( env, stride, argv, 3 );
39+
STDLIB_NAPI_ARGV_DOUBLE( env, correction, argv, 1 );
40+
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, stride, argv, 2 );
41+
STDLIB_NAPI_CREATE_DOUBLE( env, stdlib_strided_dvarianceyc( N, correction, X, stride ), v );
42+
return v;
43+
}
44+
45+
STDLIB_NAPI_MODULE_EXPORT_FCN( addon )

‎src/addon.cpp

-130
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.