JuliaArrays / JuliaArrays/StaticArrays.jl

Can a static array be repeated into a static matrix using a similar repeat function in Julia?

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

Nobody has claimed this yet.

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

Description

My input is an array, and I want to use the static array to extend it into a large matrix to reduce the calculation time. However, after using the repeat() function in Julia, it changes back to the usual dynamic matrix, and there is no similar function after checking the document, is there any way to achieve this function?

Svals = @SVector [i for i = 1:1000]
repeat(Svals,1,50)

And I have tried the following code, but it didn't work.

SMatrix{length(vals),50}(repeat(vals,1,50))

Thanks!
Luo

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 by examining the behavior of repeat(Svals, 1, 50) and the attempted SMatrix{length(vals),50}(repeat(vals,1,50)) construction for SVector input. Determine whether static repetition is intended to be supported; done would be a working static matrix result or clear documentation of the limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.