-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add blas/ext/base/drsskbn
#9013
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
base: develop
Are you sure you want to change the base?
feat: add blas/ext/base/drsskbn
#9013
Conversation
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: passed
- task: lint_package_json
status: passed
- task: lint_repl_help
status: passed
- task: lint_javascript_src
status: passed
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: passed
- task: lint_javascript_tests
status: passed
- task: lint_javascript_benchmarks
status: passed
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: passed
- task: lint_c_examples
status: passed
- task: lint_c_benchmarks
status: passed
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: passed
- task: lint_license_headers
status: passed
---
Coverage Report
The above coverage report was generated for the changes in this PR. |
lib/node_modules/@stdlib/blas/ext/base/drsskbn/benchmark/c/benchmark.length.c
Outdated
Show resolved
Hide resolved
Signed-off-by: Nakul Krishnakumar <[email protected]>
…hmark name
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: passed
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
| <!-- <equation class="equation" label="eq:residual_sum_of_squares" align="center" raw="d = \sum_{i=0}^{N-1} (y_i - x_i)^2" alt="Equation for residual sum of squares."> --> | ||
|
|
||
| ```math | ||
| \mathop{\mathrm{RSS}} = \sum_{i=0}^{n-1} (y_i - x_i)^2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| \mathop{\mathrm{RSS}} = \sum_{i=0}^{n-1} (y_i - x_i)^2 | |
| \mathop{\mathrm{RSS}} = \sum_{i=0}^{N-1} (y_i - x_i)^2 |
| * var y = new Float64Array( [ 2.0, 1.0, 2.0, 1.0, -2.0, 2.0, 3.0, 4.0 ] ); | ||
| * | ||
| * var z = drsskbn( x.length, x, 1, y, 1 ); | ||
| * // returns 72 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment regarding decimals.
| elapsed = tic() - t; | ||
| if ( v != v ) { | ||
| printf( "should not return NaN\n" ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to free allocated memory.
| elapsed = tic() - t; | ||
| if ( v != v ) { | ||
| printf( "should not return NaN\n" ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to free allocated memory.
kgryte
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am guessing that some of the same comments made in #8722 also apply here.
lib/node_modules/@stdlib/blas/ext/base/drsskbn/test/test.drsskbn.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/blas/ext/base/drsskbn/test/test.drsskbn.native.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/blas/ext/base/drsskbn/test/test.ndarray.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/blas/ext/base/drsskbn/test/test.ndarray.native.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Nakul Krishnakumar <[email protected]>
lib/node_modules/@stdlib/blas/ext/base/drsskbn/test/test.drsskbn.native.js
Show resolved
Hide resolved
lib/node_modules/@stdlib/blas/ext/base/drsskbn/test/test.ndarray.native.js
Show resolved
Hide resolved
Signed-off-by: Nakul Krishnakumar <[email protected]>
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: passed
- task: lint_package_json
status: na
- task: lint_repl_help
status: passed
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: passed
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: passed
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: passed
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: passed
- task: lint_license_headers
status: passed
---
lib/node_modules/@stdlib/blas/ext/base/drsskbn/benchmark/benchmark.native.js
Show resolved
Hide resolved
lib/node_modules/@stdlib/blas/ext/base/drsskbn/benchmark/benchmark.ndarray.js
Show resolved
Hide resolved
lib/node_modules/@stdlib/blas/ext/base/drsskbn/benchmark/benchmark.ndarray.native.js
Show resolved
Hide resolved
Signed-off-by: Nakul Krishnakumar <[email protected]>
|
/stdlib merge |
|
@nakul-krishnakumar Lint failures. |
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: passed
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
|
@kgryte This PR is ready for review. |
| // MODULES // | ||
|
|
||
| var stride2offset = require( '@stdlib/strided/base/stride2offset' ); | ||
| var ndarray = require( './../lib/ndarray.js' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path ./../lib/ndarray.js is incorrect since this file is already in the lib/ directory.
| var ndarray = require( './../lib/ndarray.js' ); | |
| var ndarray = require( './ndarray.js' ); |
| // MAIN // | ||
|
|
||
| /** | ||
| * Computes the residual sum of squares of two double-precision floating-point strided arrays using using an improved Kahan–Babuška algorithm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a duplicate "using" here.
| * Computes the residual sum of squares of two double-precision floating-point strided arrays using using an improved Kahan–Babuška algorithm. | |
| * Computes the residual sum of squares of two double-precision floating-point strided arrays using an improved Kahan–Babuška algorithm. |
|
|
||
| #### drsskbn.ndarray( N, x, strideX, offsetX, y, strideY, offsetY ) | ||
|
|
||
| Computes the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays an improved Kahan–Babuška algorithm and alternative indexing semantics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing word "using" - should be "...strided arrays using an improved..."
| Computes the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays an improved Kahan–Babuška algorithm and alternative indexing semantics. | |
| Computes the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays using an improved Kahan–Babuška algorithm and alternative indexing semantics. |
|
|
||
| <!--lint enable maximum-heading-length--> | ||
|
|
||
| Computes the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays an improved Kahan–Babuška algorithm and alternative indexing semantics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue here - missing word "using".
| Computes the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays an improved Kahan–Babuška algorithm and alternative indexing semantics. | |
| Computes the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays using an improved Kahan–Babuška algorithm and alternative indexing semantics. |
| const double x[] = { 1.0, -2.0, 2.0 }; | ||
| const double y[] = { 1.0, 1.0, -4.0 }; | ||
|
|
||
| double v = stdlib_strided_drsskbn_ndarray( 3, x, 1, 0, 1, 0 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function call is missing the y array parameter. According to the function signature on line 256, it should have 7 arguments: N, X, strideX, offsetX, Y, strideY, offsetY.
| double v = stdlib_strided_drsskbn_ndarray( 3, x, 1, 0, 1, 0 ); | |
| double v = stdlib_strided_drsskbn_ndarray( 3, x, 1, 0, y, 1, 0 ); |
| * @param strideY stride length of `Y` | ||
| * @return output value | ||
| */ | ||
| double API_SUFFIX( stdlib_strided_drsskbn )( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const double *Y, const CBLAS_INT strideY ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same API_SUFFIX spacing issue throughout this file - should be API_SUFFIX(stdlib_strided_drsskbn) without the space after the opening paren.
| double API_SUFFIX( stdlib_strided_drsskbn )( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const double *Y, const CBLAS_INT strideY ) { | |
| double API_SUFFIX(stdlib_strided_drsskbn)( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const double *Y, const CBLAS_INT strideY ) { |
| double API_SUFFIX( stdlib_strided_drsskbn )( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const double *Y, const CBLAS_INT strideY ) { | ||
| const CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX ); | ||
| const CBLAS_INT oy = stdlib_strided_stride2offset( N, strideY ); | ||
| return API_SUFFIX( stdlib_strided_drsskbn_ndarray )( N, X, strideX, ox, Y, strideY, oy ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return API_SUFFIX( stdlib_strided_drsskbn_ndarray )( N, X, strideX, ox, Y, strideY, oy ); | |
| return API_SUFFIX(stdlib_strided_drsskbn_ndarray)( N, X, strideX, ox, Y, strideY, oy ); |
| * @param offsetY starting index for `Y` | ||
| * @return output value | ||
| */ | ||
| double API_SUFFIX( stdlib_strided_drsskbn_ndarray )( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| double API_SUFFIX( stdlib_strided_drsskbn_ndarray )( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) { | |
| double API_SUFFIX(stdlib_strided_drsskbn_ndarray)( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) { |
| STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 4 ); | ||
| STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 ); | ||
| STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, Y, N, strideY, argv, 3 ); | ||
| STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX( stdlib_strided_drsskbn )( N, X, strideX, Y, strideY ), v ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same API_SUFFIX spacing issue.
| STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX( stdlib_strided_drsskbn )( N, X, strideX, Y, strideY ), v ); | |
| STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(stdlib_strided_drsskbn)( N, X, strideX, Y, strideY ), v ); |
| STDLIB_NAPI_ARGV_INT64( env, offsetY, argv, 6 ); | ||
| STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 ); | ||
| STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, Y, N, strideY, argv, 4 ); | ||
| STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX( stdlib_strided_drsskbn_ndarray )( N, X, strideX, offsetX, Y, strideY, offsetY ), v ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX( stdlib_strided_drsskbn_ndarray )( N, X, strideX, offsetX, Y, strideY, offsetY ), v ); | |
| STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(stdlib_strided_drsskbn_ndarray)( N, X, strideX, offsetX, Y, strideY, offsetY ), v ); |
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
Resolves None.
Description
This pull request:
blas/ext/base/drsskbn.Related Issues
This pull request has the following related issues:
Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
None.
@stdlib-js/reviewers