JuliaArrays / AxisArrays.jl

Performant arrays where each dimension can have a named axis with values
http://JuliaArrays.github.io/AxisArrays.jl/latest/
Other
200 stars 41 forks source link

Matrix division? #188

Open bramtayl opened 4 years ago

bramtayl commented 4 years ago

I tried this out:

import Base: \
function \(x::AxisArray{T1, 2}, y::AxisArray{T2, 1}) where {T1, T2}
    x_rows = x.axes[1]
    y_rows = y.axes[1]
    if x_rows == y_rows
        AxisArray(x.data \ y.data, x.axes[2])
    else
        DimensionMismatch("Axes $x_rows and $y_rows don't match")
    end
end

And it seemed to work. I could make a pull request if it seems like a reasonable method?