|
1 | | -function analys(cfg::SHTnsCfg, v::Matrix{Float64}) |
| 1 | +function analys(cfg::SHTnsCfg{Real,T,N}, v::Array{Float64}) where {T,N} |
2 | 2 | @assert cfg.nlat != 0 |
3 | | - qlm = Vector{ComplexF64}(undef, cfg.nlm) |
| 3 | + qlm = Vector{ComplexF64}(undef, cfg.nlm*cfg.howmany) |
4 | 4 | analys!(cfg, copy(v), qlm) |
5 | 5 | return qlm |
6 | 6 | end |
7 | 7 |
|
8 | | -function analys(cfg::SHTnsCfg, v::Matrix{ComplexF64}) |
| 8 | +function analys(cfg::SHTnsCfg{Complex,T,N}, v::Array{ComplexF64}) where {T,N} |
9 | 9 | @assert cfg.nlat != 0 |
10 | | - qlm = Vector{ComplexF64}(undef, cfg.nlm_cplx) |
| 10 | + qlm = Vector{ComplexF64}(undef, cfg.nlm_cplx*cfg.howmany) |
11 | 11 | analys!(cfg, copy(v), qlm) |
12 | 12 | return qlm |
13 | 13 | end |
14 | 14 |
|
15 | | -function analys(cfg::SHTnsCfg, utheta::Matrix{Float64}, uphi::Matrix{Float64}) |
| 15 | +function analys(cfg::SHTnsCfg{Real,T,N}, utheta::Array{Float64}, uphi::Array{Float64}) where {T,N} |
16 | 16 | @assert cfg.nlat != 0 |
17 | | - slm = Vector{ComplexF64}(undef, cfg.nlm) |
18 | | - tlm = Vector{ComplexF64}(undef, cfg.nlm) |
| 17 | + slm = Vector{ComplexF64}(undef, cfg.nlm*cfg.howmany) |
| 18 | + tlm = Vector{ComplexF64}(undef, cfg.nlm*cfg.howmany) |
19 | 19 | analys!(cfg, copy(utheta), copy(uphi), slm, tlm) |
20 | 20 | return slm, tlm |
21 | 21 | end |
22 | 22 |
|
23 | | -function analys(cfg::SHTnsCfg, utheta::Matrix{ComplexF64}, uphi::Matrix{ComplexF64}) |
| 23 | +function analys(cfg::SHTnsCfg{Complex,T,N}, utheta::Array{ComplexF64}, uphi::Array{ComplexF64}) where {T,N} |
24 | 24 | @assert cfg.nlat != 0 |
25 | | - slm = Vector{ComplexF64}(undef, cfg.nlm_cplx) |
26 | | - tlm = Vector{ComplexF64}(undef, cfg.nlm_cplx) |
| 25 | + slm = Vector{ComplexF64}(undef, cfg.nlm_cplx*cfg.howmany) |
| 26 | + tlm = Vector{ComplexF64}(undef, cfg.nlm_cplx*cfg.howmany) |
27 | 27 | analys!(cfg, copy(utheta), copy(uphi), slm, tlm) |
28 | 28 | return slm, tlm |
29 | 29 | end |
30 | 30 |
|
31 | | -function analys(cfg::SHTnsCfg, ur::Matrix{Float64}, utheta::Matrix{Float64}, uphi::Matrix{Float64}) |
| 31 | +function analys(cfg::SHTnsCfg{Real,T,N}, ur::Array{Float64}, utheta::Array{Float64}, uphi::Array{Float64}) where {T,N} |
32 | 32 | @assert cfg.nlat != 0 |
33 | | - qlm = Vector{ComplexF64}(undef, cfg.nlm) |
34 | | - slm = Vector{ComplexF64}(undef, cfg.nlm) |
35 | | - tlm = Vector{ComplexF64}(undef, cfg.nlm) |
| 33 | + qlm = Vector{ComplexF64}(undef, cfg.nlm*cfg.howmany) |
| 34 | + slm = Vector{ComplexF64}(undef, cfg.nlm*cfg.howmany) |
| 35 | + tlm = Vector{ComplexF64}(undef, cfg.nlm*cfg.howmany) |
36 | 36 | analys!(cfg, copy(ur), copy(utheta), copy(uphi), qlm, slm, tlm) |
37 | 37 | return qlm, slm, tlm |
38 | 38 | end |
39 | 39 |
|
40 | | -function analys(cfg::SHTnsCfg, ur::Matrix{ComplexF64}, utheta::Matrix{ComplexF64}, uphi::Matrix{ComplexF64}) |
| 40 | +function analys(cfg::SHTnsCfg{Complex,T,N}, ur::Array{ComplexF64}, utheta::Array{ComplexF64}, uphi::Array{ComplexF64}) where {T,N} |
41 | 41 | @assert cfg.nlat != 0 |
42 | | - qlm = Vector{ComplexF64}(undef, cfg.nlm_cplx) |
43 | | - slm = Vector{ComplexF64}(undef, cfg.nlm_cplx) |
44 | | - tlm = Vector{ComplexF64}(undef, cfg.nlm_cplx) |
| 42 | + qlm = Vector{ComplexF64}(undef, cfg.nlm_cplx*cfg.howmany) |
| 43 | + slm = Vector{ComplexF64}(undef, cfg.nlm_cplx*cfg.howmany) |
| 44 | + tlm = Vector{ComplexF64}(undef, cfg.nlm_cplx*cfg.howmany) |
45 | 45 | analys!(cfg, copy(ur), copy(utheta), copy(uphi), qlm, slm, tlm) |
46 | 46 | return qlm, slm, tlm |
47 | 47 | end |
48 | 48 |
|
49 | | -function analys!(cfg::SHTnsCfg, v::AbstractMatrix{Float64}, qlm) |
| 49 | +function analys!(cfg::SHTnsCfg{Real,T,N}, v::Array{Float64}, qlm) where {T,N} |
50 | 50 | return spat_to_SH(cfg.cfg, v, qlm) |
51 | 51 | end |
52 | 52 |
|
53 | | -function analys!(cfg::SHTnsCfg, v::AbstractMatrix{ComplexF64}, qlm) |
| 53 | +function analys!(cfg::SHTnsCfg{Complex,T,N}, v::Array{ComplexF64}, qlm) where {T,N} |
54 | 54 | return spat_cplx_to_SH(cfg.cfg, v, qlm) |
55 | 55 | end |
56 | 56 |
|
57 | | -function analys!(cfg::SHTnsCfg, utheta::T, uphi::T, slm, tlm) where {T<:AbstractMatrix{Float64}} |
| 57 | +function analys!(cfg::SHTnsCfg{Real,T,N}, utheta::Tv, uphi::Tv, slm, tlm) where {T,N,Tv<:Array{Float64}} |
58 | 58 | return spat_to_SHsphtor(cfg.cfg, utheta, uphi, slm, tlm) |
59 | 59 | end |
60 | 60 |
|
61 | | -function analys!(cfg::SHTnsCfg, utheta::T, uphi::T, slm, tlm) where {T<:AbstractMatrix{ComplexF64}} |
| 61 | +function analys!(cfg::SHTnsCfg{Complex,T,N}, utheta::Tv, uphi::Tv, slm, tlm) where {T,N,Tv<:Array{ComplexF64}} |
62 | 62 | return spat_cplx_to_SHsphtor(cfg.cfg, utheta, uphi, slm, tlm) |
63 | 63 | end |
64 | 64 |
|
65 | | -function analys!(cfg::SHTnsCfg, ur::T, utheta::T, uphi::T, qlm, slm, tlm) where {T<:AbstractMatrix{Float64}} |
| 65 | +function analys!(cfg::SHTnsCfg{Real,T,N}, ur::Tv, utheta::Tv, uphi::Tv, qlm, slm, tlm) where {T,N,Tv<:Array{Float64}} |
66 | 66 | return spat_to_SHqst(cfg.cfg, ur, utheta, uphi, qlm, slm, tlm) |
67 | 67 | end |
68 | 68 |
|
69 | | -function analys!(cfg::SHTnsCfg, ur::T, utheta::T, uphi::T, qlm, slm, tlm) where {T<:AbstractMatrix{ComplexF64}} |
| 69 | +function analys!(cfg::SHTnsCfg{Complex,T,N}, ur::Tv, utheta::Tv, uphi::Tv, qlm, slm, tlm) where {T,N,Tv<:Array{ComplexF64}} |
70 | 70 | return spat_cplx_to_SHqst(cfg.cfg, ur, utheta, uphi, qlm, slm, tlm) |
71 | 71 | end |
72 | 72 |
|
|
0 commit comments