JuliaArrays / JuliaArrays/StaticArrays.jl
question about outer constructors
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 844
- Forks
- 159
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 3
Description
in above I see the use of generated function for outer constructors.
what is the difference (and disadvantage) using the following instead?
SArray{S, T, N}(x::Tuple) where {S<:Tuple, T, N} = SArray{S, T, N, tuple_prod(S) }(x)
why don't we define the following?
@inline SDiagonal{N,T}(a::Tuple) where {N,T} = Diagonal(SVector{N,T}(a))
thanks.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read src/SArray.jl around line 32 and src/SDiagonal.jl around line 11, then trace the referenced constructor definitions and their tests or call sites. Compare the generated and proposed outer constructors and determine whether the SDiagonal alternative preserves the intended API and behavior; done means documenting the differences and any disadvantages clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100