-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Some linalg cleanup. Fix module path to exceptions. #3089
Conversation
This should fix #3082 |
Thanks @andreasnoackjensen . Is there any chance before this gets merged, that you can add a
This would be useful for example when you want to also implement rdivide for LU, like
The only other place where the flag will have an effect as far as I can see is for P.S. Cholesky does not need such a flag---LAPACK.potrs does not accept a flag, and you can do:
|
Hmm, on second thoughts, maybe |
@@ -432,7 +425,7 @@ function eigfact!{T<:BlasFloat}(A::StridedMatrix{T}) | |||
end | |||
|
|||
eigfact(A::StridedMatrix) = eigfact!(copy(A)) | |||
eigfact{T<:Integer}(x::StridedMatrix{T}) = eigfact(float64(x)) | |||
eigfact!{T<:Integer}(x::StridedMatrix{T}) = eigfact!(float64(x)) |
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.
It would be best to just use float(x)
as everywhere else.
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.
This also introduces a performance penalty. For integral matrices eigfact will now do two copies instead of one.
@bsxfan It is a good idea to have a transpose flag in the factorizations, and provide a method to transpose the factorization that just updates the flag. Best not to hold up this pull request though. @andreasnoackjensen Apart from the couple of comments above, the rest looks good to me. |
This seems to undo some of the changes in: The idea in that commit was to annotate on the BlasFloat type (or StridedArray{BlasFloat}) for operations that require this. And then to have functions such as svdvals(A::StridedMatrix) = svdvals!(float(A)) which uses duck typing on the float function. With this commit function calls such as This commit will also introduce performance penalties, for instance, svdvals on an integral matrix will require two copies instead of one. |
I was just thinking that this commit might interfere with your earlier commit. |
@daviddelaat Won't just getting rid of |
That will mostly resolve it, but then there is still the problem of two copies instead of one for non BlasFloat matrices. |
@bsxfan Lightweight transpose is currently handled by the U.' \V will actually call |
@daviddelaat I forgot the discussion about the rational matrices. I'll go through the code and make a new version. Hopefully also without unnecessary copying. |
@daviddelaat Please have a look at the new version. |
That looks great @andreasnoackjensen. The only thing I'm missing is the |
… dependence in copying factorization constructors.
@daviddelaat I have now added the |
This looks good to me. Very nice that you took care of all the factorizations! |
Here are some more things in factorization.jl that will need attention at some stage:
I have been experimenting with coding strategies to handle the last two requirements. It may be nice to handle them together, because then one can do things like converting and transposing together, like e.g.: |
@bsxfan I think we should merge this as soon as @ViralBShah says go and then look into your suggestions in a new issue. |
Sorry for the delay - this looks good. Please merge. @bsxfan Thanks for digging deep into the array and linear algebra code. Let's hold off doing anything with |
Some linalg cleanup. Fix module path to exceptions.
Remove parametric dependence in copying factorization constructors. Add parametric dependence in
\
and*
methods.