Skip to content

Commit 68bda52

Browse files
authored
fix some references in docs (#107)
1 parent b937740 commit 68bda52

File tree

2 files changed

+32
-30
lines changed

2 files changed

+32
-30
lines changed

docs/src/types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Base.:*(::LinearMap,::AbstractVector)
9393
Base.:*(::LinearMap,::AbstractMatrix)
9494
Base.:*(::AbstractMatrix,::LinearMap)
9595
LinearAlgebra.mul!(::AbstractVecOrMat,::LinearMap,::AbstractVector)
96-
LinearAlgebra.mul!(::AbstractMatrix,::LinearMap,::AbstractMatrix)
96+
LinearAlgebra.mul!(::AbstractVecOrMat,::LinearMap,::AbstractVector,::Number,::Number)
9797
*(::LinearAlgebra.AdjointAbsVec,::LinearMap)
9898
*(::LinearAlgebra.TransposeAbsVec,::LinearMap)
9999
```

src/LinearMaps.jl

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,37 @@ function Base.:(*)(A::LinearMap, x::AbstractVector)
9090
end
9191

9292
"""
93-
mul!(C, A::LinearMap, B, α, β) -> C
93+
mul!(Y::AbstractVecOrMat, A::LinearMap, B::AbstractVector) -> Y
94+
mul!(Y::AbstractMatrix, A::LinearMap, B::AbstractMatrix) -> Y
95+
96+
Calculates the action of the linear map `A` on the vector or matrix `B` and stores the result in `Y`,
97+
overwriting the existing value of `Y`. Note that `Y` must not be aliased with either `A` or `B`.
98+
99+
## Examples
100+
```jldoctest; setup=(using LinearAlgebra, LinearMaps)
101+
julia> A=LinearMap([1.0 2.0; 3.0 4.0]); B=[1.0, 1.0]; Y = similar(B); mul!(Y, A, B);
102+
103+
julia> Y
104+
2-element Array{Float64,1}:
105+
3.0
106+
7.0
107+
108+
julia> A=LinearMap([1.0 2.0; 3.0 4.0]); B=[1.0 1.0; 1.0 1.0]; Y = similar(B); mul!(Y, A, B);
109+
110+
julia> Y
111+
2×2 Array{Float64,2}:
112+
3.0 3.0
113+
7.0 7.0
114+
```
115+
"""
116+
function mul!(y::AbstractVecOrMat, A::LinearMap, x::AbstractVector)
117+
check_dim_mul(y, A, x)
118+
return _unsafe_mul!(y, A, x)
119+
end
120+
121+
"""
122+
mul!(C::AbstractVecOrMat, A::LinearMap, B::AbstractVector, α, β) -> C
123+
mul!(C::AbstractMatrix, A::LinearMap, B::AbstractMatrix, α, β) -> C
94124
95125
Combined inplace multiply-add ``A B α + C β``. The result is stored in `C` by overwriting it.
96126
Note that `C` must not be aliased with either `A` or `B`.
@@ -118,11 +148,6 @@ julia> C
118148
730.0 740.0
119149
```
120150
"""
121-
function mul!(y::AbstractVecOrMat, A::LinearMap, x::AbstractVector)
122-
check_dim_mul(y, A, x)
123-
return _unsafe_mul!(y, A, x)
124-
end
125-
126151
function mul!(y::AbstractVecOrMat, A::LinearMap, x::AbstractVector, α::Number, β::Number)
127152
check_dim_mul(y, A, x)
128153
return _unsafe_mul!(y, A, x, α, β)
@@ -155,29 +180,6 @@ function _generic_mapvec_mul!(y, A, x, α, β)
155180
end
156181

157182
# the following is of interest in, e.g., subspace-iteration methods
158-
"""
159-
mul!(Y, A::LinearMap, B) -> Y
160-
161-
Calculates the action of the linear map `A` on the vector or matrix `B` and stores the result in `Y`,
162-
overwriting the existing value of `Y`. Note that `Y` must not be aliased with either `A` or `B`.
163-
164-
## Examples
165-
```jldoctest; setup=(using LinearAlgebra, LinearMaps)
166-
julia> A=LinearMap([1.0 2.0; 3.0 4.0]); B=[1.0, 1.0]; Y = similar(B); mul!(Y, A, B);
167-
168-
julia> Y
169-
2-element Array{Float64,1}:
170-
3.0
171-
7.0
172-
173-
julia> A=LinearMap([1.0 2.0; 3.0 4.0]); B=[1.0 1.0; 1.0 1.0]; Y = similar(B); mul!(Y, A, B);
174-
175-
julia> Y
176-
2×2 Array{Float64,2}:
177-
3.0 3.0
178-
7.0 7.0
179-
```
180-
"""
181183
function mul!(Y::AbstractMatrix, A::LinearMap, X::AbstractMatrix)
182184
check_dim_mul(Y, A, X)
183185
return _generic_mapmat_mul!(Y, A, X)

0 commit comments

Comments
 (0)