@@ -2,15 +2,16 @@ import LinearAlgebra: LU, checknonsingular
2
2
3
3
export QuotientSpace
4
4
5
- struct QuotientSpace{S,O,D,R} <: Space{D,R}
5
+ struct QuotientSpace{S,O,D,R,LUT <: LU{R} } <: Space{D,R}
6
6
space:: S
7
7
bcs:: O
8
- F:: LU{R,Matrix{R}}
8
+ F:: LUT
9
9
x:: Vector{R}
10
10
function QuotientSpace {S,O,D,R} (space:: S , bcs:: O ) where {S,O,D,R}
11
11
n = size (bcs, 1 )
12
12
@assert isfinite (n)
13
- new {S,O,D,R} (space, bcs, lu! (Matrix {R} (I, n, n)), zeros (R, n))
13
+ F = lu! (Matrix {R} (I, n, n))
14
+ new {S,O,D,R,typeof(F)} (space, bcs, F, zeros (R, n))
14
15
end
15
16
end
16
17
@@ -27,15 +28,16 @@ hasconversion(a::QuotientSpace,b::QuotientSpace) = hasconversion(a.space,b)
27
28
28
29
29
30
Conversion (Q:: QuotientSpace{S} , sp:: S ) where S<: Space = ConcreteConversion (Q, sp)
30
- @inline bandwidths (C:: ConcreteConversion{QuotientSpace{S,O,D,R },S} ) where {S,O,D,R } = (size (C. domainspace. F, 1 ), 0 )
31
+ @inline bandwidths (C:: ConcreteConversion{<: QuotientSpace{S},S} ) where {S} = (size (C. domainspace. F, 1 ), 0 )
31
32
32
- function getindex (C:: ConcreteConversion{QuotientSpace{S,O,D,R },S} , i:: Integer , j:: Integer ) where {S,O,D,R }
33
+ function getindex (C:: ConcreteConversion{<: QuotientSpace{S},S} , i:: Integer , j:: Integer ) where {S}
33
34
sp = domainspace (C)
34
35
B = sp. bcs
35
36
F = sp. F
36
37
A = F. factors
37
38
n = size (A, 1 )
38
39
x = sp. x
40
+ R = rangetype (sp)
39
41
if i == j
40
42
return one (R)
41
43
elseif j < i ≤ j+ n
@@ -262,7 +264,7 @@ for (gesdd, elty, relty) in ((:dgesdd_,:Float64,:Float64),
262
264
end
263
265
264
266
265
- function BandedMatrix (S:: SubOperator{T,ConcreteConversion{QuotientSpace{SP,O,D,R },SP,T},NTuple{2,UnitRange{Int}}} ) where {SP,O,D,R ,T}
267
+ function BandedMatrix (S:: SubOperator{T,<: ConcreteConversion{<: QuotientSpace{SP},SP,T},NTuple{2,UnitRange{Int}}} ) where {SP,T}
266
268
kr,jr = parentindices (S)
267
269
C = parent (S)
268
270
# ret = BandedMatrix{eltype(S)}(undef, size(S), bandwidths(S))
@@ -275,6 +277,7 @@ function BandedMatrix(S::SubOperator{T,ConcreteConversion{QuotientSpace{SP,O,D,R
275
277
n = size (A, 1 )
276
278
B = sp. bcs[1 : n,1 : last (jr)+ n]
277
279
x = sp. x
280
+ R = rangetype (sp)
278
281
@inbounds for j in 1 : last (jr)
279
282
kk = colrange (ret, j)
280
283
if j in kk
0 commit comments