IntegerD = ceil(FD)
FDGal = FD - IntegerD
print("FDGAL: ", FDGal)
print("\n")
hIdeal = (k) -> sinc.(k.-FDGal)
print("hIdeal: ", hIdeal)
print("\n")
hApprox = hIdeal(idxWindow)
print("hApprox: ", hApprox)
print("\n")
Sig_fd[indm,:] = filt.(hApprox,1,[zeros(1,abs(IntegerD)),Sig[1:end+IntegerD]])
I get the error: ERROR: MethodError: no method matching zeros(::Int64, ::Float64). on the last line. What am I doing wrong?
zeros
are the dimensions of the matrix, so they all need to be integers, the error message is telling you that the second argument is a float instead of an integer. The documentation for ceil
says ceil(x) returns the nearest integral value of the same type as x that is greater than or equal to x.
So unexpectedly, if you give ceil
a float it will return a float. You can fix it by casting the value to an integer, like this: IntegerD = Int(ceil(FD))
. Hopefully that was helpful!
println()
to get new lines instead of using print(x)
and print("\n")
Sig[1:end+IntegerD]
because that doesn't look right to me.
Does anyone know if it is possible to use Roots.find_zero
in a CUDA kernel? Below fails:
using CUDA
using Roots
g(x) = (x-1)^2
function kernel(a)
i = threadIdx().x
a[i] = find_zero(g, 0)
return
end
a = CuArray([1,2,3])
@cuda threads=length(a) kernel(a)
InvalidIRError: compiling kernel kernel(CuDeviceVector{Int64, 1}) resulted in invalid LLVM IR
Reason: unsupported dynamic function invocation (call to display(x) in Base.Multimedia at multimedia.jl:324)
using AlgebraicDynamics.UWDDynam
ContinuousResourceSharer
by running using AlgebraicDynamics.UWDDynam
and then running UWDDynam.ContinuousResourceSharer
. If you don't want to specify UWDDynam
each time you can run const ContinuousResourceSharer = UWDDynam.ContinuousResourceSharer