diff liboctave/numeric/qrp.cc @ 33248:7f73e4805a1f

replace calls to assert with liboctave_panic functions liboctave * lo-error.h (liboctave_panic_impossible, liboctave_panic_if, liboctave_panic_unless): New macros. Replace all calls to assert with panic_if, panic_impossible, or panic_unless as appropriate. Include "lo-error.h" as needed. Don't include <cassert>. Affected files: Array-base.cc, Array-util.cc, Array.h, CSparse.cc, DiagArray2.cc, 1 DiagArray2.h, Sparse.cc, Sparse.h, dim-vector.h, idx-vector.cc, idx-vector.h, CollocWt.cc, Quad.cc, oct-rand.cc, qrp.cc, svd.cc, Sparse-perm-op-defs.h, and oct-sort.cc.
author John W. Eaton <jwe@octave.org>
date Sun, 24 Mar 2024 18:12:34 -0400
parents f53ac65ffba6
children
line wrap: on
line diff
--- a/liboctave/numeric/qrp.cc	Mon Mar 25 00:43:53 2024 -0400
+++ b/liboctave/numeric/qrp.cc	Sun Mar 24 18:12:34 2024 -0400
@@ -27,8 +27,6 @@
 #  include "config.h"
 #endif
 
-#include <cassert>
-
 #include <algorithm>
 
 #include "Array.h"
@@ -54,7 +52,7 @@
 void
 qrp<Matrix>::init (const Matrix& a, type qr_type)
 {
-  assert (qr_type != qr<Matrix>::raw);
+  liboctave_panic_if (qr_type == qr<Matrix>::raw);
 
   F77_INT m = to_f77_int (a.rows ());
   F77_INT n = to_f77_int (a.cols ());
@@ -125,7 +123,7 @@
 void
 qrp<FloatMatrix>::init (const FloatMatrix& a, type qr_type)
 {
-  assert (qr_type != qr<FloatMatrix>::raw);
+  liboctave_panic_if (qr_type == qr<FloatMatrix>::raw);
 
   F77_INT m = to_f77_int (a.rows ());
   F77_INT n = to_f77_int (a.cols ());
@@ -196,7 +194,7 @@
 void
 qrp<ComplexMatrix>::init (const ComplexMatrix& a, type qr_type)
 {
-  assert (qr_type != qr<ComplexMatrix>::raw);
+  liboctave_panic_if (qr_type == qr<ComplexMatrix>::raw);
 
   F77_INT m = to_f77_int (a.rows ());
   F77_INT n = to_f77_int (a.cols ());
@@ -275,7 +273,7 @@
 void
 qrp<FloatComplexMatrix>::init (const FloatComplexMatrix& a, type qr_type)
 {
-  assert (qr_type != qr<FloatComplexMatrix>::raw);
+  liboctave_panic_if (qr_type == qr<FloatComplexMatrix>::raw);
 
   F77_INT m = to_f77_int (a.rows ());
   F77_INT n = to_f77_int (a.cols ());