Skip to content

Simplifying existing autodiff to prepare for adding var_value<Matrix<T, R, C>> support to rev/fun #2019

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

Closed
wants to merge 491 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
491 commits
Select commit Hold shift + click to select a range
8ccc28b
fixed explicit constructors
t4c1 Aug 5, 2020
985c2b7
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 5, 2020
aa8a1e1
tmp
t4c1 Aug 5, 2020
39fc7e6
bugfix missing allocator operators
t4c1 Aug 5, 2020
b84b410
modified how copying of AD_stack_matrix works.
t4c1 Aug 5, 2020
61fe4b7
Merge branch 'vari_base_ops_partials' into rework_adj_jac_apply
t4c1 Aug 5, 2020
79d2311
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 5, 2020
e2b93c2
cleanup
t4c1 Aug 5, 2020
bf096b9
Add grad() method without an input vari and add template paramter to …
SteveBronder Aug 5, 2020
d2edb26
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 5, 2020
614ae97
fix docs in vari for matrix_cl
SteveBronder Aug 5, 2020
bf38a76
use grad() in grad(Vari*)
SteveBronder Aug 6, 2020
c6af0b0
Move grad() in front of grad(Vari*)
SteveBronder Aug 6, 2020
72d85a6
addressed review comments
t4c1 Aug 6, 2020
43ef8e0
Merge branch 'vari_base_ops_partials' of https://github.com/bstatcomp…
t4c1 Aug 6, 2020
3196d9f
Merge branch 'vari-base-eigen' into vari_base_ops_partials
t4c1 Aug 6, 2020
14998c2
Merge branch 'vari_base_ops_partials' into rework_adj_jac_apply
t4c1 Aug 6, 2020
cb04a08
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 6, 2020
84b6585
fixed doxygen
t4c1 Aug 6, 2020
85c22b0
Merge branch 'vari_base_ops_partials' of https://github.com/bstatcomp…
t4c1 Aug 6, 2020
7945f66
merge to develop and use const S& instead of S&& in var_value and var…
SteveBronder Aug 6, 2020
4e70ba6
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 6, 2020
8cec8bb
Use pf in var_value for the sparse matrix constructor
SteveBronder Aug 6, 2020
32045cc
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 6, 2020
f615268
Merge remote-tracking branch 'stan-dev/feature/vari-base-eigen' into …
SteveBronder Aug 7, 2020
07b96b8
addressed second batch of review comments
t4c1 Aug 7, 2020
e1d508e
Merge branch 'vari_base_ops_partials' into rework_adj_jac_apply
t4c1 Aug 7, 2020
8b13df9
remove dot_product vari* calls
t4c1 Aug 7, 2020
77aaab9
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 7, 2020
b8674dc
dot_product now uses adjac_apply
t4c1 Aug 7, 2020
c42690e
added missing file
t4c1 Aug 7, 2020
4ff878f
Merge branch 'vari_base_ops_partials' into rework_adj_jac_apply
t4c1 Aug 7, 2020
281c52e
moved new and delete into vari_base
t4c1 Aug 7, 2020
239df35
renamed, doced and added a test
t4c1 Aug 7, 2020
b3def37
rename to arena_*
t4c1 Aug 10, 2020
b14a477
third batch of comments
t4c1 Aug 10, 2020
cf2c2ca
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 10, 2020
b418578
Merge branch 'develop' into vari_base_ops_partials
t4c1 Aug 10, 2020
b37aba5
Merge branch 'vari_base_ops_partials' of https://github.com/bstatcomp…
t4c1 Aug 10, 2020
6d7c8ef
Merge branch 'vari_base_ops_partials' into rework_adj_jac_apply
t4c1 Aug 10, 2020
2545756
small fixes
t4c1 Aug 10, 2020
0f3517c
Converted remaining functions using adj_jac_apply to reverse_pass_cal…
bbbales2 Aug 11, 2020
b36cf6b
Removed some code
bbbales2 Aug 11, 2020
32b7c22
Replaced some coeffRef's wit coeffs
bbbales2 Aug 12, 2020
395858f
Converted divide, dot_self, determinant, and gp_exp_quad_cov to use n…
bbbales2 Aug 18, 2020
953edd2
Merge commit '6d9e1a487c38efe84ec2a11675900786a2f28e06' into HEAD
yashikno Aug 18, 2020
a1a73e7
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 18, 2020
eeac6c6
Changed forward_as to avoid needing new accumulate adjoints function.…
bbbales2 Aug 18, 2020
47d0472
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Aug 18, 2020
094ba39
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 18, 2020
66525b9
Added autodiff for cols_dot_product and rows_dot_product (Issue #2018)
bbbales2 Aug 19, 2020
00855b5
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Aug 19, 2020
afd36c4
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 19, 2020
91a6bb9
More functions converted to reverse_pass_callback (Issue #2018)
bbbales2 Aug 19, 2020
a482288
Merge commit '8a67bc7b92939d8c2947761107b3a9287b71ece5' into HEAD
yashikno Aug 19, 2020
de71a10
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 19, 2020
4ab3e0e
Added inverse specialization (Issue #1635)
bbbales2 Aug 20, 2020
45f468d
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 20, 2020
1837605
Couple updates to the gps (Issue stan-dev/math 2018)
bbbales2 Aug 21, 2020
c43907c
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Aug 21, 2020
75bbe3f
Merge commit '7ba6890d5e64859c21fd09d69a465bfb06dab9d3' into HEAD
yashikno Aug 21, 2020
9704fa7
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 21, 2020
1bfd173
Made new gp autodiff more like it was previously (Issue #2018)
bbbales2 Aug 21, 2020
da2b31c
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Aug 21, 2020
912d437
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 21, 2020
1e09d8b
More work on gp_exp_quad_cov (Issue #2018)
bbbales2 Aug 23, 2020
8d551b2
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 23, 2020
74b6abc
Update gp_periodic to match gp_exp_quad (Issue #2018)
bbbales2 Aug 23, 2020
363a16c
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Aug 23, 2020
97fedc3
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 23, 2020
fc4fc03
update headers for inverse so test-headers passes
SteveBronder Aug 26, 2020
bc568cd
Merge remote-tracking branch 'origin/develop' into feature/convert_to…
SteveBronder Aug 26, 2020
2f204fb
forgot * = nullptr for gp_periodic_cov
SteveBronder Aug 26, 2020
b5bd3cf
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 26, 2020
2a2fd2b
Merge remote-tracking branch 'origin' into feature/more_rework_adj_ja…
bbbales2 Aug 27, 2020
83c54f8
Merge remote-tracking branch 'origin/feature/more_rework_adj_jac_appl…
bbbales2 Aug 27, 2020
61aa116
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Aug 27, 2020
cec22ec
Updated more functions (Issue #2018)
bbbales2 Aug 30, 2020
64300f3
Merge commit '9e18bcff1bb0ae1d629e5e405d0f826672ce2e03' into HEAD
yashikno Aug 30, 2020
88b22dd
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Aug 30, 2020
f7aff18
Fixed indexing problem and added missing header (Issue #2018)
bbbales2 Aug 31, 2020
5add664
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Aug 31, 2020
147378c
Converted some more functions (Issue #2018)
bbbales2 Aug 31, 2020
238ec78
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Aug 31, 2020
62dfc61
Added some more functions (Issue #2018)
bbbales2 Sep 1, 2020
ea27e04
Merge commit '4144cdc2446da9029da5c3595d86a73f3dac0092' into HEAD
yashikno Sep 1, 2020
9d78471
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Sep 1, 2020
a946473
Added unit_vector_constrain and quad_form (Issue #2018)
bbbales2 Sep 2, 2020
cf209bc
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Sep 2, 2020
df025af
Added a couple more matrix functions (Issue #2018)
bbbales2 Sep 2, 2020
50caa52
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Sep 2, 2020
5edb6be
Converted Cholesky and re-enabled CPU tests for large factorizations …
bbbales2 Sep 2, 2020
d3c0525
More functions! (Issue #2018)
bbbales2 Sep 2, 2020
a8e343f
Merge remote-tracking branch 'origin' into feature/convert_to_tadj1
bbbales2 Sep 2, 2020
843ca08
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Sep 2, 2020
acd7694
Added ldlt functions (Issue #2018)
bbbales2 Sep 10, 2020
26e1740
Updated template logic in trace_gen_quad_form (Issue #2018)
bbbales2 Sep 10, 2020
9558a58
Added const to log_determinant_ldlt (Issue #2018)
bbbales2 Sep 10, 2020
4472dcc
Merge commit '430c73547a93a90dfd7666219ce7ff3ceea057a3' into HEAD
yashikno Sep 10, 2020
10566a0
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Sep 10, 2020
5392254
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Sep 10, 2020
b4258a5
Removed extra consts (Issue #2018)
bbbales2 Sep 10, 2020
160b680
Added missing const (Issue #2018)
bbbales2 Sep 11, 2020
c93407a
Removed extra const (Issue #2018)
bbbales2 Sep 11, 2020
7245c75
Merge remote-tracking branch 'origin/develop' into feature/convert_to…
bbbales2 Sep 14, 2020
f55c0ae
Updates to doxygen/test names (Issue #2018)
bbbales2 Sep 14, 2020
abbf6af
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Sep 14, 2020
142d20c
Fixed headers problems (Issue #2018)
bbbales2 Sep 14, 2020
10623c3
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Sep 14, 2020
1a255af
Removed selfadjointview in inv_wishart_lpdf (Issue #2018)
bbbales2 Sep 15, 2020
db8ed7a
Merge remote-tracking branch 'origin/develop' into feature/convert_to…
bbbales2 Sep 15, 2020
a88216a
Changed path for arena_matrix includes
bbbales2 Sep 16, 2020
0e5f08f
Updated error messages in cov_exp_quad tests (Issue #2018)
bbbales2 Sep 18, 2020
3d14938
Check inv_wishart inputs for symmetry (Issue #2018)
bbbales2 Sep 18, 2020
539fdfe
Check symmetry on input to inv_wishart_rng (Issue #2018)
bbbales2 Sep 18, 2020
82e7a4c
Merge commit 'ed6ab4bd5ea47b9f9f40ec9e5d42f5a5b456dd5c' into HEAD
yashikno Sep 18, 2020
62ba5fb
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Sep 18, 2020
0799b47
Fixed symmetric things in inv_wishart tests (Issue #2018)
bbbales2 Sep 18, 2020
b393aff
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Sep 18, 2020
d502b15
Updated inverse wishart tests to avoid non-symmetric matrices (Issue …
bbbales2 Sep 21, 2020
3b21f8f
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Sep 21, 2020
d62085b
Merge commit '37f1d0916f50185601ad18aa995ef6f42bf52966' into HEAD
yashikno Sep 21, 2020
a52c269
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Sep 21, 2020
cd6cc70
Updated matrix power test (Issue #2018)
bbbales2 Sep 22, 2020
2a914f6
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Sep 22, 2020
b4f66a5
Updated symmetry tests in inv_wishart (Issue #2018)
bbbales2 Sep 22, 2020
e9c291c
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Sep 22, 2020
5219a96
Updated cov exp quad error messages for tests (Issue #2018)
bbbales2 Sep 22, 2020
4dcd88f
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Sep 22, 2020
cf8ee81
Added back OpenCL cholesky decompose (Issue #2018)
bbbales2 Sep 23, 2020
6868c12
Merge commit 'c0686c673cafea0991501027b4cc80b097a420d7' into HEAD
yashikno Sep 23, 2020
6b3495c
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Sep 23, 2020
7e5c2b4
Added missing cholesky stuff (Issue #2018)
bbbales2 Sep 24, 2020
a9d6a98
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Sep 24, 2020
fbe1e7b
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Sep 24, 2020
d309342
Merge remote-tracking branch 'origin' into feature/convert_to_tadj1
bbbales2 Sep 24, 2020
0aaea95
Added missing variable to lambda capture (Issue #2018)
bbbales2 Sep 25, 2020
abf99ec
update gp_exp_quad_cov for the hotpath and fix headers in gp_periodic…
SteveBronder Sep 26, 2020
a5af19a
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Sep 26, 2020
4fef4ea
Updated functions to work with expressions (Issue #2018)
bbbales2 Sep 29, 2020
0390666
Merge branch 'develop' into feature/convert_to_tadj1
bbbales2 Sep 29, 2020
84383ec
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Sep 29, 2020
2469c8c
fix quad_form docs
SteveBronder Sep 29, 2020
0e96c78
Updated divide function (Issue #2018)
bbbales2 Sep 30, 2020
bb6f93b
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Sep 30, 2020
19344b5
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Sep 30, 2020
7bcb0a8
Made quad_form_sym return a scalar when the outer variable is a vecto…
bbbales2 Oct 1, 2020
9bf601a
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 1, 2020
f7fd26d
Merge commit '4394b2c04b86c5a9d3e4b2e3df4a714ff62fc081' into HEAD
yashikno Oct 1, 2020
d0dba78
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Oct 1, 2020
0582b70
Changed quad_form_sym code to reflect docs (issue #2018)
bbbales2 Oct 1, 2020
e439d6f
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 1, 2020
431811a
Merge branch 'develop' into feature/convert_to_tadj1
bbbales2 Oct 2, 2020
e2a27ce
Added missing test (Issue #2018)
bbbales2 Oct 3, 2020
29a75d5
Merge commit '0cacb8d708dde02b0ffa003d2e3a1fb30057a04d' into HEAD
yashikno Oct 3, 2020
88ce532
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 3, 2020
21894fb
Renamed tests (Issue #2018)
bbbales2 Oct 3, 2020
787e587
Fixed performance for variance (Issue #2018)
bbbales2 Oct 3, 2020
2bd2e4a
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 3, 2020
345ccb3
Updated multiply_lower_tri_self_transpose (Issue #2018)
bbbales2 Oct 3, 2020
619338f
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 3, 2020
36fb58d
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Oct 3, 2020
88de483
Cleaning up tcrossprod (Issue #2018)
bbbales2 Oct 3, 2020
80250fd
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 3, 2020
c4fcead
Updated squared distance (Issue #2018)
bbbales2 Oct 3, 2020
36404be
Merge commit '43058c1062fc4552bc061c8c81fba31c35d6a09f' into HEAD
yashikno Oct 3, 2020
6aacb43
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 3, 2020
be56313
Updated dot_self (Issue #2018)
bbbales2 Oct 3, 2020
893e4ce
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 3, 2020
4005e11
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 3, 2020
f5811a2
Switched to memory efficient dot_self (Issue #2018)
bbbales2 Oct 3, 2020
4bce507
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 3, 2020
d22de1c
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 4, 2020
67ee415
Updated columns_dot_product (Issue #2018)
bbbales2 Oct 4, 2020
079462c
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Oct 4, 2020
4f3705c
Updated trace_quad_form to three different versions (Issue #2018)
bbbales2 Oct 4, 2020
0997ffa
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 4, 2020
15c9a47
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 4, 2020
7d37479
Updated trace_quad_form (Issue #2018)
bbbales2 Oct 4, 2020
2033881
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 4, 2020
e8e91aa
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 4, 2020
2c5b4c9
Update log_softmax (Issue #2018)
bbbales2 Oct 4, 2020
1e5ac28
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 4, 2020
c04d834
Merge commit 'b3297de86605da8fa97b40311e24bc60f6c8081b' into HEAD
yashikno Oct 4, 2020
7b3c3f4
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 4, 2020
9bae3f8
Updated trace_gen_quad_form (Issue #2018)
bbbales2 Oct 4, 2020
e76f491
Updated unit_vector_constrain (Issue #2018)
bbbales2 Oct 4, 2020
496e738
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 4, 2020
96064ae
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 4, 2020
42d7ccb
Updated mdivide_left (Issue #2018)
bbbales2 Oct 4, 2020
6a657f1
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 4, 2020
2024789
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 4, 2020
1e25d97
Updated mdivide_left_tri (Issue #2018)
bbbales2 Oct 4, 2020
64bcbef
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 4, 2020
34a0f17
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 4, 2020
6cab858
Updated determinant (Issue #2018)
bbbales2 Oct 4, 2020
55327d8
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 4, 2020
4848ad8
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 4, 2020
8d294d6
Updated trace_gen_inv_quad_form_ldlt (Issue #2018)
bbbales2 Oct 4, 2020
4814962
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 4, 2020
afcce60
Updated mdivide_left_spd and mdivide_left (Issue #2018)
bbbales2 Oct 4, 2020
4ec16f2
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 4, 2020
77478f5
Updated gp_periodic_cov (Issue #2018)
bbbales2 Oct 5, 2020
a3740d2
Merge commit '6318a19cf0e05f8b4cf7e0298b15bec9ff688917' into HEAD
yashikno Oct 5, 2020
6225297
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 5, 2020
0c81c05
Updated sd (Issue #2018)
bbbales2 Oct 5, 2020
cbf0ea4
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 5, 2020
821561a
Updated divide (Issue #2018)
bbbales2 Oct 5, 2020
2cd7f65
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Oct 5, 2020
cd6168f
Updated ordered_constrain, eigenvalues_sym, eigenvectors_sym (Issue #…
bbbales2 Oct 5, 2020
c66ddb9
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 5, 2020
e3fbee9
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Oct 5, 2020
0538fd9
Updated log_sum_exp (Issue #2018)
bbbales2 Oct 5, 2020
4cca09c
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 5, 2020
2d11682
Updated columns_dot_product (Issue #2018)
bbbales2 Oct 5, 2020
399d260
Updated log_determinant_ldlt (Issue #2018)
bbbales2 Oct 5, 2020
fba2276
Updated log_determinant (Issue #2018)
bbbales2 Oct 5, 2020
1ffe0f0
Updated inverse (Issue #2018)
bbbales2 Oct 5, 2020
f1c6912
Updated log_determinant_spd (Issue #2018)
bbbales2 Oct 5, 2020
e24de2c
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 5, 2020
0d86351
Updated gp_exp_quad_cov (Issue #2018)
bbbales2 Oct 5, 2020
2af2840
Updated gp_exp_quad_cov (Issue #2018)
bbbales2 Oct 5, 2020
a6cebfd
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 5, 2020
ff90744
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 5, 2020
a5ffbd4
Updated simplex_constrain (Issue #2018)
bbbales2 Oct 5, 2020
5cb0584
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 5, 2020
874dc50
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 5, 2020
f51b745
Update mdivide_left_ldlt (Issue #2018)
bbbales2 Oct 5, 2020
0cc5970
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 5, 2020
2f373f5
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 5, 2020
6108d99
Updated rows_dot_product and positive_ordered_constrain (Issue #2018)
bbbales2 Oct 5, 2020
a5efd64
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 5, 2020
00bd297
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 5, 2020
9a01a38
Updated log_determinant (Issue #2018)
bbbales2 Oct 5, 2020
57f917d
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 5, 2020
009503f
Updated gp_cov_exp_quad (Issue #2018)
bbbales2 Oct 5, 2020
8d55322
Merge commit 'd5d234d15cdafe95146c319cf576cc973ebf0c6e' into HEAD
yashikno Oct 5, 2020
d763894
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Oct 5, 2020
1b0c26d
Updated unit constrain (Issue #2018)
bbbales2 Oct 5, 2020
fe6eb77
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 5, 2020
0798e9e
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 5, 2020
1c911b9
Added unit_vector_constrain to function header (Issue #2018)
bbbales2 Oct 6, 2020
d56c782
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 6, 2020
2d17c6e
Updated log_determinant (Issue #2018)
bbbales2 Oct 6, 2020
708c590
Updated rows_dot_product (Issue #2018)
bbbales2 Oct 6, 2020
00f171d
Updated expressions list (Issue #2018)
bbbales2 Oct 6, 2020
ff4d4f6
[Jenkins] auto-formatting by clang-format version 6.0.1-14 (tags/RELE…
stan-buildbot Oct 6, 2020
fe51835
Updated trace_gen_quad_form (Issue #2018)
bbbales2 Oct 6, 2020
71936ae
Merge branch 'feature/convert_to_tadj1' of https://github.com/stan-de…
bbbales2 Oct 6, 2020
654aa51
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Oct 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions stan/math/prim/fun/divide.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ inline int divide(int x, int y) {
* @param[in] c specified scalar
* @return matrix divided by the scalar
*/
template <typename Mat, typename Scal, typename = require_eigen_t<Mat>,
typename = require_stan_scalar_t<Scal>,
typename = require_all_not_var_t<scalar_type_t<Mat>, Scal>>
template <typename Mat, typename Scal, require_eigen_t<Mat>* = nullptr,
require_stan_scalar_t<Scal>* = nullptr,
require_all_not_st_var<Mat, Scal>* = nullptr>
inline auto divide(const Mat& m, Scal c) {
return (m / c).eval();
}
Expand Down
3 changes: 2 additions & 1 deletion stan/math/prim/fun/eigenvalues_sym.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ namespace math {
* @param m Specified matrix.
* @return Eigenvalues of matrix.
*/
template <typename EigMat, require_eigen_t<EigMat>* = nullptr>
template <typename EigMat, require_eigen_t<EigMat>* = nullptr,
require_not_vt_var<EigMat>* = nullptr>
Eigen::Matrix<value_type_t<EigMat>, Eigen::Dynamic, 1> eigenvalues_sym(
const EigMat& m) {
using PlainMat = plain_type_t<EigMat>;
Expand Down
3 changes: 2 additions & 1 deletion stan/math/prim/fun/eigenvectors_sym.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
namespace stan {
namespace math {

template <typename EigMat, require_eigen_t<EigMat>* = nullptr>
template <typename EigMat, require_eigen_t<EigMat>* = nullptr,
require_not_vt_var<EigMat>* = nullptr>
Eigen::Matrix<value_type_t<EigMat>, Eigen::Dynamic, Eigen::Dynamic>
eigenvectors_sym(const EigMat& m) {
using PlainMat = plain_type_t<EigMat>;
Expand Down
24 changes: 13 additions & 11 deletions stan/math/prim/fun/gp_exp_quad_cov.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,13 @@ gp_exp_quad_cov(const std::vector<Eigen::Matrix<T_x1, -1, 1>> &x1,
* @throw std::domain_error if sigma <= 0, l <= 0, or
* x is nan or infinite
*/
template <typename T_x, typename T_sigma, typename T_l>
template <typename T_x, typename T_sigma, typename T_l,
require_all_not_st_var<T_x, T_sigma, T_l> * = nullptr>
inline typename Eigen::Matrix<return_type_t<T_x, T_sigma, T_l>, Eigen::Dynamic,
Eigen::Dynamic>
gp_exp_quad_cov(const std::vector<T_x> &x, const T_sigma &sigma,
const T_l &length_scale) {
check_positive("gp_exp_quad_cov", "magnitude", sigma);
check_positive("gp_exp_quad_cov", "marginal standard deviation", sigma);
check_positive("gp_exp_quad_cov", "length scale", length_scale);

const size_t x_size = x.size();
Expand Down Expand Up @@ -214,7 +215,8 @@ inline typename Eigen::Matrix<return_type_t<T_x, T_sigma, T_l>, Eigen::Dynamic,
Eigen::Dynamic>
gp_exp_quad_cov(const std::vector<Eigen::Matrix<T_x, -1, 1>> &x,
const T_sigma &sigma, const std::vector<T_l> &length_scale) {
check_positive_finite("gp_exp_quad_cov", "magnitude", sigma);
check_positive_finite("gp_exp_quad_cov", "marginal standard deviation",
sigma);
check_positive_finite("gp_exp_quad_cov", "length scale", length_scale);

size_t x_size = x.size();
Expand Down Expand Up @@ -258,7 +260,7 @@ inline typename Eigen::Matrix<return_type_t<T_x1, T_x2, T_sigma, T_l>,
gp_exp_quad_cov(const std::vector<T_x1> &x1, const std::vector<T_x2> &x2,
const T_sigma &sigma, const T_l &length_scale) {
const char *function_name = "gp_exp_quad_cov";
check_positive(function_name, "magnitude", sigma);
check_positive(function_name, "marginal standard deviation", sigma);
check_positive(function_name, "length scale", length_scale);

const size_t x1_size = x1.size();
Expand Down Expand Up @@ -326,7 +328,7 @@ gp_exp_quad_cov(const std::vector<Eigen::Matrix<T_x1, -1, 1>> &x1,
for (size_t i = 0; i < x2_size; ++i) {
check_not_nan(function_name, "x2", x2[i]);
}
check_positive_finite(function_name, "magnitude", sigma);
check_positive_finite(function_name, "marginal standard deviation", sigma);
check_positive_finite(function_name, "length scale", length_scale);
check_size_match(function_name, "x dimension", x1[0].size(),
"number of length scales", l_size);
Expand Down Expand Up @@ -354,7 +356,7 @@ inline Eigen::MatrixXd gp_exp_quad_cov(const std::vector<double> &x,
const double &sigma,
const double &length_scale) {
const char *function_name = "gp_exp_quad_cov";
check_positive(function_name, "magnitude", sigma);
check_positive(function_name, "marginal standard deviation", sigma);
check_positive(function_name, "length scale", length_scale);

const auto x_size = x.size();
Expand Down Expand Up @@ -397,7 +399,7 @@ inline Eigen::MatrixXd gp_exp_quad_cov(const std::vector<Eigen::VectorXd> &x,
const double &sigma,
const double &length_scale) {
const char *function_name = "gp_exp_quad_cov";
check_positive(function_name, "magnitude", sigma);
check_positive(function_name, "marginal standard deviation", sigma);
check_positive(function_name, "length scale", length_scale);

const size_t x_size = x.size();
Expand Down Expand Up @@ -441,7 +443,7 @@ inline Eigen::MatrixXd gp_exp_quad_cov(
const std::vector<Eigen::VectorXd> &x, const double &sigma,
const std::vector<double> &length_scale) {
const char *function_name = "gp_exp_quad_cov";
check_positive_finite(function_name, "magnitude", sigma);
check_positive_finite(function_name, "marginal standard deviation", sigma);
check_positive_finite(function_name, "length scale", length_scale);

const size_t x_size = x.size();
Expand Down Expand Up @@ -489,7 +491,7 @@ inline typename Eigen::MatrixXd gp_exp_quad_cov(const std::vector<double> &x1,
const double &sigma,
const double &length_scale) {
const char *function_name = "gp_exp_quad_cov";
check_positive_finite(function_name, "magnitude", sigma);
check_positive_finite(function_name, "marginal standard deviation", sigma);
check_positive_finite(function_name, "length scale", length_scale);

Eigen::MatrixXd cov(x1.size(), x2.size());
Expand Down Expand Up @@ -542,7 +544,7 @@ inline typename Eigen::MatrixXd gp_exp_quad_cov(
const char *function_name = "gp_exp_quad_cov";
const int x1_size = x1.size();
const int x2_size = x2.size();
check_positive_finite(function_name, "magnitude", sigma);
check_positive_finite(function_name, "marginal standard deviation", sigma);
check_positive_finite(function_name, "length scale", length_scale);

Eigen::MatrixXd cov(x1.size(), x2.size());
Expand Down Expand Up @@ -607,7 +609,7 @@ inline typename Eigen::MatrixXd gp_exp_quad_cov(
const int x1_inner_size = x1[0].size();
const int x2_inner_size = x1[0].size();
const char *function_name = "gp_exp_quad_cov";
check_positive_finite(function_name, "magnitude", sigma);
check_positive_finite(function_name, "marginal standard deviation", sigma);
check_positive_finite(function_name, "length scale", length_scale);
check_size_match(function_name, "x dimension", x1[0].size(),
"number of length scales", l_size);
Expand Down
3 changes: 2 additions & 1 deletion stan/math/prim/fun/gp_periodic_cov.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ namespace math {
* @throw std::domain_error if sigma <= 0, l <= 0, p <= 0 or
* x is nan or infinite
*/
template <typename T_x, typename T_sigma, typename T_l, typename T_p>
template <typename T_x, typename T_sigma, typename T_l, typename T_p,
require_all_not_st_var<T_x, T_sigma, T_l, T_p> * = nullptr>
inline typename Eigen::Matrix<return_type_t<T_x, T_sigma, T_l, T_p>,
Eigen::Dynamic, Eigen::Dynamic>
gp_periodic_cov(const std::vector<T_x> &x, const T_sigma &sigma, const T_l &l,
Expand Down
2 changes: 1 addition & 1 deletion stan/math/prim/fun/log_determinant_ldlt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace math {
* @return the log(abs(det(A))
*/
template <int R, int C, typename T>
inline T log_determinant_ldlt(LDLT_factor<T, R, C> &A) {
inline T log_determinant_ldlt(const LDLT_factor<T, R, C> &A) {
if (A.rows() == 0) {
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion stan/math/prim/fun/log_sum_exp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace math {
* @param b the second variable
*/
template <typename T1, typename T2, require_all_not_st_var<T1, T2>* = nullptr>
inline return_type_t<T1, T2> log_sum_exp(const T2& a, const T1& b) {
inline return_type_t<T1, T2> log_sum_exp(const T1& a, const T2& b) {
if (a == NEGATIVE_INFTY) {
return b;
}
Expand Down
6 changes: 2 additions & 4 deletions stan/math/prim/fun/matrix_power.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ matrix_power(const EigMat& M, const int n) {
constexpr int C = EigMat::ColsAtCompileTime;

check_square("matrix_power", "M", M);
if (n < 0)
invalid_argument("matrix_power", "n", n, "is ", ", but must be >= 0!");
check_nonnegative("matrix_power", "n", n);
if (M.rows() == 0)
invalid_argument("matrix_power", "M.rows()", M.rows(), "is ",
", but must be > 0!");
return {};
Eigen::Matrix<T, R, C> MM = M;
check_finite("matrix_power", "M", MM);
if (n == 0)
Expand Down
3 changes: 2 additions & 1 deletion stan/math/prim/fun/ordered_constrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ namespace math {
* @return Positive, increasing ordered vector.
* @tparam T Type of scalar.
*/
template <typename EigVec, require_eigen_col_vector_t<EigVec>* = nullptr>
template <typename EigVec, require_eigen_col_vector_t<EigVec>* = nullptr,
require_not_st_var<EigVec>* = nullptr>
plain_type_t<EigVec> ordered_constrain(const EigVec& x) {
using Eigen::Dynamic;
using Eigen::Matrix;
Expand Down
3 changes: 2 additions & 1 deletion stan/math/prim/fun/positive_ordered_constrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ namespace math {
* @param x Free vector of scalars.
* @return Positive, increasing ordered vector.
*/
template <typename EigVec, require_eigen_col_vector_t<EigVec>* = nullptr>
template <typename EigVec, require_eigen_col_vector_t<EigVec>* = nullptr,
require_not_st_var<EigVec>* = nullptr>
Eigen::Matrix<value_type_t<EigVec>, Eigen::Dynamic, 1>
positive_ordered_constrain(const EigVec& x) {
using Eigen::Dynamic;
Expand Down
3 changes: 2 additions & 1 deletion stan/math/prim/fun/simplex_constrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ namespace math {
* @param y Free vector input of dimensionality K - 1.
* @return Simplex of dimensionality K.
*/
template <typename ColVec, require_eigen_col_vector_t<ColVec>* = nullptr>
template <typename ColVec, require_eigen_col_vector_t<ColVec>* = nullptr,
require_not_st_var<ColVec>* = nullptr>
auto simplex_constrain(const ColVec& y) {
// cut & paste simplex_constrain(Eigen::Matrix, T) w/o Jacobian
using Eigen::Dynamic;
Expand Down
2 changes: 1 addition & 1 deletion stan/math/prim/fun/trace_inv_quad_form_ldlt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace math {
*
*/
template <typename T, typename EigMat2, int R, int C,
typename = require_all_not_st_var<T, EigMat2>>
require_all_not_st_var<T, EigMat2>* = nullptr>
inline return_type_t<T, EigMat2> trace_inv_quad_form_ldlt(
const LDLT_factor<T, R, C>& A, const EigMat2& B) {
check_multiplicable("trace_inv_quad_form_ldlt", "A", A, "B", B);
Expand Down
15 changes: 8 additions & 7 deletions stan/math/prim/fun/unit_vector_constrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ namespace math {
* @param y vector of K unrestricted variables
* @return Unit length vector of dimension K
*/
template <typename T, int R, int C>
Eigen::Matrix<T, R, C> unit_vector_constrain(const Eigen::Matrix<T, R, C>& y) {
template <typename T, require_eigen_t<T>* = nullptr,
require_not_vt_var<T>* = nullptr>
inline plain_type_t<T> unit_vector_constrain(const T& y) {
using std::sqrt;
check_vector("unit_vector_constrain", "y", y);
check_nonzero_size("unit_vector_constrain", "y", y);
T SN = dot_self(y);
scalar_type_t<T> SN = dot_self(y);
check_positive_finite("unit_vector_constrain", "norm", SN);
return y / sqrt(SN);
}
Expand All @@ -45,13 +46,13 @@ Eigen::Matrix<T, R, C> unit_vector_constrain(const Eigen::Matrix<T, R, C>& y) {
* @return Unit length vector of dimension K
* @param lp Log probability reference to increment.
*/
template <typename T, int R, int C>
Eigen::Matrix<T, R, C> unit_vector_constrain(const Eigen::Matrix<T, R, C>& y,
T& lp) {
template <typename T1, typename T2, require_eigen_t<T1>* = nullptr,
require_all_not_vt_var<T1, T2>* = nullptr>
inline plain_type_t<T1> unit_vector_constrain(const T1& y, T2& lp) {
using std::sqrt;
check_vector("unit_vector_constrain", "y", y);
check_nonzero_size("unit_vector_constrain", "y", y);
T SN = dot_self(y);
scalar_type_t<T1> SN = dot_self(y);
check_positive_finite("unit_vector_constrain", "norm", SN);
lp -= 0.5 * SN;
return y / sqrt(SN);
Expand Down
17 changes: 11 additions & 6 deletions stan/math/prim/fun/variance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <stan/math/prim/err.hpp>
#include <stan/math/prim/fun/Eigen.hpp>
#include <stan/math/prim/fun/mean.hpp>
#include <stan/math/prim/fun/to_ref.hpp>
#include <vector>

namespace stan {
Expand Down Expand Up @@ -45,20 +46,24 @@ inline return_type_t<T> variance(const std::vector<T>& v) {
* @return sample variance of coefficients
* @throw <code>std::invalid_argument</code> if the matrix has size zero
*/
template <typename T, int R, int C>
inline return_type_t<T> variance(const Eigen::Matrix<T, R, C>& m) {
template <typename T, require_eigen_t<T>* = nullptr,
require_not_st_var<T>* = nullptr>
inline return_type_t<T> variance(const T& m) {
check_nonzero_size("variance", "m", m);

if (m.size() == 1) {
return 0.0;
}
return_type_t<T> mn(mean(m));

const auto& m_ref = to_ref(m);

return_type_t<T> mn(mean(m_ref));
return_type_t<T> sum_sq_diff(0);
for (int i = 0; i < m.size(); ++i) {
return_type_t<T> diff = m(i) - mn;
for (int i = 0; i < m_ref.size(); ++i) {
return_type_t<T> diff = m_ref(i) - mn;
sum_sq_diff += diff * diff;
}
return sum_sq_diff / (m.size() - 1);
return sum_sq_diff / (m_ref.size() - 1);
}

} // namespace math
Expand Down
7 changes: 3 additions & 4 deletions stan/math/prim/prob/inv_wishart_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ return_type_t<T_y, T_dof, T_scale> inv_wishart_lpdf(const T_y& W,
static const char* function = "inv_wishart_lpdf";
check_size_match(function, "Rows of random variable", W.rows(),
"columns of scale parameter", S.rows());
check_square(function, "random variable", W);
check_square(function, "scale parameter", S);
check_symmetric(function, "random variable", W);
check_symmetric(function, "scale parameter", S);
Eigen::Index k = S.rows();
T_nu_ref nu_ref = nu;
T_S_ref S_ref = S;
Expand Down Expand Up @@ -87,8 +87,7 @@ return_type_t<T_y, T_dof, T_scale> inv_wishart_lpdf(const T_y& W,
// &S(0), S.size(), 1);
// lp -= 0.5 * dot_product(S_vec, W_inv_vec); // trace(S * W^-1)
Eigen::Matrix<return_type_t<T_y, T_scale>, Eigen::Dynamic, Eigen::Dynamic>
Winv_S(mdivide_left_ldlt(
ldlt_W, S_ref.template selfadjointView<Eigen::Lower>()));
Winv_S(mdivide_left_ldlt(ldlt_W, S_ref));
lp -= 0.5 * trace(Winv_S);
}
if (include_summand<propto, T_dof, T_scale>::value) {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/prim/prob/inv_wishart_rng.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ inline Eigen::MatrixXd inv_wishart_rng(double nu, const Eigen::MatrixXd& S,
static const char* function = "inv_wishart_rng";
index_type_t<MatrixXd> k = S.rows();
check_greater(function, "degrees of freedom > dims - 1", nu, k - 1);
check_square(function, "scale parameter", S);
check_symmetric(function, "scale parameter", S);

MatrixXd S_inv = MatrixXd::Identity(k, k);
S_inv = S.ldlt().solve(S_inv);
Expand Down
3 changes: 2 additions & 1 deletion stan/math/rev/fun.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <stan/math/rev/fun/conj.hpp>
#include <stan/math/rev/fun/cos.hpp>
#include <stan/math/rev/fun/cosh.hpp>
#include <stan/math/rev/fun/cov_exp_quad.hpp>
#include <stan/math/rev/fun/determinant.hpp>
#include <stan/math/rev/fun/digamma.hpp>
#include <stan/math/rev/fun/dims.hpp>
Expand All @@ -58,6 +57,7 @@
#include <stan/math/rev/fun/from_var_value.hpp>
#include <stan/math/rev/fun/gamma_p.hpp>
#include <stan/math/rev/fun/gamma_q.hpp>
#include <stan/math/rev/fun/gp_exp_quad_cov.hpp>
#include <stan/math/rev/fun/gp_periodic_cov.hpp>
#include <stan/math/rev/fun/grad.hpp>
#include <stan/math/rev/fun/grad_inc_beta.hpp>
Expand Down Expand Up @@ -150,6 +150,7 @@
#include <stan/math/rev/fun/trigamma.hpp>
#include <stan/math/rev/fun/trunc.hpp>
#include <stan/math/rev/fun/typedefs.hpp>
#include <stan/math/rev/fun/unit_vector_constrain.hpp>
#include <stan/math/rev/fun/value_of.hpp>
#include <stan/math/rev/fun/value_of_rec.hpp>
#include <stan/math/rev/fun/variance.hpp>
Expand Down
6 changes: 3 additions & 3 deletions stan/math/rev/fun/LDLT_alloc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class LDLT_alloc : public chainable_alloc {
**/
inline void compute(const Eigen::Matrix<var, R, C> &A) {
N_ = A.rows();
variA_ = A.vi();
arena_A_ = A;
ldlt_.compute(A.val());
}

Expand All @@ -46,8 +46,8 @@ class LDLT_alloc : public chainable_alloc {
}

size_t N_;
Eigen::LDLT<Eigen::Matrix<double, R, C> > ldlt_;
Eigen::Matrix<vari *, R, C> variA_;
Eigen::LDLT<Eigen::Matrix<double, R, C>> ldlt_;
arena_matrix<Eigen::Matrix<var, R, C>> arena_A_;
};

} // namespace math
Expand Down
Loading