feat: add stats/strided/distances/dminkowski#10567
feat: add stats/strided/distances/dminkowski#10567kgryte merged 13 commits intostdlib-js:developfrom
stats/strided/distances/dminkowski#10567Conversation
---
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: missing_dependencies
- task: lint_c_examples
status: missing_dependencies
- task: lint_c_benchmarks
status: missing_dependencies
- 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
---
---
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: passed
- 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: missing_dependencies
- task: lint_c_examples
status: missing_dependencies
- 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: passed
- task: lint_license_headers
status: passed
---
|
Please note that the |
Coverage Report
The above coverage report was generated for the changes in this PR. |
|
@nakul-krishnakumar Mind resolving the C lint errors? |
How do you want me to fix the error? Currently it raises error because of the int main( void ) {
double elapsed;
double *powers;
int count;
int iter;
int len;
int i;
int j;
int p;
// Use the current time to seed the random number generator:
srand( time( NULL ) );
print_version();
count = 0;
powers = (double[]) { 1.0, 2.0, 10.0, INFINITY };
for ( i = MIN; i <= MAX; i++ ) {
len = pow( 10, i );
iter = ITERATIONS / pow( 10, i-1 );
for ( p = 0; p < 4; p++ ) {
for ( j = 0; j < REPEATS; j++ ) {
count += 1;
printf( "# c::%s:len=%d:p=%.2f\n", NAME, len, powers[ p ] );
elapsed = benchmark1( iter, len, powers[ p ] );
print_results( iter, elapsed );
printf( "ok %d benchmark finished\n", count );
}
for ( j = 0; j < REPEATS; j++ ) {
count += 1;
printf( "# c::%s:ndarray:len=%d:p=%.2f\n", NAME, len, powers[ p ] );
elapsed = benchmark2( iter, len, powers[ p ] );
print_results( iter, elapsed );
printf( "ok %d benchmark finished\n", count );
}
}
}
print_summary( count, count );
}Can I instead do |
Signed-off-by: Athan <kgryte@gmail.com>
Co-authored-by: Nakul Krishnakumar <nakulkrishnakumar86@gmail.com> Signed-off-by: Athan <kgryte@gmail.com>
| s = abs( x[ ox ] - y[ oy ] ); | ||
| d = pow( s, p ); | ||
| ox += strideX; | ||
| oy += strideY; |
There was a problem hiding this comment.
What is the point of unrolling the first element? Could you not just initialize d = 0.0 and then have the loop go from i = 0 to i < N? Seems like this is currently just wasting additional characters without a strong motivation.
There was a problem hiding this comment.
What is the point of unrolling the first element? Could you not just initialize
d = 0.0and then have the loop go fromi = 0toi < N? Seems like this is currently just wasting additional characters without a strong motivation.
I was just trying to mimic the implementation of dchebyshev where it is useful as it takes the max of residuals, but here as you said it does look redundant. Thank you for pointing that out. We will have to do the same refactoring for stats/strided/distances/dcityblock too then.
Signed-off-by: Nakul Krishnakumar <nakulkrishnakumar86@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
kgryte
left a comment
There was a problem hiding this comment.
Other than the use of PINF, this PR is looking good.
Co-authored-by: Athan <kgryte@gmail.com> Signed-off-by: Nakul Krishnakumar <nakulkrishnakumar86@gmail.com>
PR-URL: stdlib-js#10567 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com>
Resolves None.
Description
This pull request:
stats/strided/distances/dminkowski.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