Skip to content

Commit

Permalink
Change Int to Integer in eye
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack committed Nov 11, 2013
1 parent fc174d3 commit 4ac1997
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,16 @@ infs(dims...) = fill!(Array(Float64, dims...), Inf)
nans{T}(::Type{T}, dims...) = fill!(Array(T, dims...), nan(T))
nans(dims...) = fill!(Array(Float64, dims...), NaN)

function eye(T::Type, m::Int, n::Int)
function eye(T::Type, m::Integer, n::Integer)
a = zeros(T,m,n)
for i = 1:min(m,n)
a[i,i] = one(T)
end
return a
end
eye(m::Int, n::Int) = eye(Float64, m, n)
eye(T::Type, n::Int) = eye(T, n, n)
eye(n::Int) = eye(Float64, n)
eye(m::Integer, n::Integer) = eye(Float64, m, n)
eye(T::Type, n::Integer) = eye(T, n, n)
eye(n::Integer) = eye(Float64, n)
eye{T}(x::AbstractMatrix{T}) = eye(T, size(x, 1), size(x, 2))

function one{T}(x::AbstractMatrix{T})
Expand Down

0 comments on commit 4ac1997

Please sign in to comment.