Skip to content

Commit 18c9ba1

Browse files
committed
Auto-generated commit
1 parent ca95356 commit 18c9ba1

File tree

5 files changed

+89
-132
lines changed

5 files changed

+89
-132
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -2912,6 +2912,7 @@ A total of 17 people contributed to this release. Thank you to the following con
29122912

29132913
<details>
29142914

2915+
- [`191c47d`](https://github.com/stdlib-js/stdlib/commit/191c47dbfe5a37c6aaab600d9834d4257dfa061f) - **refactor:** update `stats/base/sstdevwd` native addon from C++ to C [(#4207)](https://github.com/stdlib-js/stdlib/pull/4207) _(by Vinit Pandit, Athan Reines)_
29152916
- [`1d30df5`](https://github.com/stdlib-js/stdlib/commit/1d30df5eebc4f3624bf1eb0ea6ce4b3bb18bab87) - **refactor:** update `stats/base/dnanstdev` native addon from C++ to C [(#4192)](https://github.com/stdlib-js/stdlib/pull/4192) _(by Vivek maurya)_
29162917
- [`a40c4f4`](https://github.com/stdlib-js/stdlib/commit/a40c4f4f8948d06d3ac17c2f92b427a5a64bd756) - **refactor:** update `stats/base/dnanvariance` native addon from C++ to C [(#4195)](https://github.com/stdlib-js/stdlib/pull/4195) _(by Vivek maurya)_
29172918
- [`2bde98a`](https://github.com/stdlib-js/stdlib/commit/2bde98a2369cf34cd1bd167f27c7d6ca1bd1aed5) - **refactor:** update `stats/base/dnanvariancetk` native addon from C++ to C [(#4204)](https://github.com/stdlib-js/stdlib/pull/4204) _(by Neeraj Pathak)_

base/sstdevwd/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

base/sstdevwd/manifest.json

+42-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,45 @@
2426
],
2527
"confs": [
2628
{
29+
"task": "build",
30+
"src": [
31+
"./src/sstdevwd.c"
32+
],
33+
"include": [
34+
"./include"
35+
],
36+
"libraries": [
37+
"-lm"
38+
],
39+
"libpath": [],
40+
"dependencies": [
41+
"@stdlib/stats/base/svariancewd",
42+
"@stdlib/napi/export",
43+
"@stdlib/napi/argv",
44+
"@stdlib/napi/argv-int64",
45+
"@stdlib/napi/argv-strided-float32array",
46+
"@stdlib/napi/create-double",
47+
"@stdlib/napi/argv-float"
48+
]
49+
},
50+
{
51+
"task": "benchmark",
52+
"src": [
53+
"./src/sstdevwd.c"
54+
],
55+
"include": [
56+
"./include"
57+
],
58+
"libraries": [
59+
"-lm"
60+
],
61+
"libpath": [],
62+
"dependencies": [
63+
"@stdlib/stats/base/svariancewd"
64+
]
65+
},
66+
{
67+
"task": "examples",
2768
"src": [
2869
"./src/sstdevwd.c"
2970
],

base/sstdevwd/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/sstdevwd.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_strided_float32array.h"
24+
#include "stdlib/napi/create_double.h"
25+
#include "stdlib/napi/argv_float.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_FLOAT( env, correction, argv, 1 );
39+
STDLIB_NAPI_ARGV_INT64( env, stride, argv, 3 );
40+
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, stride, argv, 2)
41+
STDLIB_NAPI_CREATE_DOUBLE( env, (double)stdlib_strided_sstdevwd( N, correction, X, stride ), v );
42+
return v;
43+
}
44+
45+
STDLIB_NAPI_MODULE_EXPORT_FCN( addon )

base/sstdevwd/src/addon.cpp

-130
This file was deleted.

0 commit comments

Comments
 (0)