Repository navigation
Conversation
Coverage Report
The above coverage report was generated for the changes in this PR. |
0d7a60e to
2cc3030
Compare
…rk/benchmark.native.js Signed-off-by: Ujjwal Verma <ujjwalverma010305@gmail.com>
| - `[in] struct ndarray*` a one-dimensional input ndarray. | ||
| - `[in] struct ndarray*` a zero-dimensional ndarray specifying the degrees of freedom adjustment. Providing a non-zero degrees of freedom adjustment has the effect of adjusting the divisor during the calculation of the [standard deviation][standard-deviation] according to `N-c` where `N` is the number of elements in the input ndarray and `c` corresponds to the provided degrees of freedom adjustment. When computing the [standard deviation][standard-deviation] of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample [standard deviation][standard-deviation], setting this parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction). |
There was a problem hiding this comment.
| - `[in] struct ndarray*` a one-dimensional input ndarray. | |
| - `[in] struct ndarray*` a zero-dimensional ndarray specifying the degrees of freedom adjustment. Providing a non-zero degrees of freedom adjustment has the effect of adjusting the divisor during the calculation of the [standard deviation][standard-deviation] according to `N-c` where `N` is the number of elements in the input ndarray and `c` corresponds to the provided degrees of freedom adjustment. When computing the [standard deviation][standard-deviation] of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample [standard deviation][standard-deviation], setting this parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction). | |
| - `[in] struct ndarray*` a one-dimensional input ndarray. | |
| - `[out] struct ndarray*` a one-dimensional output ndarray to store the [mean][arithmetic-mean] and [standard deviation][standard-deviation]. | |
| - `[in] struct ndarray*` a zero-dimensional ndarray specifying the degrees of freedom adjustment. Providing a non-zero degrees of freedom adjustment has the effect of adjusting the divisor during the calculation of the [standard deviation][standard-deviation] according to `N-c` where `N` is the number of elements in the input ndarray and `c` corresponds to the provided degrees of freedom adjustment. When computing the [standard deviation][standard-deviation] of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample [standard deviation][standard-deviation], setting this parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction). |
The output ndarray is missing from the list (also drops the trailing space).
| "@stdlib/napi/argv", | ||
| "@stdlib/napi/create-double" |
There was a problem hiding this comment.
| "@stdlib/napi/argv", | |
| "@stdlib/napi/create-double" | |
| "@stdlib/napi/argv" |
Same as #15170 (comment).
| napi_value v; | ||
| status = napi_get_undefined( env, &v ); | ||
| assert( status == napi_ok ); | ||
|
|
||
| return v; |
There was a problem hiding this comment.
| napi_value v; | |
| status = napi_get_undefined( env, &v ); | |
| assert( status == napi_ok ); | |
| return v; | |
| return NULL; |
Match blas/ext/base/ndarray/daxpb/src/addon.c.
|
|
||
| /** | ||
| * Computes the mean and standard deviation of a one-dimensional double-precision floating-point ndarray. | ||
| * Computes the arithmetic mean and standard deviation of a one-dimensional double-precision floating-point ndarray. |
There was a problem hiding this comment.
| * Computes the arithmetic mean and standard deviation of a one-dimensional double-precision floating-point ndarray. | |
| * Computes the mean and standard deviation of a one-dimensional double-precision floating-point ndarray. |
Is this change needed here? It's outside the C implementation, and docs/repl.txt and docs/types/index.d.ts still say "the mean". If reverted, lib/native.js:31, src/main.c:25, the header and README.md:204 should mirror it.
| #include "stdlib/stats/base/ndarray/dmeanstdev.h" | ||
| #include "stdlib/ndarray/ctor.h" | ||
| #include "stdlib/ndarray/dtypes.h" | ||
| #include "stdlib/ndarray/index_modes.h" | ||
| #include "stdlib/ndarray/orders.h" | ||
| #include "stdlib/ndarray/base/bytes_per_element.h" | ||
| #include <stdint.h> | ||
| #include <stdlib.h> | ||
| #include <stdio.h> |
There was a problem hiding this comment.
| #include "stdlib/stats/base/ndarray/dmeanstdev.h" | |
| #include "stdlib/ndarray/ctor.h" | |
| #include "stdlib/ndarray/dtypes.h" | |
| #include "stdlib/ndarray/index_modes.h" | |
| #include "stdlib/ndarray/orders.h" | |
| #include "stdlib/ndarray/base/bytes_per_element.h" | |
| #include <stdint.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include "stdlib/ndarray/base/bytes_per_element.h" | |
| #include "stdlib/ndarray/ctor.h" | |
| #include "stdlib/ndarray/dtypes.h" | |
| #include "stdlib/ndarray/index_modes.h" | |
| #include "stdlib/ndarray/orders.h" | |
| #include "stdlib/stats/base/ndarray/dmeanstdev.h" | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> |
Match stats/base/ndarray/dstdev/examples/c/example.c. Same in benchmark/c/benchmark.length.c:19-27 and README.md:274-282.
| } | ||
|
|
||
| // Create a data buffer for an ndarray specifying the degrees of freedom adjustment: | ||
| double cdata[] = { 1.0 }; |
There was a problem hiding this comment.
| double cdata[] = { 1.0 }; | |
| const double cdata[] = { 1.0 }; |
Same in README.md:230 and README.md:335 (see stats/base/ndarray/dstdev).
Resolves a part of #14034
Description
This pull request:
dmeanstdev).test.js,test.main.js,test.native.js) and benchmarks to cover and utilize the new native C addon.Related Issues
This pull request has the following related issues:
@stdlib/stats/base/ndarraypackages (tracking issue) #14034Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
I consulted an AI assistant to help structure and generate the test files (
test.main.js,test.native.js), benchmark configuration, and C addon boilerplate required to integrate the native C addon. The core math logic and C API implementations were authored manually by myself.@stdlib-js/reviewers