Skip to content

Add hcat, vcat, and cat methods #23

Open
@lstagner

Description

@lstagner

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

Activity

dlfivefifty

dlfivefifty commented on Jul 24, 2018

@dlfivefifty
Member

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

linked a pull request that will close this issue on Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @dlfivefifty@lstagner

      Issue actions

        Add hcat, vcat, and cat methods · Issue #23 · JuliaArrays/FillArrays.jl