`cheb2leg(::Matrix)` should do tensor product Cheb -> tensor product Leg
还没有人认领这个 Issue。
评估
调研方向
首先定位 cheb2leg(::Matrix) 和 chebyshevtransform(::Matrix) 入口点。将当前按列处理的行为与 issue 中展示的 cheb2leg2d workaround 进行比较,然后为张量积 Chebyshev 输入添加覆盖。完成的标准是矩阵转换会在两个维度上应用,并生成预期的张量积 Legendre 系数。
由索引模型根据 Issue 内容生成。
描述
Note that chebyshevtransform(::Matrix) is a 2D transform:
julia> using FastTransforms, ClassicalOrthogonalPolynomials
julia> n,m = 3,4; f = (x,y) -> chebyshevt(n, x)chebyshevt(m,y)
#13 (generic function with 1 method)
julia> x = ChebyshevGrid{1}(10);
julia> chebyshevtransform(f.(x', x))
10×10 Matrix{Float64}:
0.0 1.79736e-18 0.0 1.62102e-17 0.0 9.42055e-18 0.0 1.70874e-18 0.0 -9.27717e-18
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 1.11341e-18 0.0 7.41045e-17 0.0 -4.09803e-19 0.0 1.07597e-17 0.0 5.84104e-19
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 5.90641e-17 0.0 1.0 0.0 1.50729e-16 0.0 2.84217e-16 0.0 8.12948e-17
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 -2.19853e-17 0.0 3.47114e-16 0.0 -1.88411e-17 0.0 -1.22156e-17 0.0 -1.4348e-17
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 6.63185e-18 0.0 2.18604e-16 0.0 1.14231e-17 0.0 -4.61608e-19 0.0 5.85226e-18
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
On the other hand, the following applies 1D transform to each column:
julia> n,m = 3,4; f = (x,y) -> legendrep(n, x)legendrep(m,y)
#15 (generic function with 1 method)
julia> cheb2leg(chebyshevtransform(f.(x', x)))
10×10 Matrix{Float64}:
0.0 1.83296e-17 0.0 6.46249e-17 0.0 7.18753e-18 0.0 1.30004e-18 0.0 -1.21711e-18
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 1.19456e-17 0.0 -8.58383e-17 0.0 9.06258e-19 0.0 2.95814e-17 0.0 4.36288e-19
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.375 0.0 0.625 0.0 6.39255e-17 0.0 1.35064e-16 0.0 1.36998e-16
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 5.4873e-17 0.0 1.12785e-16 0.0 -4.54724e-17 0.0 -1.78334e-17 0.0 -1.84471e-17
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 1.45648e-16 0.0 2.70896e-16 0.0 7.99515e-18 0.0 9.33654e-18 0.0 3.97946e-18
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
The following gives a quick work-around that I think should be the default behaviour:
julia> function cheb2leg2d(A::AbstractMatrix)
B = cheb2leg(A); cheb2leg(B')'
end
cheb2leg2d (generic function with 1 method)
julia> cheb2leg2d(chebyshevtransform(f.(x',x)))
10×10 adjoint(::Matrix{Float64}) with eltype Float64:
0.0 -2.15114e-17 0.0 9.6853e-17 0.0 1.35234e-17 0.0 4.64116e-18 0.0 -3.28115e-18
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 6.13301e-17 0.0 -1.44889e-16 0.0 -3.0644e-17 0.0 7.0058e-17 0.0 1.17616e-18
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 -2.34741e-17 0.0 1.0 0.0 -5.64224e-17 0.0 1.4927e-16 0.0 3.69325e-16
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 -4.39458e-18 0.0 2.26976e-16 0.0 -6.76889e-17 0.0 -1.92562e-17 0.0 -4.97304e-17
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 -1.88093e-17 0.0 4.23769e-16 0.0 4.91028e-18 0.0 1.72571e-17 0.0 1.0728e-17
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
- 主要语言
- Julia
- 星标
- 282
- 派生
- 27
- 平均合并
- 53 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
JuliaApproximation/FastTransforms.jl 的其他 Issue
-
Loading FastTransforms.jl can make FFTs via FFTW.jl 100x slower due to threading conflicts可能已有人在做 @dlfivefifty 于 90 天前认领。 未关闭
JuliaApproximation/FastTransforms.jl#267 · 2 个 reaction · 已指派 2 人 ·
-
难度 3/5 1-2 天 新手友好度 38/100
JuliaApproximation/FastTransforms.jl#266 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 42/100
JuliaApproximation/FastTransforms.jl#263 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
JuliaApproximation/FastTransforms.jl#257 · 1 条评论 ·
-
Allocating lmul!未关闭
难度 4/5 3-5 天 新手友好度 25/100
JuliaApproximation/FastTransforms.jl#253 · 7 条评论 ·
查看 JuliaApproximation/FastTransforms.jl 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
SciML/DiffEqNoiseProcess.jl#342 ·
-
难度 1/5 1 小时以内 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 72/100
oxfordcontrol/COSMO.jl#211 ·
-
documentation
难度 2/5 半天 新手友好度 65/100
维护者通常 6 天内回复
-
Out-of-place JLArray/GPU problem with VectorContinuousCallback scalar-indexes (callback cache built with CPU zeros)可能已有人在做 @ChrisRackauckas-Claude 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
SciML/OrdinaryDiffEq.jl#4813 ·
维护者通常 1 天内回复