changeset 28213:bb50407f9c60

griddatan.m: Issue informational error if "cubic" METHOD is used. * griddatan.m: Issue error that "cubic" method is not yet implemented. Adjust BIST tests for new behavior.
author Rik <rik@octave.org>
date Mon, 13 Apr 2020 08:56:13 -0700
parents d052c11d47c6
children 0e0e0de09f1e
files scripts/geometry/griddatan.m
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/geometry/griddatan.m	Sun Mar 29 22:15:32 2020 +0200
+++ b/scripts/geometry/griddatan.m	Mon Apr 13 08:56:13 2020 -0700
@@ -108,12 +108,12 @@
     method = tolower (method);
     if (strcmp (method, "linear") || strcmp (method, "nearest"))
       ## Do nothing, these are implemented methods
-    elseif (any (strcmp (method, {"cubic", "v4"})))
+    elseif (strcmp (method, "v4"))
       error ('griddatan: "%s" METHOD is available for 2-D inputs by using "griddata"', method);
 
-    elseif (strcmp (method, "natural"))
-      ## FIXME: Remove when griddata.m supports "natural" method.
-      error ('griddatan: "natural" interpolation METHOD not yet implemented');
+    elseif (any (strcmp (method, {"cubic", "natural"})))
+      ## FIXME: Remove when griddata.m supports these methods.
+      error ('griddatan: "%s" interpolation METHOD not yet implemented', method);
 
     else
       error ('griddatan: unknown interpolation METHOD: "%s"', method);
@@ -191,6 +191,6 @@
 %!error <dimension of .* XI .* must match X> griddatan ([1;2],[3;4], [1, 2])
 %!error <METHOD must be a string> griddatan ([1;2],[3;4], 1, 5)
 %!error <"v4" METHOD is available for 2-D> griddatan ([1;2],[3;4], 1, "v4")
-%!error <"cubic" METHOD is available> griddatan ([1;2],[3;4], 1, "cubic")
+%!error <"cubic" .* not yet implemented> griddatan ([1;2],[3;4], 1, "cubic")
 %!error <"natural" .* not yet implemented> griddatan ([1;2],[3;4], 1, "natural")
 %!error <unknown .* METHOD: "foobar"> griddatan ([1;2],[3;4], 1, "foobar")