-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
RFC: Add cond() for sparse matrices #12467
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
Conversation
Great. I'll review later today. |
4ae92c6
to
f6dd68f
Compare
# TODO rank | ||
|
||
# cond | ||
function cond(A::SparseMatrixCSC, p::Real=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cond
defaulting to different norms for sparse vs dense is a little iffy.
And I think normestinv
would look a little nicer without the leading and trailing lines of whitespace inside the method - the spacing within the code is fine, but right after function
and right before end
doesn't serve much purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tkelman I agree, this bugs me as well. Still, defaulting to a non implemented feature p=2
would be rather annoying. As an alternative, we could enforce the use of both arguments when A
is sparse.
You're right, those blank lines aren't that useful. I'll delete them next time I amend the commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using 2
as the default here. Eventually, we should support the 2 norm and until we do, people won't accidentally get different norm than they expect.
1b9a2a8
to
28a2d01
Compare
@andreasnoack Than you, I changed what you suggested and amended the commit. |
n = max(size(A)...) | ||
F = factorize(A) | ||
t = min(t,n) | ||
if length(t) > 1 || t <= 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
length
is not necessary here because t
is restricted to be an Integer
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I overlooked it. Fixed and amended.
28a2d01
to
4ceb4ea
Compare
Greta. I've just confirmed that the return type is uniquely defined for |
RFC: Add cond() for sparse matrices
Great. I think this closes JuliaLang/LinearAlgebra.jl#104. |
Changes Unknown when pulling 4ceb4ea on mfasi:cond_and_condest into ** on JuliaLang:master**. |
This PR would add the function
cond()
for sparse matrices, using the algorithm described in JuliaLang/LinearAlgebra.jl#104.