diff liboctave/CDiagMatrix.cc @ 2386:4fc9fd1424a9

[project @ 1996-10-12 18:31:34 by jwe]
author jwe
date Sat, 12 Oct 1996 18:38:10 +0000
parents 1b57120c997b
children 2387b8694c75
line wrap: on
line diff
--- a/liboctave/CDiagMatrix.cc	Sat Oct 12 18:24:33 1996 +0000
+++ b/liboctave/CDiagMatrix.cc	Sat Oct 12 18:38:10 1996 +0000
@@ -45,7 +45,7 @@
     elem (i, i) = a.elem (i, i);
 }
 
-int
+bool
 ComplexDiagMatrix::operator == (const ComplexDiagMatrix& a) const
 {
   if (rows () != a.rows () || cols () != a.cols ())
@@ -54,7 +54,7 @@
   return equal (data (), a.data (), length ());
 }
 
-int
+bool
 ComplexDiagMatrix::operator != (const ComplexDiagMatrix& a) const
 {
   return !(*this == a);
@@ -399,10 +399,13 @@
 {
   int nr = rows ();
   int nc = cols ();
-  if (nr != a.rows () || nc != a.cols ())
+
+  int a_nr = a.rows ();
+  int a_nc = a.cols ();
+
+  if (nr != a_nr || nc != a_nc)
     {
-      (*current_liboctave_error_handler)
-	("nonconformant matrix += operation attempted");
+      gripe_nonconformant ("operator +=", nr, nc, a_nr, a_nc);
       return *this;
     }
 
@@ -420,10 +423,13 @@
 {
   int nr = rows ();
   int nc = cols ();
-  if (nr != a.rows () || nc != a.cols ())
+
+  int a_nr = a.rows ();
+  int a_nc = a.cols ();
+
+  if (nr != a_nr || nc != a_nc)
     {
-      (*current_liboctave_error_handler)
-	("nonconformant matrix -= operation attempted");
+      gripe_nonconformant ("operator -=", nr, nc, a_nr, a_nc);
       return *this;
     }
 
@@ -441,10 +447,13 @@
 {
   int nr = rows ();
   int nc = cols ();
-  if (nr != a.rows () || nc != a.cols ())
+
+  int a_nr = a.rows ();
+  int a_nc = a.cols ();
+
+  if (nr != a_nr || nc != a_nc)
     {
-      (*current_liboctave_error_handler)
-	("nonconformant matrix += operation attempted");
+      gripe_nonconformant ("operator +=", nr, nc, a_nr, a_nc);
       return *this;
     }
 
@@ -462,10 +471,13 @@
 {
   int nr = rows ();
   int nc = cols ();
-  if (nr != a.rows () || nc != a.cols ())
+
+  int a_nr = a.rows ();
+  int a_nc = a.cols ();
+
+  if (nr != a_nr || nc != a_nc)
     {
-      (*current_liboctave_error_handler)
-	("nonconformant matrix -= operation attempted");
+      gripe_nonconformant ("operator -=", nr, nc, a_nr, a_nc);
       return *this;
     }
 
@@ -531,12 +543,13 @@
 {
   int nr_a = a.rows ();
   int nc_a = a.cols ();
+
   int nr_b = b.rows ();
   int nc_b = b.cols ();
+
   if (nc_a != nr_b)
     {
-      (*current_liboctave_error_handler)
-        ("nonconformant matrix multiplication attempted");
+      gripe_nonconformant ("operator *", nr_a, nc_a, nr_b, nc_b);
       return ComplexDiagMatrix ();
     }
 
@@ -570,10 +583,13 @@
 {
   int nr = m.rows ();
   int nc = m.cols ();
-  if (nr != a.rows () || nc != a.cols ())
+
+  int a_nr = a.rows ();
+  int a_nc = a.cols ();
+
+  if (nr != a_nr || nc != a_nc)
     {
-      (*current_liboctave_error_handler)
-	("nonconformant matrix addition attempted");
+      gripe_nonconformant ("operator +", nr, nc, a_nr, a_nc);
       return ComplexDiagMatrix ();
     }
 
@@ -588,10 +604,13 @@
 {
   int nr = m.rows ();
   int nc = m.cols ();
-  if (nr != a.rows () || nc != a.cols ())
+
+  int a_nr = a.rows ();
+  int a_nc = a.cols ();
+
+  if (nr != a_nr || nc != a_nc)
     {
-      (*current_liboctave_error_handler)
-	("nonconformant matrix subtraction attempted");
+      gripe_nonconformant ("operator -", nr, nc, a_nr, a_nc);
       return ComplexDiagMatrix ();
     }
 
@@ -607,12 +626,13 @@
 {
   int nr_a = a.rows ();
   int nc_a = a.cols ();
+
   int nr_b = b.rows ();
   int nc_b = b.cols ();
+
   if (nc_a != nr_b)
     {
-      (*current_liboctave_error_handler)
-        ("nonconformant matrix multiplication attempted");
+      gripe_nonconformant ("operator *", nr_a, nc_a, nr_b, nc_b);
       return ComplexDiagMatrix ();
     }
 
@@ -646,10 +666,13 @@
 {
   int nr = m.rows ();
   int nc = m.cols ();
-  if (nr != a.rows () || nc != a.cols ())
+
+  int a_nr = a.rows ();
+  int a_nc = a.cols ();
+
+  if (nr != a_nr || nc != a_nc)
     {
-      (*current_liboctave_error_handler)
-	("nonconformant matrix addition attempted");
+      gripe_nonconformant ("operator +", nr, nc, a_nr, a_nc);
       return ComplexDiagMatrix ();
     }
 
@@ -664,10 +687,13 @@
 {
   int nr = m.rows ();
   int nc = m.cols ();
-  if (nr != a.rows () || nc != a.cols ())
+
+  int a_nr = a.rows ();
+  int a_nc = a.cols ();
+
+  if (nr != a_nr || nc != a_nc)
     {
-      (*current_liboctave_error_handler)
-	("nonconformant matrix subtraction attempted");
+      gripe_nonconformant ("operator -", nr, nc, a_nr, a_nc);
       return ComplexDiagMatrix ();
     }
 
@@ -683,12 +709,13 @@
 {
   int nr_a = a.rows ();
   int nc_a = a.cols ();
+
   int nr_b = b.rows ();
   int nc_b = b.cols ();
+
   if (nc_a != nr_b)
     {
-      (*current_liboctave_error_handler)
-        ("nonconformant matrix multiplication attempted");
+      gripe_nonconformant ("operator *", nr_a, nc_a, nr_b, nc_b);
       return ComplexDiagMatrix ();
     }
 
@@ -722,10 +749,13 @@
 {
   int nr = m.rows ();
   int nc = m.cols ();
-  if (nr != a.rows () || nc != a.cols ())
+
+  int a_nr = a.rows ();
+  int a_nc = a.cols ();
+
+  if (nr != a_nr || nc != a_nc)
     {
-      (*current_liboctave_error_handler)
-	("nonconformant matrix product attempted");
+      gripe_nonconformant ("product", nr, nc, a_nr, a_nc);
       return ComplexDiagMatrix ();
     }
 
@@ -741,10 +771,13 @@
 {
   int nr = m.rows ();
   int nc = m.cols ();
-  if (nr != a.rows () || nc != a.cols ())
+
+  int a_nr = a.rows ();
+  int a_nc = a.cols ();
+
+  if (nr != a_nr || nc != a_nc)
     {
-      (*current_liboctave_error_handler)
-	("nonconformant matrix product attempted");
+      gripe_nonconformant ("product", nr, nc, a_nr, a_nc);
       return ComplexDiagMatrix ();
     }