Skip to content

Commit 7844009

Browse files
feat: rfc-dnanvariancewd
1 parent 8785e54 commit 7844009

File tree

4 files changed

+84
-132
lines changed

4 files changed

+84
-132
lines changed

lib/node_modules/@stdlib/stats/base/dnanvariancewd/include.gypi

Lines changed: 1 addition & 1 deletion
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

lib/node_modules/@stdlib/stats/base/dnanvariancewd/manifest.json

Lines changed: 38 additions & 1 deletion
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,41 @@
2426
],
2527
"confs": [
2628
{
29+
"task": "build",
30+
"src": [
31+
"./src/dnanvariancewd.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-strided-float64array",
45+
"@stdlib/napi/create-double"
46+
]
47+
},
48+
{
49+
"task": "benchmark",
50+
"src": [
51+
"./src/dnanvariancewd.c"
52+
],
53+
"include": [
54+
"./include"
55+
],
56+
"libraries": [
57+
"-lm"
58+
],
59+
"libpath": [],
60+
"dependencies": []
61+
},
62+
{
63+
"task": "examples",
2764
"src": [
2865
"./src/dnanvariancewd.c"
2966
],
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
file line number Original file line Diff line number Diff line change
2+
@@ -0,0 +1,43 @@
3+
/**
4+
* @license Apache-2.0
5+
*
6+
* Copyright (c) 2024 The Stdlib Authors.
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License");
9+
* you may not use this file except in compliance with the License.
10+
* You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*/
20+
21+
#include "stdlib/stats/base/dnanvariancewd.h"
22+
#include "stdlib/napi/argv.h"
23+
#include "stdlib/napi/argv_int64.h"
24+
#include "stdlib/napi/argv_strided_float64array.h"
25+
#include "stdlib/napi/create_double.h"
26+
#include "stdlib/napi/export.h"
27+
#include <node_api.h>
28+
29+
/**
30+
* Receives JavaScript callback invocation data.
31+
*
32+
* @param env environment under which the function is invoked
33+
* @param info callback data
34+
* @return Node-API value
35+
*/
36+
static napi_value addon( napi_env env, napi_callback_info info ) {
37+
STDLIB_NAPI_ARGV( env, info, argv, argc, 3 );
38+
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
39+
STDLIB_NAPI_ARGV_INT64( env, stride, argv, 2 );
40+
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, stride, argv, 1 );
41+
STDLIB_NAPI_CREATE_DOUBLE( env, stdlib_strided_dnanvariancewd( N, X, stride ), v );
42+
return v;
43+
}
44+
45+
STDLIB_NAPI_MODULE_EXPORT_FCN( addon )

lib/node_modules/@stdlib/stats/base/dnanvariancewd/src/addon.cpp

Lines changed: 0 additions & 130 deletions
This file was deleted.

0 commit comments

Comments
 (0)