Skip to content

Commit

Permalink
News and compat for JuliaLang#28790
Browse files Browse the repository at this point in the history
Add a docstring for copyto!(::AbstractMatrix, ::UniformScaling) and
document 1.1 changes.
  • Loading branch information
mortenpi committed Dec 1, 2018
1 parent 799f712 commit 35484c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Expand Up @@ -70,6 +70,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!(dest::AbstractMatrix, src::UniformScaling)` supports rectangular matrices now. ([#28790])

Compiler/Runtime improvements
-----------------------------
Expand Down
9 changes: 9 additions & 0 deletions stdlib/LinearAlgebra/src/uniformscaling.jl
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 35484c2

Please sign in to comment.