JuliaArrays / JuliaArrays/BlockArrays.jl

Examples of mortar() for nd arrays?

Open
#414 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
254
Forks
39
PR merge metrics
No merged PRs in 30d

Description

The docstring for mortar() shows

mortar(blocks::AbstractArray{R, N}, sizes_1, sizes_2, ..., sizes_N)

But I can't figure out how to use this. Here's what I expected to work:

julia> arr = [[rand(2,3,4)] [rand(2,3,4)]
              [rand(2,3,4)] [rand(2,3,4)]];

julia> typeof(arr)
Matrix{Array{Float64, 3}} (alias for Array{Array{Float64, 3}, 2})

julia> mortar(arr, [2,2], [3,3], ones(Int, 4))
ERROR: MethodError: no method matching mortar(::Matrix{Array{Float64, 3}}, ::Vector{Int64}, ::Vector{Int64}, ::Vector{Int64})

I was expecting this to produce the equivalent of

julia> BlockedArray(rand(4,6,4), [2,2], [3,3], ones(Int, 4))
2×2×4-blocked 4×6×4 BlockedArray{Float64, 3}:
# ...

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the mortar() docstring and reproduce the reported Julia REPL call using the shown arr and block sizes. Compare it with the BlockedArray(rand(4,6,4), ...) example; done means documenting the correct nd-array usage or clearly stating the supported limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.