Mercurial > octave
diff liboctave/Matrix.h @ 227:1a48a1b91489
[project @ 1993-11-15 10:10:35 by jwe]
author | jwe |
---|---|
date | Mon, 15 Nov 1993 10:11:59 +0000 |
parents | 7947b7a6b6da |
children | e1b072bcffb9 |
line wrap: on
line diff
--- a/liboctave/Matrix.h Mon Nov 15 10:06:26 1993 +0000 +++ b/liboctave/Matrix.h Mon Nov 15 10:11:59 1993 +0000 @@ -47,8 +47,6 @@ // #include <iomanip.h> // We don\'t use this yet. #include <Complex.h> -#define FAIL assert(0) /* XXX FIXME XXX */ - #ifndef MAPPER_FCN_TYPEDEFS #define MAPPER_FCN_TYPEDEFS 1 @@ -554,31 +552,11 @@ inline double& Matrix::elem (int r, int c) { return data[nr*c+r]; } -inline double& Matrix::checkelem (int r, int c) -{ -#ifndef NO_RANGE_CHECK - if (r < 0 || r >= nr || c < 0 || c >= nc) - FAIL; -#endif - - return elem (r, c); -} - inline double& Matrix::operator () (int r, int c) { return checkelem (r, c); } inline double Matrix::elem (int r, int c) const { return data[nr*c+r]; } -inline double Matrix::checkelem (int r, int c) const -{ -#ifndef NO_RANGE_CHECK - if (r < 0 || r >= nr || c < 0 || c >= nc) - FAIL; -#endif - - return elem (r, c); -} - inline double Matrix::operator () (int r, int c) const { return checkelem (r, c); } @@ -715,32 +693,10 @@ inline double& ColumnVector::elem (int n) { return data[n]; } -inline double& -ColumnVector::checkelem (int n) -{ -#ifndef NO_RANGE_CHECK - if (n < 0 || n >= len) - FAIL; -#endif - - return elem (n); -} - inline double& ColumnVector::operator () (int n) { return checkelem (n); } inline double ColumnVector::elem (int n) const { return data[n]; } -inline double -ColumnVector::checkelem (int n) const -{ -#ifndef NO_RANGE_CHECK - if (n < 0 || n >= len) - FAIL; -#endif - - return elem (n); -} - inline double ColumnVector::operator () (int n) const { return checkelem (n); } inline double *ColumnVector::fortran_vec (void) const { return data; } @@ -882,32 +838,10 @@ inline double& RowVector::elem (int n) { return data[n]; } -inline double& -RowVector::checkelem (int n) -{ -#ifndef NO_RANGE_CHECK - if (n < 0 || n >= len) - FAIL; -#endif - - return elem (n); -} - inline double& RowVector::operator () (int n) { return checkelem (n); } inline double RowVector::elem (int n) const { return data[n]; } -inline double -RowVector::checkelem (int n) const -{ -#ifndef NO_RANGE_CHECK - if (n < 0 || n >= len) - FAIL; -#endif - - return elem (n); -} - inline double RowVector::operator () (int n) const { return checkelem (n); } inline double *RowVector::fortran_vec (void) const { return data; } @@ -1076,32 +1010,12 @@ inline double& DiagMatrix::elem (int r, int c) { return (r == c) ? data[r] : 0; } -inline double& DiagMatrix::checkelem (int r, int c) -{ -#ifndef NO_RANGE_CHECK - if (r < 0 || r >= nr || c < 0 || c >= nc) - FAIL; -#endif - - return elem (r, c); -} - inline double& DiagMatrix::operator () (int r, int c) { return checkelem (r, c); } inline double DiagMatrix::elem (int r, int c) const { return (r == c) ? data[r] : 0; } -inline double DiagMatrix::checkelem (int r, int c) const -{ -#ifndef NO_RANGE_CHECK - if (r < 0 || r >= nr || c < 0 || c >= nc) - FAIL; -#endif - - return elem (r, c); -} - inline double DiagMatrix::operator () (int r, int c) const { return checkelem (r, c); } @@ -1398,32 +1312,12 @@ inline Complex& ComplexMatrix::elem (int r, int c) { return data[nr*c+r]; } -inline Complex& ComplexMatrix::checkelem (int r, int c) -{ -#ifndef NO_RANGE_CHECK - if (r < 0 || r >= nr || c < 0 || c >= nc) - FAIL; -#endif - - return elem (r, c); -} - inline Complex& ComplexMatrix::operator () (int r, int c) { return checkelem (r, c); } inline Complex ComplexMatrix::elem (int r, int c) const { return data[nr*c+r]; } -inline Complex ComplexMatrix::checkelem (int r, int c) const -{ -#ifndef NO_RANGE_CHECK - if (r < 0 || r >= nr || c < 0 || c >= nc) - FAIL; -#endif - - return elem (r, c); -} - inline Complex ComplexMatrix::operator () (int r, int c) const { return checkelem (r, c); } @@ -1591,33 +1485,11 @@ inline Complex& ComplexColumnVector::elem (int n) { return data[n]; } -inline Complex& -ComplexColumnVector::checkelem (int n) -{ -#ifndef NO_RANGE_CHECK - if (n < 0 || n >= len) - FAIL; -#endif - - return elem (n); -} - inline Complex& ComplexColumnVector::operator () (int n) { return checkelem (n); } inline Complex ComplexColumnVector::elem (int n) const { return data[n]; } -inline Complex -ComplexColumnVector::checkelem (int n) const -{ -#ifndef NO_RANGE_CHECK - if (n < 0 || n >= len) - FAIL; -#endif - - return elem (n); -} - inline Complex ComplexColumnVector::operator () (int n) const { return checkelem (n); } @@ -1786,32 +1658,10 @@ inline Complex& ComplexRowVector::elem (int n) { return data[n]; } -inline Complex& -ComplexRowVector::checkelem (int n) -{ -#ifndef NO_RANGE_CHECK - if (n < 0 || n >= len) - FAIL; -#endif - - return elem (n); -} - inline Complex& ComplexRowVector::operator () (int n) { return checkelem (n); } inline Complex ComplexRowVector::elem (int n) const { return data[n]; } -inline Complex -ComplexRowVector::checkelem (int n) const -{ -#ifndef NO_RANGE_CHECK - if (n < 0 || n >= len) - FAIL; -#endif - - return elem (n); -} - inline Complex ComplexRowVector::operator () (int n) const { return checkelem (n); } @@ -2014,32 +1864,12 @@ inline Complex& ComplexDiagMatrix::elem (int r, int c) { Complex czero (0.0, 0.0); return (r == c) ? data[r] : czero; } -inline Complex& ComplexDiagMatrix::checkelem (int r, int c) -{ -#ifndef NO_RANGE_CHECK - if (r < 0 || r >= nr || c < 0 || c >= nc) - FAIL; -#endif - - return elem (r, c); -} - inline Complex& ComplexDiagMatrix::operator () (int r, int c) { return checkelem (r, c); } inline Complex ComplexDiagMatrix::elem (int r, int c) const { Complex czero (0.0, 0.0); return (r == c) ? data[r] : czero; } -inline Complex ComplexDiagMatrix::checkelem (int r, int c) const -{ -#ifndef NO_RANGE_CHECK - if (r < 0 || r >= nr || c < 0 || c >= nc) - FAIL; -#endif - - return elem (r, c); -} - inline Complex ComplexDiagMatrix::operator () (int r, int c) const { return checkelem (r, c); } @@ -2072,7 +1902,7 @@ inline AEPBALANCE::AEPBALANCE (const Matrix& a,const char * balance_job) { - init (a,balance_job); + init (a, balance_job); } inline AEPBALANCE::AEPBALANCE (const AEPBALANCE& a) @@ -2123,7 +1953,7 @@ inline ComplexAEPBALANCE::ComplexAEPBALANCE (const ComplexMatrix& a, const char * balance_job) { - init(a,balance_job); + init(a, balance_job); } inline ComplexAEPBALANCE::ComplexAEPBALANCE (const ComplexAEPBALANCE& a) @@ -2276,7 +2106,7 @@ inline GEPBALANCE::GEPBALANCE (const Matrix& a, const Matrix& b, const char * balance_job) { - init (a,b,balance_job); + init (a, b, balance_job); } inline GEPBALANCE::GEPBALANCE (const GEPBALANCE& a)