--- trunk/OOPSE-4/src/math/RectMatrix.hpp 2004/10/17 01:19:11 1586 +++ trunk/OOPSE-4/src/math/RectMatrix.hpp 2004/10/18 23:13:23 1594 @@ -151,6 +151,30 @@ namespace oopse { for (unsigned int j = 0; j < Col; j++) data_[j][col] = v[j]; } + + /** + * swap two rows of this matrix + * @param i the first row + * @param j the second row + */ + void swapRow(unsigned int i, unsigned int j){ + assert(i < Row && j < Row); + + for (unsigned int k = 0; k < Col; k++) + std::swap(data_[i][k], data_[j][k]); + } + + /** + * swap two colums of this matrix + * @param i the first colum + * @param j the second colum + */ + void swapColum(unsigned int i, unsigned int j){ + assert(i < Col && j < Col); + + for (unsigned int k = 0; k < Row; k++) + std::swap(data_[k][i], data_[k][j]); + } /** * Tests if this matrix is identical to matrix m