@@ -22,24 +22,6 @@
Loading
22 22
    return obj.data[k-obj.k0[m,n]+1,m,n]
23 23
end
24 24
25 -
#
26 -
# function convolve!(y, Z::ConvOp, x, j, k_start, k_stop=size(Z,3))
27 -
#     for m in axes(y,1)
28 -
#         for n in axes(x,1)
29 -
#             k0 = Z.k0[m,n]
30 -
#             k1 = Z.k1[m,n]
31 -
#             for k in max(k0,k_start):min(k1,k_stop)
32 -
#                 p = k - k0 + 1
33 -
#                 j-k < 0 && continue
34 -
#                 y[m] += Z.data[p,m,n] * x[n,j-k+1]
35 -
#             end
36 -
#
37 -
#             X = sum(x[n,1:j-k1])
38 -
#             y[m] += Z.tail[m,n] * X
39 -
#         end
40 -
#     end
41 -
# end
42 -
43 25
44 26
function convolve!(y, Z::ConvOp, x, X, j, k_start, k_stop=size(Z,3))
45 27
    # @info "The corrrect convolve!"
@@ -60,11 +42,6 @@
Loading
60 42
end
61 43
62 44
63 -
# function convolve(Z::ConvOp, x, j, k_start)
64 -
#     y = zeros(eltype(Z), size(Z)[1])
65 -
#     convolve!(y, Z, x, j, k_start, size(Z)[3])
66 -
#     return y
67 -
# end
68 45
function polyeig(Z::ConvOp)
69 46
    kmax = maximum(Z.k1)
70 47
    M = size(Z,1)
@@ -79,4 +56,37 @@
Loading
79 56
    Q[1:M,M+1:2M,kmax+1] .= Z[:,:,kmax+1]
80 57
    return eigvals(companion(Q)), Q
81 58
    # return Q
82 -
end

@@ -45,3 +45,11 @@
Loading
45 45
        polarization = f.polarization,
46 46
        speedoflight = f.speedoflight)
47 47
end
48 +
49 +
function differentiate(f::BEAST.PlaneWaveMWTD)
50 +
    planewave(
51 +
        signature = derive(f.amplitude),
52 +
        direction = f.direction,
53 +
        polarization = f.polarisation,
54 +
        speedoflight = f.speedoflight)
55 +
end

@@ -90,7 +90,7 @@
Loading
90 90
	Nt = numfunctions(temporalbasis(basisST))
91 91
92 92
	tbf = convolve(temporalbasis(testST), temporalbasis(basisST))
93 -
	has_tail = all(tbf.polys[end].data .== 0)
93 +
	has_tail = !all(tbf.polys[end].data .== 0)
94 94
95 95
    M = numfunctions(tfs)
96 96
    N = numfunctions(bfs)
@@ -112,8 +112,10 @@
Loading
112 112
113 113
	bandwidth = maximum(K1 .- K0 .+ 1)
114 114
	data = zeros(T, bandwidth, M, N)
115 -
	tail = zeros(T, M, N)
116 -
	Z = ConvOp(data, K0, K1, tail, Nt)
115 +
    tail = zeros(T, M, N)
116 +
    # kmax = maximum(K1)
117 +
    len = has_tail ? Nt : maximum(K1)
118 +
	Z = ConvOp(data, K0, K1, tail, len)
117 119
118 120
    function store1(v,m,n,k)
119 121
		if Z.k0[m,n] ≤ k ≤ Z.k1[m,n]

@@ -32,6 +32,12 @@
Loading
32 32
    W
33 33
end
34 34
35 +
function derive(a::LinearCombinationOfOperators)
36 +
    coeffs = copy(a.coeffs)
37 +
    ops = [derive(op) for op in a.ops]
38 +
    return LinearCombinationOfOperators(coeffs, ops)
39 +
end
40 +
35 41
36 42
function +(a::LinearCombinationOfOperators, b::Operator)
37 43
    LinearCombinationOfOperators(

@@ -213,7 +213,7 @@
Loading
213 213
    operator
214 214
end
215 215
216 -
derive(op::Operator) = TemporalDifferentiation(op)
216 +
derive(op::AbstractOperator) = TemporalDifferentiation(op)
217 217
scalartype(op::TemporalDifferentiation) = scalartype(op.operator)
218 218
Base.:*(a::Number, op::TemporalDifferentiation) = TemporalDifferentiation(a * op.operator)
219 219
@@ -236,6 +236,7 @@
Loading
236 236
end
237 237
238 238
integrate(op::AbstractOperator) = TemporalIntegration(op)
239 +
derive(op::TemporalIntegration) = op.operator
239 240
scalartype(op::TemporalIntegration) = scalartype(op.operator)
240 241
Base.:*(a::Number, op::TemporalIntegration) = TemporalIntegration(a * op.operator)
241 242

@@ -77,3 +77,52 @@
Loading
77 77
end
78 78
79 79
convolve(x::MatrixConvolution, y::Matrix, i, j) = convolve(x.arr, y, i, j)
80 +
81 +
82 +
function Base.hvcat((M,N)::Tuple{Int,Int}, as::MatrixConvolution...)
83 +
    kmax = maximum(size(a,3) for a in as)
84 +
85 +
    @assert length(as) == M*N
86 +
87 +
    li = LinearIndices((1:M,1:N))
88 +
    for m in 1:M
89 +
        a = as[li[m,1]]
90 +
        M1 = size(a,1)
91 +
        for n in 2:N
92 +
            a = as[li[m,n]]
93 +
            @assert size(a,1) == M1
94 +
        end
95 +
    end
96 +
97 +
    for n in 1:N
98 +
        a = as[li[1,n]]
99 +
        N1 = size(a,2)
100 +
        for m in 2:M
101 +
            a = as[li[m,n]]
102 +
            @assert size(a,2) == N1
103 +
        end
104 +
    end
105 +
106 +
    Ms = [size(as[li[i,1]],1) for i in 1:M]
107 +
    Ns = [size(as[li[1,j]],2) for j in 1:N]
108 +
109 +
    cMs = pushfirst!(cumsum(Ms),0)
110 +
    cNs = pushfirst!(cumsum(Ns),0)
111 +
    T = promote_type(eltype.(as)...)
112 +
    data = zeros(T, last(cMs), last(cNs), kmax)
113 +
114 +
    @show size(data)
115 +
    @show eltype(data)
116 +
117 +
    for m in 1:M
118 +
        I = cMs[m]+1 : cMs[m+1]
119 +
        for n in 1:N
120 +
            J = cNs[n]+1 : cNs[n+1]
121 +
            a = as[li[m,n]]
122 +
            K = 1:size(a,3)
123 +
            data[I,J,K] .= a
124 +
        end
125 +
    end
126 +
127 +
    return MatrixConvolution(data)
128 +
end
Files Coverage
src 55.95%
Project Totals (81 files) 55.95%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading