diff --git a/NEWS.md b/NEWS.md index 22767f57cfbb8..18aea199cd635 100644 --- a/NEWS.md +++ b/NEWS.md @@ -77,6 +77,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 ----------------------------- diff --git a/stdlib/LinearAlgebra/src/uniformscaling.jl b/stdlib/LinearAlgebra/src/uniformscaling.jl index fc082764c6f4f..fd46e6c1a2fce 100644 --- a/stdlib/LinearAlgebra/src/uniformscaling.jl +++ b/stdlib/LinearAlgebra/src/uniformscaling.jl @@ -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)