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

A_<op>_B Inconsistencies #384

Closed
mihirparadkar opened this issue Nov 6, 2016 · 3 comments
Closed

A_<op>_B Inconsistencies #384

mihirparadkar opened this issue Nov 6, 2016 · 3 comments
Labels
docs This change adds or pertains to documentation

Comments

@mihirparadkar
Copy link

mihirparadkar commented Nov 6, 2016

The following code demonstrates some major inconsistencies with the A_*_B functions.

#Create a sparse positive semidefinite matrix
A = sparse(5*eye(5) - ones(5,5))
#Make it positive definite and guarantee its symmetry
AI = Symmetric(A + eye(A))

#I can factorize this just fine:
cholfact(AI, shift=1.)

#This works
A_ldiv_Bt(cholfact(AI, shift=1.), randn(2,5))

#So does this
cholfact(AI, shift=1.) \ randn(5,2)

#This doesn't (MethodError)
At_ldiv_B(cholfact(AI, shift=1.), randn(5,2))

#This also doesn't, same MethodError
A_ldiv_B!(cholfact(AI, shift=1.), randn(5,2))

I didn't try all of the possible combinations, but I don't know how to figure out which ones are implemented and which aren't.
Is this documented somewhere?

@andreasnoack andreasnoack added the docs This change adds or pertains to documentation label Nov 6, 2016
@andreasnoack
Copy link
Member

andreasnoack commented Nov 6, 2016

There are some limitations in the library that we use for sparse Cholesky which mean that A_ldiv_B! cannot be implemented. However, the documentation for cholfact doesn't mention A_x_B methods. It positively mentions functions that are supported and therefore solving is supposed to work for all possible combinations of op(F)\op(B) where op can be either nothing or '. Therefore, we should define a fallback method for At_ldiv_B that calls Ac_ldiv_B in the real case and something like At_ldiv_B(F,b)=conj.(F'\conj.(b)) otherwise.

We could also update the documentation for A_ldiv_B! to mention that sparse matrices are not supported. Other suggestions for documentation improvements are also very welcome and it would be great if you could open pull request for them.

@fredrikekre
Copy link
Member

Would it make sense to implement A_ldiv_B! for sparse using lufact, since A_ldiv_B!(lufact(A), b) already works? And in addition, throw a descriptive error for A_ldiv_B!(cholfact(A), b)?

@ViralBShah
Copy link
Member

ViralBShah commented Jan 30, 2022

Since all these APIs are greatly changed, I'm closing this. Current issues with sparse linear algebra should be filed at https://github.com/JuliaSparse/SuiteSparse.jl/issues

@KristofferC KristofferC transferred this issue from JuliaLang/julia Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

No branches or pull requests

5 participants