Mercurial > hg > octave-lyh
comparison liboctave/MArray.cc @ 4646:eff8f977508c
[project @ 2003-11-23 18:13:19 by jwe]
author | jwe |
---|---|
date | Sun, 23 Nov 2003 18:13:19 +0000 |
parents | 5719210fff4c |
children | 334a27c8f453 |
comparison
equal
deleted
inserted
replaced
4645:bd2067547b40 | 4646:eff8f977508c |
---|---|
39 | 39 |
40 template <class T> | 40 template <class T> |
41 MArray<T>& | 41 MArray<T>& |
42 operator += (MArray<T>& a, const T& s) | 42 operator += (MArray<T>& a, const T& s) |
43 { | 43 { |
44 DO_VS_OP2 (+=) | 44 DO_VS_OP2 (T, a, +=, s) |
45 return a; | 45 return a; |
46 } | 46 } |
47 | 47 |
48 template <class T> | 48 template <class T> |
49 MArray<T>& | 49 MArray<T>& |
50 operator -= (MArray<T>& a, const T& s) | 50 operator -= (MArray<T>& a, const T& s) |
51 { | 51 { |
52 DO_VS_OP2 (-=) | 52 DO_VS_OP2 (T, a, -=, s) |
53 return a; | 53 return a; |
54 } | 54 } |
55 | 55 |
56 // Element by element MArray by MArray ops. | 56 // Element by element MArray by MArray ops. |
57 | 57 |
64 { | 64 { |
65 int bl = b.length (); | 65 int bl = b.length (); |
66 if (l != bl) | 66 if (l != bl) |
67 gripe_nonconformant ("operator +=", l, bl); | 67 gripe_nonconformant ("operator +=", l, bl); |
68 else | 68 else |
69 DO_VV_OP2 (+=); | 69 DO_VV_OP2 (T, a, +=, b); |
70 } | 70 } |
71 return a; | 71 return a; |
72 } | 72 } |
73 | 73 |
74 template <class T> | 74 template <class T> |
80 { | 80 { |
81 int bl = b.length (); | 81 int bl = b.length (); |
82 if (l != bl) | 82 if (l != bl) |
83 gripe_nonconformant ("operator -=", l, bl); | 83 gripe_nonconformant ("operator -=", l, bl); |
84 else | 84 else |
85 DO_VV_OP2 (-=); | 85 DO_VV_OP2 (T, a, -=, b); |
86 } | 86 } |
87 return a; | 87 return a; |
88 } | 88 } |
89 | 89 |
90 // Element by element MArray by scalar ops. | 90 // Element by element MArray by scalar ops. |