Skip to content

Commit

Permalink
Merge pull request JuliaLang#517 from pao/topic/linspace
Browse files Browse the repository at this point in the history
Make two-argument linspace() MATLAB-compatible.
  • Loading branch information
JeffBezanson committed Mar 4, 2012
2 parents b22a306 + 2b23004 commit 38ddfca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jl/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function linspace(start::Real, stop::Real, n::Integer)
a
end

linspace(start::Real, stop::Real) = [ i | i=start:stop ]
linspace(start::Real, stop::Real) = linspace(start, stop, 100)

logspace(start::Real, stop::Real, n::Integer) = 10.^linspace(start, stop, n)
logspace(start::Real, stop::Real) = logspace(start, stop, 50)
Expand Down
2 changes: 1 addition & 1 deletion jl/linalg_lapack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function lu!{T<:Union(Float32,Float64,Complex64,Complex128)}(A::StridedMatrix{T}
info = _jl_lapack_getrf(m, n, A, stride(A,2), ipiv)

if info > 0; error("matrix is singular"); end
P = linspace(1, m)
P = [i | i = 1:m]
for i=1:min(m,n)
t = P[i]
P[i] = P[ipiv[i]]
Expand Down

0 comments on commit 38ddfca

Please sign in to comment.