Skip to content

update value_of_rec to return a reference for varmat types#2631

Merged
rok-cesnovar merged 2 commits into
developfrom
fix/value_of_rec-varmat
Dec 22, 2021
Merged

update value_of_rec to return a reference for varmat types#2631
rok-cesnovar merged 2 commits into
developfrom
fix/value_of_rec-varmat

Conversation

@SteveBronder

Copy link
Copy Markdown
Collaborator

Summary

Just a small bugfix for var matrix types to return back a reference when calling value_of_rec() on them. Fixes the error upstream in stanc3 stan-dev/stanc3#955

Tests

No new tests

Side Effects

value_of_rec(var_value<Eigen::MatrixXd> x) now returns a reference to the value instead of a copy

Release notes

Checklist

  • Math issue #(issue number)

  • Copyright holder: Steve Bronder

    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
Copy Markdown
Contributor

Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 3.57 3.49 1.02 2.15% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.98 -1.85% slower
eight_schools/eight_schools.stan 0.08 0.09 0.91 -10.29% slower
gp_regr/gp_regr.stan 0.14 0.14 1.02 2.23% faster
irt_2pl/irt_2pl.stan 5.7 5.72 1.0 -0.42% slower
performance.compilation 93.51 90.84 1.03 2.85% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.13 8.12 1.0 0.19% faster
pkpd/one_comp_mm_elim_abs.stan 31.46 32.34 0.97 -2.78% slower
sir/sir.stan 121.18 121.26 1.0 -0.07% slower
gp_regr/gen_gp_data.stan 0.04 0.03 1.04 3.64% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.18 3.02 1.06 5.22% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.43 0.38 1.12 10.93% faster
arK/arK.stan 2.05 2.06 0.99 -0.51% slower
arma/arma.stan 0.23 0.24 0.97 -3.6% slower
garch/garch.stan 0.57 0.59 0.98 -2.22% slower
Mean result: 1.00577733649

Jenkins Console Log
Blue Ocean
Commit hash: 620158b


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

@rok-cesnovar
rok-cesnovar merged commit 3595599 into develop Dec 22, 2021
@rok-cesnovar
rok-cesnovar deleted the fix/value_of_rec-varmat branch December 22, 2021 07:39
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.

3 participants