FillArrays.jl icon indicating copy to clipboard operation
FillArrays.jl copied to clipboard

Add hcat, vcat, and cat methods

Open lstagner opened this issue 7 years ago • 1 comments

I recently had a need for these functions. I wrote a quick method (below) for my particular case, but I would be better if they were officially supported.

function Base.hcat(x::Zeros{T,2}...) where T <: Real
    all(xx -> xx.size[1] == x[1].size[1], x) || throw(ArgumentError("mismatch in dimension 1"))
    n = sum(xx.size[2] for xx in x)

    return Zeros(x[1].size[1],n)
end

lstagner avatar Jul 11 '18 00:07 lstagner

If you make a PR for this, I'll merge it.

dlfivefifty avatar Jul 24 '18 09:07 dlfivefifty