Skip to content

Commit d00cf55

Browse files
committed
Codecov for Lm
1 parent 75447a0 commit d00cf55

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/lm-aa.jl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,13 @@ LMcat{T} = Union{LinearMapAA{T}, LinearMap{T}, UniformScaling{T}} # settle
136136

137137
# convert to something suitable for LinearMap.*cat
138138
function lm_promote(A::LMcat)
139+
# @show typeof(A)
139140
A isa LinearMapAA ? A._lmap :
140-
# A isa AbstractMatrix ? LinearMap(A) :
141141
A isa UniformScaling ? A : # leave unchanged - ok for LinearMaps.*cat
142-
# A isa LinearMap ?
143142
A # otherwise it is this
143+
# throw("bug") # should only be only of LMcat types
144+
# A isa AbstractMatrix ? LinearMap(A) :
145+
# A isa LinearMap ?
144146
end
145147

146148
# single-letter codes for cat objects, e.g., [A I A] becomes "AIA"
@@ -504,8 +506,9 @@ end
504506
test hcat vcat hvcat
505507
"""
506508
function LinearMapAA_test_cat(A::LinearMapAA)
507-
# L = LinearMap(x -> A*x, y -> A'*y, size(A,1), size(A,2))
509+
Lm = LinearMap{eltype(A)}(x -> A*x, y -> A'*y, size(A,1), size(A,2))
508510
M = Matrix(A)
511+
# B0 = [M Lm] # fails! todo: bug in LinearMaps ??
509512

510513
#=
511514
# cannot get cat with AbstractMatrix to work
@@ -541,11 +544,17 @@ function LinearMapAA_test_cat(A::LinearMapAA)
541544
# [I I A; I A I], # unsupported
542545
[A A I; 2A 3A 4I],
543546
[A I I; 2A 3I 4I],
547+
# [A Lm], # need one LinearMap test for codecov (see below)
544548
]
545549

546550
list1 = fun0(A)
547551
list2 = fun0(M)
548552

553+
if true # need one LinearMap test for codecov
554+
push!(list1, [A Lm])
555+
push!(list2, [M M]) # trick because [M Lm] fails
556+
end
557+
549558
for ii in 1:length(list1)
550559
b1 = list1[ii]
551560
b2 = list2[ii]

0 commit comments

Comments
 (0)