Mercurial > hg > octave-lyh
comparison liboctave/Array.h @ 355:1752b1ef8bac
[project @ 1994-02-11 01:08:48 by jwe]
author | jwe |
---|---|
date | Fri, 11 Feb 1994 01:13:22 +0000 |
parents | 1a75146ef3bb |
children | 4fbd4bc7f888 |
comparison
equal
deleted
inserted
replaced
354:1a75146ef3bb | 355:1752b1ef8bac |
---|---|
234 | 234 |
235 class Proxy | 235 class Proxy |
236 { | 236 { |
237 public: | 237 public: |
238 | 238 |
239 Proxy (DiagArray<T> *ref, int r, int c) : object (ref), i (r), j (c) { } | 239 inline Proxy (DiagArray<T> *ref, int r, int c) |
240 | 240 : object (ref), i (r), j (c) { } |
241 const Proxy& operator = (const T& val) const | 241 |
242 inline const Proxy& operator = (const T& val) const | |
242 { | 243 { |
243 if (i == j) | 244 if (i == j) |
244 { | 245 { |
245 if (object) | 246 if (object) |
246 object->set (val, i); | 247 object->set (val, i); |
250 ("assignment to off-diagonal element attempted for diagonal array"); | 251 ("assignment to off-diagonal element attempted for diagonal array"); |
251 | 252 |
252 return *this; | 253 return *this; |
253 } | 254 } |
254 | 255 |
255 operator T () const | 256 inline operator T () const |
256 { | 257 { |
257 if (object) | 258 if (object) |
258 return object->get (i); | 259 return object->get (i); |
259 else | 260 else |
260 { | 261 { |