Skip to content

Commit 94e4d07

Browse files
committed
few more fixes
1 parent d00a916 commit 94e4d07

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/LinearMaps.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ export LinearMap
66
using LinearAlgebra
77
import SparseArrays
88

9-
import Base: +, -, *, \, /, ==
10-
119
abstract type LinearMap{T} end
1210

1311
Base.eltype(::LinearMap{T}) where {T} = T
@@ -86,7 +84,7 @@ include("functionmap.jl") # using a function as linear map
8684
8785
Construct a linear map object, either from an existing `LinearMap` or `AbstractMatrix` `A`,
8886
with the purpose of redefining its properties via the keyword arguments `kwargs`, or
89-
from a function or callable object `f`. In the latter case, one also needs to specialize
87+
from a function or callable object `f`. In the latter case, one also needs to specify
9088
the size of the equivalent matrix representation `(M, N)`, i.e. for functions `f` acting
9189
on length `N` vectors and producing length `M` vectors (with default value `N=M`). Preferably,
9290
also the `eltype` `T` of the corresponding matrix representation needs to be specified, i.e.

src/functionmap.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ FunctionMap{T}(f, M::Int, N::Int; kwargs...) where {T} = FunctionMap{T}(f, nothi
2222
FunctionMap{T}(f, fc, M::Int; kwargs...) where {T} = FunctionMap{T}(f, fc, M, M; kwargs...)
2323

2424
# show
25+
function Base.show(io::IO, A::FunctionMap{T,F,Nothing}) where {T,F}
26+
print(io,"LinearMaps.FunctionMap{$T}($(A.f), $(A.M), $(A.N); ismutating=$(A._ismutating), issymmetric=$(A._issymmetric), ishermitian=$(A._ishermitian), isposdef=$(A._isposdef))")
27+
end
2528
function Base.show(io::IO, A::FunctionMap{T}) where {T}
2629
print(io,"LinearMaps.FunctionMap{$T}($(A.f), $(A.fc), $(A.M), $(A.N); ismutating=$(A._ismutating), issymmetric=$(A._issymmetric), ishermitian=$(A._ishermitian), isposdef=$(A._isposdef))")
2730
end

src/linearcombination.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function Base.:(*)(α::Number, A::LinearMap)
6868
return LinearCombination{T}(tuple(A), tuple(α))
6969
end
7070
Base.:(*)(A::LinearMap, α::Number) = *(α, A)
71-
function *::Number, A::LinearCombination)
71+
function Base.:(*)::Number, A::LinearCombination)
7272
T = promote_type(eltype(α), eltype(A))
7373
return LinearCombination{T}(A.maps, map(x->α*x, A.coeffs))
7474
end
@@ -79,7 +79,7 @@ function Base.:(\)(α::Number, A::LinearMap)
7979
return LinearCombination{T}(tuple(A), tuple(1/α))
8080
end
8181
Base.:(/)(A::LinearMap, α::Number) = \(α, A)
82-
function \::Number, A::LinearCombination)
82+
function Base.:(\)::Number, A::LinearCombination)
8383
T = promote_type(eltype(α), eltype(A))
8484
return LinearCombination{T}(A.maps, map(x->α\x, A.coeffs))
8585
end

src/wrappedmap.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ LinearAlgebra.isposdef(A::WrappedMap) = A._isposdef
2525

2626
# multiplication with vector
2727
A_mul_B!(y::AbstractVector, A::WrappedMap, x::AbstractVector) = A_mul_B!(y, A.lmap, x)
28-
*(A::WrappedMap, x::AbstractVector) = *(A.lmap, x)
28+
Base.:(*)(A::WrappedMap, x::AbstractVector) = *(A.lmap, x)
2929

3030
At_mul_B!(y::AbstractVector, A::WrappedMap, x::AbstractVector) =
3131
(issymmetric(A) || (isreal(A) && ishermitian(A))) ? A_mul_B!(y, A.lmap, x) : At_mul_B!(y, A.lmap, x)

0 commit comments

Comments
 (0)