-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Return Q/R factors in SPQR #394
Comments
In general, I have a system of the form: where A is a rectangular matrix. I want to obtain an equivalent system that is full row rank. The way I'm doing it is calculating the rank of A, and then using the QR = AE factorization and the rank r to find an equivalent system made of the first r rows of: RE' x = Q'b. To do this I'm using the following code: F = qrfact(model.S); However, I'm getting the error below. Any ideas? Thanks! *** Error in `julia': double free or corruption (!prev): 0x00000000050961d0 *** signal (6): Aborted |
That looks like a bug, but separate from your feature request here. Can you provide self contained input data that reproducibly causes that? And platform and version info. |
You can try the following code. This is in Julia 0.5.0 in Ubuntu 14.04.1 LTS and a 64 bit machine. |
You are not supposed to free the SQPR object. Julia will do that for you so Julia segfaults when you have already freed the object. If I uncomment the |
If I comment that line (I do not use free), I get the following output: *** Error in `julia': double free or corruption (!prev): 0x000000000392f1b0 *** signal (6): Aborted |
In this file line 75 has a |
The test.jl in the attached folder fails with |
Thanks. Just tried it on my Mac. It works on both master and 0.5. What is your |
Julia Version 0.5.0 |
Just tried on a Linux machine with 0.5 and now I can reproduce the segfault. I'll look into it. |
Thanks for looking into this! For the record, the same code in Julia 0.5.0 in Windows 10 also fails. No error is returned, the terminal just shuts down. julia> versioninfo() |
I've spent some time on this but so far I haven't been able to figure out what the problem is including why this is not showing up on Mac. |
The failure in the example "SPQR failure.zip" posted above is due to a malformed input: one of the matrices returned by With regard to the request for Q and R matrices, they are not immediately accessible from the C API which Julia uses because they are wasteful for most purposes. One could of course apply |
See the discussion in JuliaLang/julia#20464. It appears that we actually made some wrong assumptions about the buffer sizes. The PR fixes the issue on the Linux machine where I was able to reproduce the problem. |
What does PR mean? I see you committed some changes that you are waiting to merge with master. How can I adopt the changes? Should I wait until the changes are pulled into the master? Thanks! |
PR means pull request. There was a request for an extra test which I haven't added yet. It should happen soon. |
Hi,
Has someone added the functionality to extract the Q and R factors of the SPQR factorization? So far, the result of using qrfact on a sparse matrix is the following:
Base.SparseArrays.SPQR.Factorization{Float64}(3,3,Ptr{Base.SparseArrays.SPQR.C_Factorization{Float64}} @0x0000000009f9d4a0)
I see that this issue has been reported in the past, but it seems no one has added this functionality to Julia.
Thanks!
The text was updated successfully, but these errors were encountered: