Mercurial > hg > octave-lyh
diff liboctave/Array2.h @ 2306:2fbf9bb1cd7a
[project @ 1996-07-09 16:49:03 by jwe]
author | jwe |
---|---|
date | Tue, 09 Jul 1996 16:51:04 +0000 |
parents | 356f70c8fcbd |
children | 58e5955495d7 |
line wrap: on
line diff
--- a/liboctave/Array2.h +++ b/liboctave/Array2.h @@ -120,9 +120,9 @@ T& xelem (int i, int j) { return Array<T>::xelem (d1*j+i); } T xelem (int i, int j) const { return Array<T>::xelem (d1*j+i); } - // Note that the following element references don't use - // Array2<T>::xelem() because they still need to make use of the - // code in Array<T> that checks the reference count. + // Note that the following element selection methods don't use + // xelem() because they need to make use of the code in + // Array<T>::elem() that checks the reference count. T& checkelem (int i, int j) { @@ -137,14 +137,14 @@ return Array<T>::elem (d1*j+i); } + T& elem (int i, int j) { return Array<T>::elem (d1*j+i); } + #if defined (BOUNDS_CHECKING) - T& elem (int i, int j) { return checkelem (i, j); } + T& operator () (int i, int j) { return checkelem (i, j); } #else - T& elem (int i, int j) { return Array<T>::elem (d1*j+i); } + T& operator () (int i, int j) { return elem (i, j); } #endif - T& operator () (int i, int j) { return elem (i, j); } - T checkelem (int i, int j) const { if (i < 0 || j < 0 || i >= d1 || j >= d2) @@ -159,14 +159,14 @@ return Array<T>::elem (d1*j+i); } + T elem (int i, int j) const { return Array<T>::elem (d1*j+i); } + #if defined (BOUNDS_CHECKING) - T elem (int i, int j) const { return checkelem (i, j); } + T operator () (int i, int j) const { return checkelem (i, j); } #else - T elem (int i, int j) const { return Array<T>::elem (d1*j+i); } + T operator () (int i, int j) const { return elem (i, j); } #endif - T operator () (int i, int j) const { return elem (i, j); } - T range_error (const char *fcn, int i, int j) const; T& range_error (const char *fcn, int i, int j);