Skip to content

Commit

Permalink
News and compat for #28790 copyto!(::AbstractMatrix, ::UniformScaling)
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenpi authored and fredrikekre committed Dec 4, 2018
1 parent 09a6710 commit 67a1bd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Standard library changes
* New `sort!(::AbstractArray; dims)` method that can sort the array along the `dims` dimension ([#28902]).
* `range` now accept `stop` as a positional argument ([#28708]).
* `parse(Bool, str)` is now supported ([#29997]).
* `copyto!(::AbstractMatrix, ::UniformScaling)` supports rectangular matrices now ([#28790]).

Compiler/Runtime improvements
-----------------------------
Expand Down
9 changes: 9 additions & 0 deletions stdlib/LinearAlgebra/src/uniformscaling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,15 @@ function isapprox(J::UniformScaling, A::AbstractMatrix;
end
isapprox(A::AbstractMatrix, J::UniformScaling; kwargs...) = isapprox(J, A; kwargs...)

"""
copyto!(dest::AbstractMatrix, src::UniformScaling)
Copies a [`UniformScaling`](@ref) onto a matrix.
!!! compat "Julia 1.1"
In Julia 1.0 this method only supported a square destination matrix. Julia 1.1. added
support for a rectangular matrix.
"""
function copyto!(A::AbstractMatrix, J::UniformScaling)
@assert !has_offset_axes(A)
fill!(A, 0)
Expand Down

0 comments on commit 67a1bd2

Please sign in to comment.