Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mismatch between input datatype and interpolated type for Float32 #598

Open
hzarei4 opened this issue Jun 28, 2024 · 1 comment
Open

Mismatch between input datatype and interpolated type for Float32 #598

hzarei4 opened this issue Jun 28, 2024 · 1 comment

Comments

@hzarei4
Copy link

hzarei4 commented Jun 28, 2024

Suppose you have an array of

a = rand(Float32, (10, 11))

As you have mentioned in this commit, the eltype of the interpolate object

itp = interpolate(a, BSpline(Linear()))

is Float32. Then we want to calculate the value of

julia> typeof(itp(1.1, 1.1))
Float64

Then, interestingly

julia> typeof(itp(1.1f0, 1.1f0))
Float32

I think this is an issue with handling the datatypes. I suggest that the interpolation output type should be the input data a we feed the function with, NOT the input type of the itp.

@mkitti
Copy link
Collaborator

mkitti commented Jun 28, 2024

Thanks. That seems reasonable. Could you make a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants