Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate scale! in favor of mul!, mul1!, and mul2! #25701

Merged
merged 5 commits into from
Jan 24, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix typos
  • Loading branch information
andreasnoack committed Jan 23, 2018
commit 3f01891b854dc76fa286d17a12b298b2b5a4dad5
4 changes: 2 additions & 2 deletions stdlib/LinearAlgebra/docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,6 @@ LinearAlgebra.tril!
LinearAlgebra.diagind
LinearAlgebra.diag
LinearAlgebra.diagm
LinearAlgebra.mul1!
LinearAlgebra.mul2!
LinearAlgebra.rank
LinearAlgebra.norm
LinearAlgebra.vecnorm
Expand Down Expand Up @@ -431,6 +429,8 @@ below (e.g. `mul!`) according to the usual Julia convention.

```@docs
LinearAlgebra.mul!
LinearAlgebra.mul1!
LinearAlgebra.mul2!
LinearAlgebra.ldiv!
LinearAlgebra.rdiv!
```
Expand Down
4 changes: 2 additions & 2 deletions stdlib/LinearAlgebra/src/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1274,5 +1274,5 @@ end
@deprecate scale!(a::Number, B::AbstractArray) mul2!(a, B)
@deprecate scale!(A::AbstractMatrix, b::AbstractVector) mul1!(A, Diagonal(b))
@deprecate scale!(a::AbstractVector, B::AbstractMatrix) mul2!(Diagonal(a), B)
@deprecate scale!(C::AbstractMatrix, A::AbstractMatrix, b::AbstractVector) mul!(X, A, Diagonal(b))
@deprecate scale!(C::AbstractMatrix, a::AbstractVector, B::AbstractMatrix) mul!(X, Diagonal(a), B)
@deprecate scale!(C::AbstractMatrix, A::AbstractMatrix, b::AbstractVector) mul!(C, A, Diagonal(b))
@deprecate scale!(C::AbstractMatrix, a::AbstractVector, B::AbstractMatrix) mul!(C, Diagonal(a), B)
18 changes: 9 additions & 9 deletions stdlib/LinearAlgebra/src/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,44 +43,44 @@ mul!(C::AbstractArray, s::Number, X::AbstractArray) = generic_mul!(C, X, s)
mul!(C::AbstractArray, X::AbstractArray, s::Number) = generic_mul!(C, s, X)

"""
mul1!(A, b)
mul1!(A::AbstractArray, b::Number)

Scale an array `A` by a scalar `b` overwriting `A` in-place.

# Examples
```jldoctest
julia> a = [1 2; 3 4]
julia> A = [1 2; 3 4]
2×2 Array{Int64,2}:
1 2
3 4

julia> mul1!(a, 2)
julia> mul1!(A, 2)
2×2 Array{Int64,2}:
2 4
6 8
```
"""
mul1!(X::AbstractArray, s::Number) = generic_mul1!(X, s)
mul1!(A::AbstractArray, b::Number) = generic_mul1!(A, b)

"""
mul2!(A, b)
mul2!(a::Number, B::AbstractArray)

Scale an array `A` by a scalar `b` overwriting `A` in-place.
Scale an array `B` by a scalar `a` overwriting `B` in-place.

# Examples
```jldoctest
julia> a = [1 2; 3 4]
julia> B = [1 2; 3 4]
2×2 Array{Int64,2}:
1 2
3 4

julia> mul2!(2, a)
julia> mul2!(2, B)
2×2 Array{Int64,2}:
2 4
6 8
```
"""
mul2!(s::Number, X::AbstractArray) = generic_mul2!(s, X)
mul2!(a::Number, B::AbstractArray) = generic_mul2!(a, B)

"""
cross(x, y)
Expand Down