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

Improve handling of size 0 inputs #1515

Closed
mcol opened this issue Dec 14, 2019 · 1 comment · Fixed by #1517
Closed

Improve handling of size 0 inputs #1515

mcol opened this issue Dec 14, 2019 · 1 comment · Fixed by #1517
Milestone

Comments

@mcol
Copy link
Contributor

mcol commented Dec 14, 2019

Description

A number of PRs have gone in recently to handle corner cases concerning size 0 inputs that were discovered through the new autodiff test framework, authored in the most part by me.

A couple of comment #1452 ( #1452 (comment) and #1452 (comment)) made me look again at these corner cases, and I realised that things could be handled a bit better.

In particular:

  • the current checks mishandle matrices of size 0 x N (or N x 0), as we may return an empty square matrix instead of a rectangular one: affects mdivide_left_ldlt, mdivide_right_ldlt and matrix_exp_multiply
  • we should check for the input matrix being square before returning anything: affects matrix_exp_pade and scale_matrix_exp_multiply, for which we currently we return an empty matrix when we should instead throw
  • for trace_inv_quad_form_ldlt if the input matrix is 0xN we should return 0, but we currently throw
@bob-carpenter
Copy link
Contributor

These changes all sound good. It's really great that you're sanding off all these rough edges---it makes a big difference in the overall feel of a library when boundary conditions behave correctly.

@mcol mcol added this to the 3.0.0++ milestone Dec 27, 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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants