Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions examples/rectangle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,20 @@ C = Pl * F # coefficient 3-array in tensor basis


c = DiagTrav(C) # arrange by total degree
# ret = 0.0
# for n=0:N-1, k=0:n, j=0:n-k
# ret += c[Block(n+1)[k+1]] * P[0.1,n-k-j + 1] * P[0.2,k + 1] * P[0.3,j + 1]
# end
# @test ret ≈ f(0.1,0.2)

function check_DiagTrav3D(c,P)
ret = 0.0
for n=1:N
iter=1
for i=reverse(1:n)
k=0
for j=reverse(1:(n-i+1))
k+=1
ret += c[Block(n)[iter]] * P[0.1,i] * P[0.2,j] * P[0.3,k]
iter+=1
end
end
end
ret
end
@test check_DiagTrav3D(c,P) ≈ f(0.1,0.2,0.3)