-
-
Notifications
You must be signed in to change notification settings - Fork 28
BUG: amos/amos.h: fix scope of l in seri
#92
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
Changes from 5 commits
e6c80f2
8ef7b48
71da72e
1beee0b
ce75f4b
ba780bd
a973ddd
8a3cb53
9f9fac1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,6 +62,36 @@ TEST_CASE("amos besi vectorized", "[amos][xsf_tests]") { | |
| } | ||
| } | ||
|
|
||
| TEST_CASE("amos besh vectorized", "[amos][xsf_tests]") { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test seems useful but should we not add a sentinel regression test as you did #158? It passes on main.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for checking! Seems like I have mixed up what this PR actually fixes with some other PR. I have now added a test similar to #153 here. |
||
| // tests the functionality of amos to return multiple consecutive orders for besh | ||
| // by comparing to the versions returning only a single order | ||
| using std::complex; | ||
|
|
||
| using test_case = std::tuple<complex<double>, double, int, int, int, double>; | ||
| auto [z, fnu, kode, m, n, rtol] = GENERATE( | ||
| test_case{complex{14.0, -3.0}, 1.0, 1, 1, 260, 4e-13} // gh-92 | ||
| ); | ||
|
|
||
| std::vector<complex<double>> cy(n); | ||
| int ierr = 0; | ||
| int nz; | ||
|
|
||
| nz = xsf::amos::besh(z, fnu, kode, m, n, cy.data(), &ierr); | ||
|
|
||
| REQUIRE(ierr == 0); | ||
|
|
||
| complex<double> ref; | ||
|
|
||
| for (int i = 0; i < n; ++i) { | ||
| nz = xsf::amos::besh(z, fnu + i, kode, m, 1, &ref, &ierr); | ||
| REQUIRE(ierr == 0); | ||
|
|
||
| const auto rel_error = xsf::extended_relative_error(cy[i], ref); | ||
| CAPTURE(i, cy[i], ref, rel_error); | ||
| REQUIRE(rel_error <= rtol); | ||
| } | ||
| } | ||
|
|
||
| TEST_CASE("amos asyi buffer overflow gh-158", "[amos][xsf_tests]") { | ||
| using std::complex; | ||
|
|
||
|
|
||
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.
Indeed, this seems to fix the translation error.