diff --git a/src/FillArrays.jl b/src/FillArrays.jl index 7ca7b78e..1a8cd734 100644 --- a/src/FillArrays.jl +++ b/src/FillArrays.jl @@ -578,7 +578,6 @@ cumsum(x::AbstractZerosVector{Bool}) = x cumsum(x::AbstractOnesVector{II}) where II<:Integer = convert(AbstractVector{II}, oneto(length(x))) cumsum(x::AbstractOnesVector{Bool}) = oneto(length(x)) - ######### # Diff ######### diff --git a/src/fillalgebra.jl b/src/fillalgebra.jl index 99fda41c..06436d74 100644 --- a/src/fillalgebra.jl +++ b/src/fillalgebra.jl @@ -5,7 +5,6 @@ vec(a::AbstractFill) = fillsimilar(a, length(a)) ## Transpose/Adjoint # cannot do this for vectors since that would destroy scalar dot product - transpose(a::Union{AbstractOnesMatrix, AbstractZerosMatrix}) = fillsimilar(a, reverse(axes(a))) adjoint(a::Union{AbstractOnesMatrix, AbstractZerosMatrix}) = fillsimilar(a, reverse(axes(a))) transpose(a::FillMatrix{T}) where T = Fill{T}(transpose(a.value), reverse(a.axes)) @@ -30,6 +29,9 @@ end reverse(A::AbstractFill; dims=:) = A ## Algebraic identities +@inline checkdimensionmismatch(a::AbstractVecOrMat, b::AbstractVecOrMat) = axes(a, 2) ≠ axes(b, 1) && throw(DimensionMismatch("A has axes $(axes(a)) but B has axes $(axes(b))")) +@inline productaxes(a::AbstractVecOrMat, b::AbstractVector) = (axes(a, 1),) +@inline productaxes(a::AbstractVecOrMat, b::AbstractMatrix) = (axes(a, 1), axes(b, 2)) # Default outputs, can overload to customize mult_fill(a, b, val, ax) = Fill(val, ax)