-
Notifications
You must be signed in to change notification settings - Fork 25
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
Merge RowEchelon.jl
into LinearAlgebra.jl
#17
Comments
@blegat Out of curiosity, is there any update as to if we will get |
I feel as though this wouldn't bee too tricky to implement. Is it not just a matter of copying some code over, and making sure nothing breaks? Or is there more to it? |
Yeah, I feel that this has been neglected for a long time. Don't think it should be breaking anything as it works fine as is. Would be great to have this merged. |
Nothing is blocking this I believe, just needs someone to make a PR copying the code from RowEchelon to this repo then I'll be happy to deprecate RowEchelon.jl |
I’m happy to do this in a couple of hours unless someone beats me to it before then! I’ve copied your code @blegat, and added a “verbose” option, in one of my packages :-) I also added a column swapping option, but this does not put a matrix into row echelon form, but rather it puts the matrix into an “equivalent” matrix (which is basically Linear Algebra for “close enough”), but unsure whether this should be added |
Hahaha @jakewilliami I was literally also doing it right now. After some discussion here: https://julialang.zulipchat.com/#narrow/stream/137791-general/topic/rref it seems it is probably okay to have it back in the LinearAlgebra standard library. So making a PR to JuliaLang/julia |
@pranshumalik14 great, okay! If you wanted to add |
I didn't completely follow what you meant by column swapping and equivalent matrices. Are you referring to column operations? We can take this discussion to another messaging channel like Zulip/Slack if you want. Probably best to collaborate on this |
@pranshumalik14 I’m on slack :-) |
@blegat @pranshumalik14 i stumbled upon this issue as i was searching for a way to calculate rational basis of nullspace in julia . Didn't knew using LinearAlgebra
using RowEchelon
function rational_basis_nullspace(A::AbstractVecOrMat)
"""
Function for finding rational basis of nullspace of a matrix A
Citation:
This function is re-written in Julia , based on
Built-in MATLAB function null.m ( Copyright 1984-2017 The MathWorks, Inc.)
"""
R,pivot_cols = rref_with_pivots(A)
m,n = size(A);
r = length(pivot_cols);
nopiv = collect(1:n);
deleteat!(nopiv, pivot_cols)
Z = zeros(n,n-r);
if n > r
Z[nopiv,:] = diagm(0 => ones(n-r));
if r > 0
Z[pivot_cols,:] = -R[1:r,nopiv];
end
end
return Z
end
|
See JuliaLang/julia#9804
The text was updated successfully, but these errors were encountered: