@@ -167,12 +167,21 @@ map(f, tvs::QuasiTransposeAbsVec...) = transpose(map((xs...) -> transpose(f(tran
167
167
# # multiplication *
168
168
169
169
# QuasiAdjoint/QuasiTranspose-vector * vector
170
+
171
+ # allow re-expansion using Legendre
172
+ _dot (ax, a, b) = Base. invoke (dot, NTuple{2 ,Any}, a, b)
173
+
174
+ function dot (a:: AbstractQuasiArray , b:: AbstractQuasiArray )
175
+ ax = axes (a,1 )
176
+ ax == axes (b,1 ) || throw (DimensionMismatch ())
177
+ _dot (ax, a, b)
178
+ end
179
+
170
180
* (u:: QuasiAdjointAbsVec , v:: AbstractQuasiVector ) = dot (u. parent, v)
171
181
* (u:: QuasiTransposeAbsVec{T} , v:: AbstractQuasiVector{T} ) where {T<: Real } = dot (u. parent, v)
172
182
function * (u:: QuasiTransposeAbsVec , v:: AbstractQuasiVector )
173
- @assert ! has_offset_axes (u, v)
174
- @boundscheck length (u) == length (v) || throw (DimensionMismatch ())
175
- return sum (@inbounds (u[k]* v[k]) for k in 1 : length (u))
183
+ @boundscheck axes (u,2 ) == axes (v,1 ) || throw (DimensionMismatch ())
184
+ return sum (@inbounds (u. parent[k]* v[k]) for k in axes (v,1 ))
176
185
end
177
186
# vector * QuasiAdjoint/QuasiTranspose-vector
178
187
* (u:: AbstractQuasiVector , v:: AdjOrTransAbsVec ) = broadcast (* , u, v)
@@ -229,4 +238,18 @@ arguments(LAY::ApplyLayout{typeof(*)}, V::QuasiTranspose) = reverse(transpose.(a
229
238
230
239
# This is used in ContinuumArrays.jl to ensure x' is lazy
231
240
BroadcastStyle (:: Type{<:QuasiAdjoint{<:Any,<:Inclusion}} ) = LazyQuasiArrayStyle {2} ()
232
- BroadcastStyle (:: Type{<:QuasiTranspose{<:Any,<:Inclusion}} ) = LazyQuasiArrayStyle {2} ()
241
+ BroadcastStyle (:: Type{<:QuasiTranspose{<:Any,<:Inclusion}} ) = LazyQuasiArrayStyle {2} ()
242
+
243
+
244
+
245
+ # ##
246
+ # adjoint concat support
247
+ # ##
248
+
249
+ arguments (:: ApplyLayout{typeof(vcat)} , A:: QuasiAdjoint ) = map (adjoint, arguments (ApplyLayout {typeof(hcat)} (), parent (A)))
250
+ arguments (:: ApplyLayout{typeof(hcat)} , A:: QuasiAdjoint ) = map (adjoint, arguments (ApplyLayout {typeof(vcat)} (), parent (A)))
251
+ arguments (:: ApplyLayout{typeof(vcat)} , A:: QuasiTranspose ) = map (transpose, arguments (ApplyLayout {typeof(hcat)} (), parent (A)))
252
+ arguments (:: ApplyLayout{typeof(hcat)} , A:: QuasiTranspose ) = map (transpose, arguments (ApplyLayout {typeof(vcat)} (), parent (A)))
253
+
254
+
255
+ copy (M:: Mul{ApplyLayout{typeof(vcat)},QuasiArrayLayout} ) = vcat ((arguments (vcat, M. A) .* Ref (M. B)). .. )
0 commit comments