Open BSnelling opened 3 years ago
I think this can be solved by adding a method to AxisArrays to delegate this to *(::Adjoint{Vector}, ::Vector)
, e.g.
function Base.:*(a::AxisArray{T,2,<:Adjoint{T,<:AbstractVector{T}}}, b::AbstractVector{T}) where {T}
return *(parent(a), b)
end
we probably need all the same methods as NamedDims has for this https://github.com/invenia/NamedDims.jl/blob/24b9839091ec4b6091e38c19c9f36e111ca4fbad/src/functions_math.jl#L38-L55
Minimal example (using AxisArrays 0.4.3 and julia 1.5):
The expected return of the following operation would be a scalar.
But as shown the operation using
AxisArray
returns anArray
. Looking into the methods involved in these operations:The method called by the multiplication of
v_ax'
andy
is:which shows why the return is an
Array
. A new method might be needed here so thatv_ax' * y
returns the expected scalar.