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

Wrap parent of PDMat in Symmetric in eigmin/eigmax #200

Merged
merged 2 commits into from
Dec 8, 2023

Conversation

jishnub
Copy link
Contributor

@jishnub jishnub commented Dec 8, 2023

julia> X = randn(400,600); A = X * X' + I; isposdef(A)
true

julia> S = Symmetric(A);

julia> P = PDMat(S, cholesky(S));

julia> @btime eigmax($P);
  7.598 ms (11 allocations: 1.36 MiB) # master
  4.388 ms (11 allocations: 1.36 MiB) # PR

@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cd28425) 91.48% compared to head (77fff47) 91.48%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #200   +/-   ##
=======================================
  Coverage   91.48%   91.48%           
=======================================
  Files           9        9           
  Lines         681      681           
=======================================
  Hits          623      623           
  Misses         58       58           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@devmotion devmotion left a comment

Choose a reason for hiding this comment

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

I think it's fine. My only concern is that currently we don't check that a matrix is symmetric when constructing a PDMat, so this could potentially lead to surprising bugs that are hard to discover. But since we already use this pattern in other functions and rely on symmetry, I think it is OK to address this concern in a separate PR.

src/pdmat.jl Outdated Show resolved Hide resolved
@jishnub jishnub changed the title Wrap parent of PDMat in Hermitian in eigmin/eigmax Wrap parent of PDMat in Symmetric in eigmin/eigmax Dec 8, 2023
Copy link
Member

@devmotion devmotion left a comment

Choose a reason for hiding this comment

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

Thank you!

@devmotion devmotion merged commit e5829db into JuliaStats:master Dec 8, 2023
12 checks passed
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