Skip to content

Commit 2f401fa

Browse files
authored
fix space promotion in timesoperator (#457)
1 parent 0cc55e8 commit 2f401fa

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunBase"
22
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
3-
version = "0.8.18"
3+
version = "0.8.19"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/Operators/general/algebra.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,8 @@ axpy!(α, S::SubOperator{T,OP}, A::AbstractMatrix) where {T,OP<:ConstantTimesOpe
224224
function check_times(ops)
225225
for k = 1:length(ops)-1
226226
size(ops[k], 2) == size(ops[k+1], 1) || throw(ArgumentError("incompatible operator sizes"))
227-
spacescompatible(domainspace(ops[k]), rangespace(ops[k+1])) || throw(ArgumentError("incompatible spaces at index $k"))
227+
spacescompatible(domainspace(ops[k]), rangespace(ops[k+1])) ||
228+
throw(ArgumentError("incompatible spaces at index $k, received $(domainspace(ops[k])) and $(rangespace(ops[k+1]))"))
228229
end
229230
return nothing
230231
end
@@ -768,7 +769,8 @@ function promotedomainspace(P::TimesOperator, sp::Space, cursp::Space)
768769
if sp == cursp
769770
P
770771
elseif length(P.ops) == 2
771-
P.ops[1] * promotedomainspace(P.ops[end], sp)
772+
A = promotedomainspace(P.ops[end], sp)
773+
promotedomainspace(P.ops[1], rangespace(A)) * A
772774
else
773775
promotetimes([P.ops[1:end-1]; promotedomainspace(P.ops[end], sp)], sp)
774776
end

0 commit comments

Comments
 (0)