-
-
Notifications
You must be signed in to change notification settings - Fork 813
feat: add math/base/special/lucasf
#6223
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
Conversation
Coverage Report
The above coverage report was generated for the changes in this PR. |
Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
@anandkaranubc could you please review this PR? |
Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
math/base/special/lucasf
@anandkaranubc Would you mind taking a look at this PR? |
/stdlib merge |
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.
Hi @hrshya, thanks for your work on this! I’ve added some comments on the PR. A few areas need improvement.
lib/node_modules/@stdlib/math/base/special/lucasf/examples/c/example.c
Outdated
Show resolved
Hide resolved
|
||
#### lucasf( n ) | ||
|
||
Computes the nth [Lucas number][lucas-number] in single-precision floating-point format. |
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
<!-- eslint no-undef: "error" --> | ||
|
||
```javascript | ||
var lucasf = require( '@stdlib/math/base/special/lucasf' ); |
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 should also be refactored to use logEachMap
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.
Shouldn't we use array/base/linspace
here to get the lucasf values in an increasing order like lucasf( 0 )
till n as compared to using a discreteUniform
here which would give us random lucasf values.
cc: @anandkaranubc
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.
@hrshya Either is fine, I believe. The goal is to showcase a working code example. I changed it to use discreteUniform
to align with the other refactoring being done in math/base/special
. Another reason is that you were using linspace
with four arguments, including opts
, which linspace
doesn't require.
function linspace( x1, x2, len ) { |
If you think this change was accidentally propagated to other packages, a PR is probably needed for that.
|
||
#### stdlib_base_lucasf( n ) | ||
|
||
Computes the nth [Lucas number][lucas-number] in single-precision floating-point format. |
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
Co-authored-by: Karan Anand <119553199+anandkaranubc@users.noreply.github.com> Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
Co-authored-by: Karan Anand <119553199+anandkaranubc@users.noreply.github.com> Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
…xample.c Co-authored-by: Karan Anand <119553199+anandkaranubc@users.noreply.github.com> Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
Co-authored-by: Karan Anand <119553199+anandkaranubc@users.noreply.github.com> Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
Co-authored-by: Karan Anand <119553199+anandkaranubc@users.noreply.github.com> Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
/stdlib lint-autofix |
@anandkaranubc, the slash command failed to complete. Please check the workflow logs for details. |
|
||
// TODO: replace with `powf` when available | ||
return roundf( pow( PHI, 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.
@hrshya, this needs to be fixed. There is a missing function implementation. This is the primary reason why the CI/CD workflows are failing. It's a good practice to run the benchmarks locally first to confirm if nothing is broken.
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 did ran the benchmarks when I first created the PR but not this time because there were any major changes in those files.
As a side note, always make sure your feature branch is in sync with the |
Actually it was in sync but the thing was I didn't have this branch locally so I pulled it from origin and i thought as my develop branch is in sync so this branch would also be but i was wrong and i should have checked it before commiting |
Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
@anandkaranubc All the issues have been resolved. Can you give it a quick review. |
/stdlib merge |
@anandkaranubc, the slash command failed to complete. Please check the workflow logs for details. |
--- 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: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: passed - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - 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: 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: na - 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: na - task: lint_typescript_tests status: na - 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: 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: passed - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - 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: 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: 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: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - 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: 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: 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: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - 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: 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: passed - task: lint_javascript_benchmarks status: na - 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: na - task: lint_typescript_tests status: na - 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: 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: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
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.
Good to go! Thanks @hrshya.
Resolves none .
Description
This pull request:
math/base/special/lucasf
.Related Issues
This pull request:
Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers