mat.cpp
// use this n^2 sort for small numbers of elements
// to sort the rows of a matrix from rows numbered:
// lower to upper inclusive
use this n^2 sort for small numbers of elements
to sort the rows of a matrix from rows numbered:
lower to upper inclusive
use this n^2 sort for small numbers of elements to sort the rows of a matrix from rows numbered : lower to upper inclusive
void Matrix::selectSort(int lower, int upper)
{
    int bestLoc;
    for (int l=lower; l<upper; l++) {
        bestLoc = l;
        for (int u=l+1; u<=upper; u++) {
            if (lessRows(u, bestLoc)) bestLoc=u;
        }
        if (bestLoc!=l) swapRows(l, bestLoc);
    }
}
void Matrix :: selectSort ( int lower , int upper ) { int bestLoc ; for ( int l = lower ; l < upper ; l ++ ) { bestLoc = l ; for ( int u = l + 1 ; u <= upper ; u ++ ) { if ( lessRows ( u , bestLoc ) ) bestLoc = u ; } if ( bestLoc != l ) swapRows ( l , bestLoc ) ; } }
use this n^2 sort for small numbers of elements
to sort the rows of a matrix from rows numbered:
lower to upper inclusive
use this n^2 sort for small numbers of elements to sort the rows of a matrix from rows numbered : lower to upper inclusive