@@ -139,41 +139,20 @@ function InterlaceOperator(ops::VectorOrTupleOfOp, ds::Space, rs::Space)
139
139
(l,u))
140
140
end
141
141
142
- function InterlaceOperator (opsin:: AbstractMatrix{<:Operator} )
142
+ interlace_domainspace (ops:: AbstractMatrix , :: Type{NoSpace} ) = domainspace (ops)
143
+ interlace_domainspace (ops:: AbstractMatrix , :: Type{DS} ) where {DS} = DS (components (domainspace (ops)))
144
+ interlace_rangespace (ops:: AbstractMatrix , :: Type{NoSpace} ) = rangespace (@view ops[:,1 ])
145
+ interlace_rangespace (ops:: RowVector , :: Type{NoSpace} ) = rangespace (ops[1 ])
146
+ interlace_rangespace (ops:: AbstractMatrix , :: Type{RS} ) where {RS} = RS (rangespace (@view ops[:,1 ]). spaces)
147
+ interlace_rangespace (ops:: RowVector , :: Type{RS} ) where {RS} = RS (rangespace (ops[1 ]))
148
+
149
+ function InterlaceOperator (opsin:: AbstractMatrix{<:Operator} ,
150
+ ds:: Type{DS} = NoSpace,rs:: Type{RS} = ds) where {DS<: Space ,RS<: Space }
143
151
isempty (opsin) && throw (ArgumentError (" Cannot create InterlaceOperator from empty Matrix" ))
144
152
ops= promotespaces (opsin)
145
- InterlaceOperator (ops,domainspace (ops), rangespace (ops[:, 1 ] ))
153
+ InterlaceOperator (ops, interlace_domainspace (ops, DS), interlace_rangespace (ops, RS ))
146
154
end
147
155
148
- function InterlaceOperator (opsin:: AbstractMatrix{<:Operator} ,:: Type{DS} ,:: Type{RS} ) where {DS<: Space ,RS<: Space }
149
- isempty (opsin) && throw (ArgumentError (" Cannot create InterlaceOperator from empty Matrix" ))
150
- ops= promotespaces (opsin)
151
- InterlaceOperator (ops,DS (components (domainspace (ops))),RS (rangespace (@view ops[:,1 ]). spaces))
152
- end
153
-
154
-
155
- function InterlaceOperator (opsin:: RowVector{<:Operator} )
156
- isempty (opsin) && throw (ArgumentError (" Cannot create InterlaceOperator from empty Matrix" ))
157
-
158
- ops= promotespaces (opsin)
159
- InterlaceOperator (ops,domainspace (ops),rangespace (ops[1 ]))
160
- end
161
-
162
- function InterlaceOperator (opsin:: RowVector{<:Operator} ,:: Type{DS} ,:: Type{RS} ) where {DS<: Space ,RS<: Space }
163
- isempty (opsin) && throw (ArgumentError (" Cannot create InterlaceOperator from empty Matrix" ))
164
- ops= promotespaces (opsin)
165
- InterlaceOperator (ops,DS (components (domainspace (ops))),rangespace (ops[1 ]))
166
- end
167
-
168
-
169
-
170
-
171
- InterlaceOperator (opsin:: AbstractMatrix{<:Operator} ,:: Type{DS} ) where {DS<: Space } =
172
- InterlaceOperator (opsin,DS,DS)
173
-
174
- InterlaceOperator (opsin:: AbstractMatrix ,S... ) =
175
- InterlaceOperator (Matrix {Operator{promote_eltypeof(opsin)}} (promotespaces (opsin)),S... )
176
-
177
156
function InterlaceOperator (opsin:: AbstractVector{<:Operator} )
178
157
ops = convert_vector (promotedomainspace (opsin))
179
158
InterlaceOperator (ops, domainspace (first (ops)), rangespace (ops))
192
171
end
193
172
end
194
173
195
- InterlaceOperator (ops:: AbstractArray ) =
196
- InterlaceOperator (Array {Operator{promote_eltypeof(ops)}, ndims(ops)} (ops))
174
+ InterlaceOperator (ops:: AbstractArray , ds = NoSpace, rs = ds ) =
175
+ InterlaceOperator (Array {Operator{promote_eltypeof(ops)}, ndims(ops)} (ops), ds, rs )
197
176
198
177
199
178
function convert (:: Type{Operator{T}} ,S:: InterlaceOperator ) where T
0 commit comments