@@ -37,12 +37,13 @@ const TransposeFunctionMap = TransposeMap{<:Any, <:FunctionMap}
37
37
const AdjointFunctionMap = AdjointMap{<: Any , <: FunctionMap }
38
38
39
39
function Base.:(* )(A:: FunctionMap , x:: AbstractVector )
40
- length (x) == A . N || throw (DimensionMismatch ())
40
+ length (x) == size (A, 2 ) || throw (DimensionMismatch ())
41
41
if ismutating (A)
42
- y = similar (x, promote_type (eltype (A), eltype (x)), A . M )
42
+ y = similar (x, promote_type (eltype (A), eltype (x)), size (A, 1 ) )
43
43
A. f (y, x)
44
44
else
45
45
y = A. f (x)
46
+ length (y) == size (A, 1 ) || throw (DimensionMismatch ())
46
47
end
47
48
return y
48
49
end
@@ -56,6 +57,7 @@ function Base.:(*)(A::AdjointFunctionMap, x::AbstractVector)
56
57
Afun. fc (y, x)
57
58
else
58
59
y = Afun. fc (x)
60
+ length (y) == size (A, 1 ) || throw (DimensionMismatch ())
59
61
end
60
62
return y
61
63
elseif issymmetric (Afun) # but !isreal(A), Afun.f can be used
@@ -65,6 +67,7 @@ function Base.:(*)(A::AdjointFunctionMap, x::AbstractVector)
65
67
Afun. f (y, x)
66
68
else
67
69
y = Afun. f (x)
70
+ length (y) == size (A, 1 ) || throw (DimensionMismatch ())
68
71
end
69
72
conj! (y)
70
73
return y
@@ -85,6 +88,7 @@ function Base.:(*)(A::TransposeFunctionMap, x::AbstractVector)
85
88
Afun. fc (y, x)
86
89
else
87
90
y = Afun. fc (x)
91
+ length (y) == size (A, 1 ) || throw (DimensionMismatch ())
88
92
end
89
93
if ! isreal (A)
90
94
conj! (y)
@@ -97,6 +101,7 @@ function Base.:(*)(A::TransposeFunctionMap, x::AbstractVector)
97
101
Afun. f (y, x)
98
102
else
99
103
y = Afun. f (x)
104
+ length (y) == size (A, 1 ) || throw (DimensionMismatch ())
100
105
end
101
106
conj! (y)
102
107
return y
0 commit comments