Skip to content
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

return value type for complex abs; fixes #1836 #1837

Merged
merged 3 commits into from
Apr 14, 2020

Conversation

bob-carpenter
Copy link
Contributor

Summary

Corrects return type for abs(const std::complex<T>& x) to T.

Tests

Added new test for return type. Other generic tests still work.

Side Effects

No.

Release notes

Checklist

  • Math issue abs(complex) should return value type, not complex type #1836

  • Copyright holder: Simons Foundation

    The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
    - Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
    - Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

  • the basic tests are passing

    • unit tests pass (to run, use: ./runTests.py test/unit)
    • header checks pass, (make test-headers)
    • dependencies checks pass, (make test-math-dependencies)
    • docs build, (make doxygen)
    • code passes the built in C++ standards checks (make cpplint)
  • the code is written in idiomatic C++ and changes are documented in the doxygen

  • the new changes are tested

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 4.86 4.93 0.99 -1.34% slower
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.97 -3.1% slower
eight_schools/eight_schools.stan 0.09 0.09 0.99 -0.95% slower
gp_regr/gp_regr.stan 0.22 0.22 1.0 0.11% faster
irt_2pl/irt_2pl.stan 6.44 6.49 0.99 -0.72% slower
performance.compilation 88.32 87.13 1.01 1.35% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 7.55 7.59 0.99 -0.51% slower
pkpd/one_comp_mm_elim_abs.stan 21.12 20.86 1.01 1.22% faster
sir/sir.stan 93.85 90.79 1.03 3.26% faster
gp_regr/gen_gp_data.stan 0.05 0.05 1.02 1.56% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 2.96 2.95 1.0 0.14% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.3 0.3 1.0 0.05% faster
arK/arK.stan 1.9 1.74 1.09 8.46% faster
arma/arma.stan 0.66 0.67 0.98 -1.98% slower
garch/garch.stan 0.51 0.51 1.0 -0.29% slower
Mean result: 1.00557078014

Jenkins Console Log
Blue Ocean
Commit hash: 41106d8


Machine information ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010

CPU:
Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz

G++:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

Clang:
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

@bob-carpenter
Copy link
Contributor Author

This is a bug fix that'd be nice to get in for the release.

@bob-carpenter
Copy link
Contributor Author

Are we still merging bug fixes for the release? If so, can this one get merged?

@rok-cesnovar
Copy link
Member

Yes of course. Merge away.

@rok-cesnovar rok-cesnovar merged commit ee3a660 into develop Apr 14, 2020
@rok-cesnovar rok-cesnovar deleted the bugfix/1836-complex-abs-return branch April 14, 2020 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants