42#include "EST_TVector.h"
43#include "EST_matrix_support.h"
46const int EST_CURRENT=-1;
49bool EST_matrix_bounds_check(
int r,
55 const char *what = set?
"set":
"access";
57 if ((r < 0) || (r >= num_rows))
59 cerr <<
"Tried to " << what <<
" row " << r <<
" of " << num_rows <<
" row matrix\n";
62 if ((c < 0) || (c >= num_columns))
64 cerr <<
"Tried to " << what <<
" column " << c <<
" of " << num_columns <<
" column matrix\n";
71bool EST_matrix_bounds_check(
int r,
int nr,
77 const char *what = set?
"set":
"access";
81 if ((r < 0) || (r >= num_rows))
83 cerr <<
"Tried to " << what <<
" row " << r <<
" of " << num_rows <<
" row matrix\n";
86 if (r+nr-1 >= num_rows)
88 cerr <<
"Tried to " << what <<
" row " << r+nr-1 <<
" of " << num_rows <<
" row matrix\n";
94 if ((c < 0) || (c >= num_columns))
96 cerr <<
"Tried to " << what <<
" column " << c <<
" of " << num_columns <<
" column matrix\n";
99 if (c+nc-1 >= num_columns)
101 cerr <<
"Tried to " << what <<
" column " << c+nc-1 <<
" of " << num_columns <<
" column matrix\n";
109bool EST_vector_bounds_check(
int c,
113 const char *what = set?
"set":
"access";
115 if ((c < 0) || (c >= num_columns))
117 cerr <<
"Tried to " << what <<
" column " << c <<
" of " << num_columns <<
" column vector\n";
124bool EST_vector_bounds_check(
int c,
int nc,
128 const char *what = set?
"set":
"access";
132 if ((c < 0) || (c >= num_columns))
134 cerr <<
"Tried to " << what <<
" column " << c <<
" of " << num_columns <<
" column vector\n";
137 if (c+nc-1 >= num_columns)
139 cerr <<
"Tried to " << what <<
" column " << c+nc-1 <<
" of " << num_columns <<
" column vector\n";