diff libinterp/corefcn/schur.cc @ 33389:c714266d9f0d

Replace some `panic_unless` with `error` for input validation Some instances of `panic_unless` were being used to validate function inputs. This patch changes many of those instances to `error ()` with a more detailed error message than before. Files affected: cellfun.cc, daspk.cc, dasrt.cc, dassl.cc, kron.cc, pr-output.cc, schur.cc, variables.cc
author Arun Giridhar <arungiridhar@gmail.com>
date Fri, 12 Apr 2024 18:53:59 -0400
parents 40fde86be9b0
children a258493e726a
line wrap: on
line diff
--- a/libinterp/corefcn/schur.cc	Fri Apr 12 17:47:16 2024 -0400
+++ b/libinterp/corefcn/schur.cc	Fri Apr 12 18:53:59 2024 -0400
@@ -46,7 +46,9 @@
   octave_value retval = a;
 
   octave_idx_type n = a.rows ();
-  panic_unless (a.columns () == n);
+
+  if (a.columns () != n)
+    error ("mark_upper_triangular: A must be a square matrix");
 
   const typename Matrix::element_type zero = typename Matrix::element_type ();