Mercurial > hg > octave-lyh
diff liboctave/MArray.cc @ 2383:096529066838
[project @ 1996-10-12 17:50:47 by jwe]
author | jwe |
---|---|
date | Sat, 12 Oct 1996 17:52:55 +0000 |
parents | 1b57120c997b |
children | 8b262e771614 |
line wrap: on
line diff
--- a/liboctave/MArray.cc +++ b/liboctave/MArray.cc @@ -62,9 +62,9 @@ int l = a.length (); if (l > 0) { - if (l != b.length ()) - (*current_liboctave_error_handler) \ - ("nonconformant += array operation attempted"); \ + int bl = b.length (); + if (l != bl) + gripe_nonconformant ("operator +=", l, bl); else DO_VV_OP2 (+=); } @@ -78,9 +78,9 @@ int l = a.length (); if (l > 0) { - if (l != b.length ()) - (*current_liboctave_error_handler) \ - ("nonconformant -= array operation attempted"); \ + int bl = b.length (); + if (l != bl) + gripe_nonconformant ("operator -=", l, bl); else DO_VV_OP2 (-=); } @@ -121,16 +121,16 @@ // Element by element MArray by MArray ops. -#define MARRAY_AA_OP(FCN, OP, OP_STR) \ +#define MARRAY_AA_OP(FCN, OP) \ template <class T> \ MArray<T> \ FCN (const MArray<T>& a, const MArray<T>& b) \ { \ int l = a.length (); \ - if (l != b.length ()) \ + int bl = b.length (); \ + if (l != bl) \ { \ - (*current_liboctave_error_handler) \ - ("nonconformant array " OP_STR " attempted"); \ + gripe_nonconformant (#FCN, l, bl); \ return MArray<T> (); \ } \ if (l == 0) \ @@ -139,10 +139,10 @@ return MArray<T> (result, l); \ } -MARRAY_AA_OP (operator +, +, "addition") -MARRAY_AA_OP (operator -, -, "subtraction") -MARRAY_AA_OP (product, *, "multiplication") -MARRAY_AA_OP (quotient, /, "division") +MARRAY_AA_OP (operator +, +) +MARRAY_AA_OP (operator -, -) +MARRAY_AA_OP (product, *) +MARRAY_AA_OP (quotient, /) // Unary MArray ops.