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

Order of checks in matrix functions #88

Closed
syclik opened this issue Jul 6, 2015 · 3 comments · Fixed by #1467
Closed

Order of checks in matrix functions #88

syclik opened this issue Jul 6, 2015 · 3 comments · Fixed by #1467
Assignees
Milestone

Comments

@syclik
Copy link
Member

syclik commented Jul 6, 2015

From @rtrangucci on March 31, 2015 11:33

Checks in matrix functions not ordered correctly; e.g.

mdivide_left_spd.hpp:

stan::math::check_symmetric("mdivide_left_spd", "A", A);
stan::math::check_pos_definite("mdivide_left_spd", "A", A);
stan::math::check_square("mdivide_left_spd", "A", A);
stan::math::check_multiplicable("mdivide_left_spd", 
                                                   "A", A,
                                                   "b", b);

@syclik pointed out we should be checking whether the two matrices are multiplicable before we run the check_pos_definite test. Check_pos_definite also already checks symmetry internally, so no need to call it twice.

Copied from original issue: stan-dev/stan#1415

@syclik
Copy link
Member Author

syclik commented Jul 6, 2015

From @bob-carpenter on March 31, 2015 12:17

The positive definiteness check should also check that the
matrix is square.

  • Bob

On Mar 31, 2015, at 10:33 PM, Rob Trangucci notifications@github.com wrote:

Checks in matrix functions not ordered correctly; e.g.

mdivide_left_spd.hpp:

stan::math::check_symmetric("mdivide_left_spd", "A", A);
stan::math::check_pos_definite("mdivide_left_spd", "A", A);
stan::math::check_square("mdivide_left_spd", "A", A);
stan::math::check_multiplicable("mdivide_left_spd",
"A", A,
"b", b);

@syclik pointed out we should be checking whether the two matrices are multiplicable before we run the check_pos_definite test. Check_pos_definite also already checks symmetry internally, so no need to call it twice.


Reply to this email directly or view it on GitHub.

@syclik
Copy link
Member Author

syclik commented Jul 6, 2015

From @rtrangucci on March 31, 2015 18:47

@bob-carpenter I should have added that check_pos_definite calls check_symmetric which subsequently calls check_square, so there only need to be two checks in mdivide_left_spd(A,b):

check_multiplicable(A,b)
check_pos_defininte(A)

@bob-carpenter bob-carpenter added this to the v2.8.0++ milestone Oct 23, 2015
@syclik syclik modified the milestones: v2.9.0, v2.9.0++ Dec 1, 2015
@syclik syclik modified the milestones: v2.10.0, v2.10++ Apr 28, 2016
@syclik syclik modified the milestones: v2.11.0, v2.11.0++ Jul 27, 2016
@syclik syclik modified the milestones: v2.12.0, v2.12.0++ Sep 7, 2016
@bob-carpenter bob-carpenter removed the bug label Oct 14, 2016
@syclik syclik modified the milestones: v2.13.0, 2.13.0++ Oct 22, 2016
@syclik syclik modified the milestones: v2.14.0, 2.14.0++ Dec 26, 2016
@syclik syclik modified the milestones: 2.14.0++, v2.14.0 Dec 26, 2016
@bob-carpenter bob-carpenter self-assigned this Apr 3, 2017
@bob-carpenter bob-carpenter modified the milestones: 2.15.0++, 2.14.0++ Apr 3, 2017
@bob-carpenter
Copy link
Contributor

They also don't need all those stan::math qualifications. I'm a little reluctant to take on some of these issues because they involve massive code reviews.

@seantalts seantalts modified the milestones: 2.16.0, 2.16++ Jul 5, 2017
@seantalts seantalts modified the milestones: 2.17.0, 2.17.0++ Sep 6, 2017
@syclik syclik modified the milestones: 2.18.0, 2.18.0++ Feb 13, 2018
@syclik syclik modified the milestones: 2.19.0, 2.19.0++ Mar 18, 2019
@serban-nicusor-toptal serban-nicusor-toptal modified the milestones: 3.0.0++, 3.1.0 Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants