JuliaApproximation / JuliaApproximation/FastTransforms.jl

Have `paduapts` return the data as the transpose of the current format?

Open
#12 8 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Julia
Stars
281
Forks
27
PR merge metrics
No merged PRs in 30d

Description

Right now paduapts(n) returns an N x 2 matrix. I'm proposing that it instead return a 2 x N matrix. The reason is that this allows for a no-op conversion to a Vector{Vec{2,Float64}}: the current code works

pts=paduapts(10)
ptr=reinterpret(Ptr{Vec{2,Float64}},pointer(pts'))  # reinterpret the memory of pts'
unsafe_wrap(Vector{Vec{2,Float64}},
            ptr,
            size(pts,1),true)  

With the proposed change, the pts' would become pts and no new memory would need to be allocated.

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 at the paduapts(n) implementation and inspect callers that rely on its current N×2 shape. Confirm that the proposed 2×N return shape preserves the point data and update any affected expectations or tests; done means paduapts returns the new format without unnecessary allocation.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
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.