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

Have conditional_var_value_t return correct matrix type if scalar is var #2491

Merged
merged 7 commits into from
May 21, 2021

Conversation

SteveBronder
Copy link
Collaborator

Summary

This just makes conditional_var_value_t<var, Eigen::Matrix<var, -1, -1>> returns back a var_value<Eigen::Matrix<double, -1, -1>>

Tests

Test added for checking above behavior

./runTests.py ./test/unit/math/rev/meta/conditional_var_value_test.cpp

Side Effects

Nope

Release notes

Fixes case for conditional_var_value_t

Checklist

  • Math issue How to add static matrix? #1805

  • Copyright holder: (fill in copyright holder information)

    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 3.12 3.09 1.01 0.97% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.99 -0.83% slower
eight_schools/eight_schools.stan 0.12 0.12 0.97 -2.77% slower
gp_regr/gp_regr.stan 0.16 0.16 1.01 1.29% faster
irt_2pl/irt_2pl.stan 6.03 6.07 0.99 -0.66% slower
performance.compilation 88.59 87.56 1.01 1.17% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.74 8.69 1.01 0.58% faster
pkpd/one_comp_mm_elim_abs.stan 30.29 29.28 1.03 3.31% faster
sir/sir.stan 148.84 140.35 1.06 5.7% faster
gp_regr/gen_gp_data.stan 0.03 0.03 1.01 1.27% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.02 3.01 1.0 0.28% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.41 0.38 1.06 5.51% faster
arK/arK.stan 1.88 1.88 1.0 0.14% faster
arma/arma.stan 0.65 0.65 1.0 -0.48% slower
garch/garch.stan 0.68 0.7 0.98 -2.14% slower
Mean result: 1.0095402771

Jenkins Console Log
Blue Ocean
Commit hash: c8a67fc


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

@SteveBronder SteveBronder requested a review from t4c1 May 20, 2021 03:25
Copy link
Contributor

@t4c1 t4c1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the doxygen according to the change.

@SteveBronder SteveBronder requested a review from t4c1 May 20, 2021 16:22
@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 3.15 3.12 1.01 1.01% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 1.0 0.36% faster
eight_schools/eight_schools.stan 0.11 0.12 0.97 -3.3% slower
gp_regr/gp_regr.stan 0.16 0.16 1.01 0.96% faster
irt_2pl/irt_2pl.stan 6.0 6.02 1.0 -0.34% slower
performance.compilation 89.72 87.45 1.03 2.53% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.77 8.74 1.0 0.34% faster
pkpd/one_comp_mm_elim_abs.stan 30.23 29.08 1.04 3.81% faster
sir/sir.stan 138.22 144.61 0.96 -4.62% slower
gp_regr/gen_gp_data.stan 0.03 0.04 0.98 -1.61% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.04 3.08 0.99 -1.38% slower
pkpd/sim_one_comp_mm_elim_abs.stan 0.41 0.41 0.99 -0.7% slower
arK/arK.stan 1.88 1.86 1.01 0.72% faster
arma/arma.stan 0.64 0.64 0.99 -0.83% slower
garch/garch.stan 0.69 0.67 1.03 3.14% faster
Mean result: 1.00053387

Jenkins Console Log
Blue Ocean
Commit hash: 8fbe74a


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

Co-authored-by: Tadej Ciglarič <tadej.c@gmail.com>
@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 3.09 3.12 0.99 -1.17% slower
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.98 -1.59% slower
eight_schools/eight_schools.stan 0.11 0.12 0.98 -2.33% slower
gp_regr/gp_regr.stan 0.17 0.17 0.99 -0.82% slower
irt_2pl/irt_2pl.stan 6.05 5.99 1.01 1.01% faster
performance.compilation 88.42 87.12 1.01 1.47% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.73 8.72 1.0 0.12% faster
pkpd/one_comp_mm_elim_abs.stan 29.51 30.2 0.98 -2.32% slower
sir/sir.stan 137.39 150.86 0.91 -9.81% slower
gp_regr/gen_gp_data.stan 0.04 0.04 0.98 -2.49% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.11 3.01 1.03 3.0% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.39 0.4 0.97 -3.23% slower
arK/arK.stan 1.85 1.85 1.0 -0.07% slower
arma/arma.stan 0.64 0.64 1.01 1.06% faster
garch/garch.stan 0.68 0.67 1.01 0.62% faster
Mean result: 0.989847083507

Jenkins Console Log
Blue Ocean
Commit hash: 0034da2


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

@SteveBronder
Copy link
Collaborator Author

@rok-cesnovar is it fine to merge this? It's a bug fix

@rok-cesnovar
Copy link
Member

Yeah, bugfixes are good.

@rok-cesnovar rok-cesnovar merged commit fdbfd0f into develop May 21, 2021
@rok-cesnovar rok-cesnovar deleted the fix/conditional_var_value branch May 21, 2021 14:28
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.

5 participants