-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add Hessenberg matrix format #99
Comments
+1,000,000 I've been wanting this for awhile and wondering if I was the only one. |
I would also think schurfact(A,B) should return matrices in Hessenberg format, but at the moment not even lufact(A) returns matrices in Triangular format. |
Yes, we don't return the tightest possible type annotations for matrices in matrix factorizations. I'm not sure if this is historical design predating the introduction of the special matrix types, or if there is a deeper issue behind this. cc: @ViralBShah @andreasnoackjensen |
Don't know whether this is the reason within Julia, but many of these special matrix factorization formats are stored in a way that is only "psychologically" a certain structure, and/or packed in a non-intuitive way to reduce storage requirements. It can be extra work (or at least extra copying and memory) to return the actual triangular/Hessenberg/what-have-you mathematically interesting matrix, but when you're using the Lapack data structures for all operations it's never absolutely necessary. It could be worth exposing helper functions to convert from the Lapack-style data structures back to the textbook versions (and maybe vice versa). That functionality is probably already there, but it might require looking up the Lapack code name and API for the various transformations. |
It's a little unfortunate that matrix structure and how the matrix is stored in memory are conflated, because exploiting structure can have a huge effect on algorithmic efficiency, even if a full matrix is allocated. So ideally a matrix could be flagged with special structure without doing any data manipulation, but I suppose that's a bit unrealistic Sent from my iPad
|
First of all, I think we should implement a At some point I considered the packed storage schemes in LAPACK and at that point I decided that it was not worth the extra complexity because all BLAS and LAPACK operations seemed to be slower on packed matrices and you only save half the storage. If somebody argues convincing that the packed storage is needed, we could possibly revisit this. I plan to parametrise Finally, there is actually some functionality for packed storage format hidden deep down in the linalg code. Recently LAPACK added a compact format that allows blocked operations which the usual blocked format doesn't. You can try to do
but actually I don't think it belongs in Base. It least not in its present state. |
schurfact() returns only quasi-triangular, which can have dense 2x2 blocks on the diagonal. This is a subclass of Hessenberg. I guess ideally it would return Triangular when schurfact() finds a triangular decomposition and Hessenberg when not. If I remember right, LAPack uses dense data storage for Hessenberg matrices anyways, so implementation of Hessenberg could just consist of wrapping a standard Array, and calling the appropriate LAPack routines. On 6 Apr 2014, at 9:47 pm, Andreas Noack Jensen [email protected] wrote:
|
@dlfivefifty Oh you are right. I knew I should have thought longer before answering. At least it is triangular in the complex case. |
Occasionally I am ;) Sent from my iPhone
|
We now have a |
Not really, the current Hessenberg is a QR-related factorization type. JuliaLang/julia#7965 implements a little more of the lapack bindings for a Hessenberg matrix type, but is about a year out of date. edit: amazingly there's apparently no conflict there, but it needs tests and updating for JuliaLang/julia#8734 and probably a few other changes. |
Should I not have closed it? Sorry. Should I get that PR up in a good state as penance? |
It's probably fine to close the issue as long as there's a PR open on the same topic - just reopen the issue if all related PR's somehow get closed without merging. I don't think anyone would mind if you felt inclined to adopt that PR, add tests and docs etc to finish it. Some of the more obscure RFP lapack bindings were moved out of base a while back but the Hessenberg matrix format type and operations could be useful. No penance, but if you want to use the code then go for it. |
Update to this old issue: Nowadays, we indeed have a |
There should be a Hessenberg matrix format to match LAPack's optimized routines, a la Triangular
The text was updated successfully, but these errors were encountered: