Mercurial > hg > octave-nkf
diff liboctave/CColVector.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/CColVector.cc +++ b/liboctave/CColVector.cc @@ -57,7 +57,7 @@ elem (i) = a.elem (i); } -int +bool ComplexColumnVector::operator == (const ComplexColumnVector& a) const { int len = length (); @@ -66,7 +66,7 @@ return equal (data (), a.data (), len); } -int +bool ComplexColumnVector::operator != (const ComplexColumnVector& a) const { return !(*this == a); @@ -230,10 +230,12 @@ ComplexColumnVector::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; } @@ -250,10 +252,12 @@ ComplexColumnVector::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; } @@ -271,10 +275,11 @@ { 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; } @@ -291,10 +296,12 @@ ComplexColumnVector::operator -= (const ComplexColumnVector& 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; } @@ -440,9 +447,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 (nc == 0 || nr == 0) @@ -472,10 +480,12 @@ operator + (const ComplexColumnVector& v, const ColumnVector& a) { int len = v.length (); - if (len != a.length ()) + + int a_len = a.length (); + + if (len != a_len) { - (*current_liboctave_error_handler) - ("nonconformant vector addition attempted"); + gripe_nonconformant ("operator +", len, a_len); return ComplexColumnVector (); } @@ -489,10 +499,12 @@ operator - (const ComplexColumnVector& v, const ColumnVector& a) { int len = v.length (); - if (len != a.length ()) + + int a_len = a.length (); + + if (len != a_len) { - (*current_liboctave_error_handler) - ("nonconformant vector subtraction attempted"); + gripe_nonconformant ("operator -", len, a_len); return ComplexColumnVector (); } @@ -506,10 +518,12 @@ operator + (const ColumnVector& v, const ComplexColumnVector& a) { int len = v.length (); - if (len != a.length ()) + + int a_len = a.length (); + + if (len != a_len) { - (*current_liboctave_error_handler) - ("nonconformant vector subtraction attempted"); + gripe_nonconformant ("operator +", len, a_len); return ComplexColumnVector (); } @@ -523,10 +537,12 @@ operator - (const ColumnVector& v, const ComplexColumnVector& a) { int len = v.length (); - if (len != a.length ()) + + int a_len = a.length (); + + if (len != a_len) { - (*current_liboctave_error_handler) - ("nonconformant vector subtraction attempted"); + gripe_nonconformant ("operator -", len, a_len); return ComplexColumnVector (); } @@ -540,10 +556,12 @@ product (const ComplexColumnVector& v, const ColumnVector& a) { int len = v.length (); - if (len != a.length ()) + + int a_len = a.length (); + + if (len != a_len) { - (*current_liboctave_error_handler) - ("nonconformant vector product attempted"); + gripe_nonconformant ("product", len, a_len); return ComplexColumnVector (); } @@ -557,10 +575,12 @@ quotient (const ComplexColumnVector& v, const ColumnVector& a) { int len = v.length (); - if (len != a.length ()) + + int a_len = a.length (); + + if (len != a_len) { - (*current_liboctave_error_handler) - ("nonconformant vector quotient attempted"); + gripe_nonconformant ("quotient", len, a_len); return ComplexColumnVector (); } @@ -574,10 +594,12 @@ product (const ColumnVector& v, const ComplexColumnVector& a) { int len = v.length (); - if (len != a.length ()) + + int a_len = a.length (); + + if (len != a_len) { - (*current_liboctave_error_handler) - ("nonconformant vector product attempted"); + gripe_nonconformant ("product", len, a_len); return ColumnVector (); } @@ -591,10 +613,12 @@ quotient (const ColumnVector& v, const ComplexColumnVector& a) { int len = v.length (); - if (len != a.length ()) + + int a_len = a.length (); + + if (len != a_len) { - (*current_liboctave_error_handler) - ("nonconformant vector quotient attempted"); + gripe_nonconformant ("quotient", len, a_len); return ColumnVector (); } @@ -620,11 +644,12 @@ { int nr = m.rows (); int nc = m.cols (); + 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); return ColumnVector (); } @@ -647,11 +672,12 @@ { int nr = m.rows (); int nc = m.cols (); + int a_len = a.length (); + if (nc != a_len) { - (*current_liboctave_error_handler) - ("nonconformant matrix muliplication attempted"); + gripe_nonconformant ("operator *", nr, nc, a_len, 1); return ComplexColumnVector (); } @@ -674,11 +700,12 @@ { int nr = m.rows (); int nc = m.cols (); + int a_len = a.length (); + if (nc != a_len) { - (*current_liboctave_error_handler) - ("nonconformant matrix muliplication attempted"); + gripe_nonconformant ("operator *", nr, nc, a_len, 1); return ComplexColumnVector (); }