Mercurial > octave
diff scripts/general/interpn.m @ 30688:d1fe2cb16d95
Fix __lin_interpn__ for complex input (bug #61907).
* libinterp/corefcn/__lin_interp__.cc (lin_interpn<T, DT>,
lin_interpn<MT, DMT, DT>): Generalize implementation for complex valued input.
* scripts/general/interpn.m: Remove work-around.
author | Christof Kaufmann <christofkaufmann.dev@gmail.com> |
---|---|
date | Wed, 26 Jan 2022 14:42:09 +0100 |
parents | 92cda11fb171 |
children | 731b6a5c7c4c |
line wrap: on
line diff
--- a/scripts/general/interpn.m Sat Jan 29 16:24:40 2022 -0800 +++ b/scripts/general/interpn.m Wed Jan 26 14:42:09 2022 +0100 @@ -185,11 +185,6 @@ if (strcmp (method, "linear")) vi = __lin_interpn__ (x{:}, v, y{:}); - if (iscomplex (v)) - ## __lin_interpn__ ignores imaginary part. Do it again for imag part. - ## FIXME: Adapt __lin_interpn__ to correctly handle complex input. - vi += 1i * __lin_interpn__ (x{:}, imag (v), y{:}); - endif vi(isna (vi)) = extrapval; elseif (strcmp (method, "nearest")) ## FIXME: This seems overly complicated. Is there a way to simplify