Skip to content

Commit 35ff68e

Browse files
committed
Fix scaling factors when computing coefficients for ChebHash.
1 parent 9590d8c commit 35ff68e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/function_hashing/chebhash.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ function cheb_coefficients(f, N)
4949
x = cos.(range(0, π, length=N))
5050
fx = f.(x)
5151

52-
dct(fx) * (1/(2N))
52+
dct(fx) * (1/N)
5353
end
5454

5555
function get_cheb_coefficients(interval::RealInterval, f; n_coeffs::Integer=1024)
5656
f_ = squash_function(interval, f)
5757
coeff = cheb_coefficients(f_, n_coeffs)
58-
coeff .* width(interval)
58+
coeff .* width(interval)
5959
end
6060

6161
# Transform a function f ∈ L^2([a,b]) so that the coefficients of its Chebyshev

0 commit comments

Comments
 (0)