8 ASSERT( (nr > 0 && nc > 0) || (nr == 0 && nc == 0),
"illegal index" );
14 for (
i = 0;
i < nr;
i++ )
27 for (
i = 0;
i <
NR;
i++ ) {
29 for (
j = 0;
j <
NC;
j++ )
57 for (
i = 0;
i <
NR;
i++ )
60 for (
i = 0;
i < NR;
i++ )
61 for (
j = 0;
j < NC;
j++ )
62 elems[
i][
j] =
M.elems[
i][
j];
84 ASSERT( row > 0 && col > 0 && row <=
NR && col <=
NC,
"illegal index" );
85 return elems[row-1][col-1];
91 ASSERT( row > 0 && col > 0 && row <=
NR && col <=
NC,
"illegal index" );
92 return elems[row-1][col-1];
98 ASSERT( rmin > 0 && rmax <=
NR && rmin <= rmax && cmin > 0 && cmax <=
NC && cmin <= cmax ,
"illegal index" );
105 ASSERT( rmin > 0 && rmax <=
NR && rmin <= rmax && cmin > 0 && cmax <=
NC && cmin <= cmax ,
"illegal index" );
128 for (
k = 0;
k <
NR;
k++ ) {
141 for (
int j = 1;
j <
NC;
j++ )
151 else if (
NR == 1 ) {
160 for (
i = 1;
i <
NR;
i++ ) {
240 if (
M.elems != S.
elems ) {
242 for (
i = 0;
i < S.
NR;
i++ )
243 for (
j = 0;
j < S.
NC;
j++ )
256 if (
M.elems == S.
M.elems ) {
258 for (
i = 0;
i < n;
i++ )
259 for (
j = 0;
j <
m;
j++ )
263 for (
i = n-1;
i >= 0;
i-- )
264 for (
j = 0;
j <
m;
j++ )
268 for (
j = 0;
j <
m;
j++ )
269 for (
i = 0;
i < n;
i++ )
273 for (
j =
m-1;
j >= 0;
j-- )
274 for (
i = 0;
i < n;
i++ )
279 for (
i = 0;
i < n;
i++ )
280 for (
j = 0;
j <
m;
j++ )
292 for (
i = 0;
i < n;
i++ )
293 for (
j = 0;
j <
m;
j++ )
#define ASSERT(expression, message)
void swapRow(int i, int j)
void print(OSTREAM &s) const
void swapColumn(int i, int j)
Matrix< T > & operator=(const Matrix< T > &M)
void printrow(OSTREAM &s, int i) const
SubMatrix< T > operator[](int i)
T & operator()(int row, int col)
SubMatrix(int rmin, int rmax, int cmin, int cmax, const Matrix< T > &m)
T operator[](int i) const
SubMatrix< T > & operator=(const SubMatrix< T > &S)
const CanonicalForm int s
OSTREAM & operator<<(OSTREAM &s, const Matrix< T > &M)