JuliaArrays / JuliaArrays/StaticArrays.jl

Addition shape check does not match base

Open
#125 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Julia
Stars
844
Forks
159
Avg merge
3d 21h
Merged PRs (30d)
3

Description

julia> a = randn(2,2);

julia> a[[1,2],[1]] + a[[1,2],1]
2-element Array{Float64,1}:
 -0.48713
  1.05429

julia> a[(@SVector [1,2]),(@SVector [1])] + a[(@SVector [1,2]),1]
ERROR: DimensionMismatch("Dimensions must match. Got inputs with Size(2, 1) and Size(2,).")
Stacktrace:
 [1] +(::StaticArrays.SMatrix{2,1,Float64,2}, ::StaticArrays.SVector{2,Float64}) at /home/ubuntu/.julia/v0.6/StaticArrays/src/linalg.jl:10

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

Reproduce the examples in the issue with Julia and compare the regular Array result with the StaticArrays result. Start at StaticArrays/src/linalg.jl:10, then identify how the two indexed arrays' shapes are checked; done means addition follows the base Array behavior for these inputs and the regression is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.