Skip to content

Commit

Permalink
Merge pull request #24470 from Sacha0/nixmatn
Browse files Browse the repository at this point in the history
remove Matrix[{T}](s::UniformScaling, n::Integer) constructors
  • Loading branch information
Sacha0 authored Nov 19, 2017
2 parents fd66c15 + aa90565 commit 6d57635
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
3 changes: 0 additions & 3 deletions base/linalg/uniformscaling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,6 @@ Matrix{T}(s::UniformScaling, dims::Dims{2}) where {T} = setindex!(zeros(T, dims)
Matrix{T}(s::UniformScaling, m::Integer, n::Integer) where {T} = Matrix{T}(s, Dims((m, n)))
Matrix(s::UniformScaling, m::Integer, n::Integer) = Matrix(s, Dims((m, n)))
Matrix(s::UniformScaling, dims::Dims{2}) = Matrix{eltype(s)}(s, dims)
# convenience variations that accept a single integer to specify dims
Matrix{T}(s::UniformScaling, m::Integer) where {T} = Matrix{T}(s, m, m)
Matrix(s::UniformScaling, m::Integer) = Matrix(s, m, m)

## Diagonal construction from UniformScaling
Diagonal{T}(s::UniformScaling, m::Integer) where {T} = Diagonal{T}(fill(T(s.λ), m))
Expand Down
2 changes: 0 additions & 2 deletions test/linalg/uniformscaling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,10 @@ end
end

@testset "Matrix construction from UniformScaling" begin
@test Matrix(2I, 3)::Matrix{Int} == 2*eye(3)
@test Matrix(2I, 3, 3)::Matrix{Int} == 2*eye(3)
@test Matrix(2I, 3, 4)::Matrix{Int} == 2*eye(3, 4)
@test Matrix(2I, 4, 3)::Matrix{Int} == 2*eye(4, 3)
@test Matrix(2.0I, 3, 3)::Matrix{Float64} == 2*eye(3)
@test Matrix{Real}(2I, 3)::Matrix{Real} == 2*eye(3)
@test Matrix{Real}(2I, 3, 3)::Matrix{Real} == 2*eye(3)
@test Matrix{Float64}(2I, 3, 3)::Matrix{Float64} == 2*eye(3)
end
Expand Down

0 comments on commit 6d57635

Please sign in to comment.