Mercurial > hg > octave-lyh
diff liboctave/dColVector.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 | a5a300c61159 |
line wrap: on
line diff
--- a/liboctave/dColVector.cc +++ b/liboctave/dColVector.cc @@ -50,7 +50,7 @@ // Column Vector class. -int +bool ColumnVector::operator == (const ColumnVector& a) const { int len = length (); @@ -59,7 +59,7 @@ return equal (data (), a.data (), len); } -int +bool ColumnVector::operator != (const ColumnVector& a) const { return !(*this == a); @@ -169,10 +169,12 @@ ColumnVector::operator += (const ColumnVector& a) { int len = length (); - if (len != a.length ()) + + int a_len = a.length (); + + if (len != a_len) { - (*current_liboctave_error_handler) - ("nonconformant vector += operation attempted"); + gripe_nonconformant ("operator +=", len, a_len); return *this; } @@ -189,10 +191,12 @@ ColumnVector::operator -= (const ColumnVector& a) { int len = length (); - if (len != a.length ()) + + int a_len = a.length (); + + if (len != a_len) { - (*current_liboctave_error_handler) - ("nonconformant vector -= operation attempted"); + gripe_nonconformant ("operator -=", len, a_len); return *this; } @@ -215,9 +219,10 @@ int nr = m.rows (); int nc = m.cols (); - if (nc != a.length ()) - (*current_liboctave_error_handler) - ("nonconformant matrix multiplication attempted"); + int a_len = a.length (); + + if (nc != a_len) + gripe_nonconformant ("operator *", nr, nc, a_len, 1); else { if (nr == 0 || nc == 0) @@ -254,8 +259,7 @@ int a_len = a.length (); if (nc != a_len) - (*current_liboctave_error_handler) - ("nonconformant matrix multiplication attempted"); + gripe_nonconformant ("operator *", nr, nc, a_len, 1); else { if (nr == 0 || nc == 0)