You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider function y = f(x) to be interpolated. The types of x an y are conceptually independent and don't have to be the same.
However, in the ndarray-interp crate they are enforced to be the same type. This seems unnecessary.
If possible, please consider making types of x and y disjoint. They could be any float-like values (e.g. num_traits::Float or some of the types from ndarray).
In a more general scenario, potentially, they could be integers (with obvious limitations) or some custom types (with a set of custom traits implemented specifically for interpolation). But that might be more complex.
error[E0271]: type mismatch resolving `<OwnedRepr<f64> as RawData>::Elem == f32`
|
15 | let interpolator = Interp1DBuilder::new(ys).x(xs).build()?;
| - ^^ expected `f32`, found `f64`
| |
| required by a bound introduced by this call
|
note: required by a bound in `ndarray_interp::interp1d::Interp1DBuilder::<Sd, Sx, D, Strat>::x`
--> .cargo/registry/src/index.crates.io-6f17d22bba15001f/ndarray-interp-0.4.1/src/interp1d.rs:423:21
|
421 | pub fn x<NewSx>(self, x: ArrayBase<NewSx, Ix1>) -> Interp1DBuilder<Sd, NewSx, D, Strat>
| - required by a bound in this associated function
422 | where
423 | NewSx: Data<Elem = Sd::Elem>,
| ^^^^^^^^^^^^^^^ required by this bound in `Interp1DBuilder::<Sd, Sx, D, Strat>::x`
The text was updated successfully, but these errors were encountered:
Consider function
y = f(x)
to be interpolated. The types ofx
any
are conceptually independent and don't have to be the same.However, in the
ndarray-interp
crate they are enforced to be the same type. This seems unnecessary.If possible, please consider making types of x and y disjoint. They could be any float-like values (e.g.
num_traits::Float
or some of the types fromndarray
).In a more general scenario, potentially, they could be integers (with obvious limitations) or some custom types (with a set of custom traits implemented specifically for interpolation). But that might be more complex.
Repro
This is currently not allowed:
The error is:
The text was updated successfully, but these errors were encountered: