Skip to content

Commit

Permalink
don't use LU in rref; convert integer matrices to float
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Mar 5, 2012
1 parent 5aa5d11 commit 68899bb
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions jl/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -426,30 +426,7 @@ end

function rref{T}(A::Matrix{T})
nr, nc = size(A)
# try
# (L,U) = lu(A)
# e = eps(norm(U,Inf))
# for i = 1:nr
# d = U[i,i]
# if abs(d) > e
# for k = i:nc
# U[i,k] /= d
# end
# end
# end
# for i = 1:(nr-1)
# for j = (i+1):min(nr,nc)
# c = U[i,j]
# for k = j:nc
# U[i,k] -= c*U[j,k]
# end
# end
# end
# return U
# end
# fall back here if LU fails because A is singular

U = copy(A)
U = copy_to(similar(A,Float64), A)
e = eps(norm(U,Inf))
i = j = 1
while i <= nr && j <= nc
Expand Down

0 comments on commit 68899bb

Please sign in to comment.