JuliaArrays / JuliaArrays/StaticArrays.jl

hermitianpart(A) converts SMatrix to Matrix

Open
#1,314 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

julia> A = SA[1 2; 3 4]
2×2 SMatrix{2, 2, Int64, 4} with indices SOneTo(2)×SOneTo(2):
 1  2
 3  4

julia> hermitianpart(A)
2×2 Hermitian{Float64, Matrix{Float64}}:
 1.0  2.5
 2.5  4.0

The problem is that the LinearAlgebra implementation calls copy_similar.

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 LinearAlgebra implementation in src/symmetric.jl around line 1001, focusing on its copy_similar call and how StaticArrays.jl integrates with it. Reproduce the hermitianpart(SMatrix) example, then verify that the result no longer converts the static matrix to a regular Matrix.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.