model_server/edge/src/matrix.cxx
/*
 * sort
 * this becomes the permutation to bring vector a into a non-decreasing order
 * size of a and this permutation must be identical
 */
sort
this becomes the permutation to bring vector a into a non-decreasing order
size of a and this permutation must be identical
sort this becomes the permutation to bring vector a into a non - decreasing order size of a and this permutation must be identical
void 
permutation::sort(edge_vector* a) 
{
  edge_vector* b = new edge_vector(a->size);
  b->copy(a);
  int i = size - 1;
  while (i) {
    int k = 0;
    for (int j=0; j < i; j++) {
      if (b->v[j] > b->v[j+1]) {
	exchange(j,j+1);
	b->exchange(j,j+1);
	k = j;
      }
    };
    i = k;
  };
  delete b;
  b = 0;
}
void permutation :: sort ( edge_vector * a ) { edge_vector * b = new edge_vector ( a -> size ) ; b -> copy ( a ) ; int i = size - 1 ; while ( i ) { int k = 0 ; for ( int j = 0 ; j < i ; j ++ ) { if ( b -> v [ j ] > b -> v [ j + 1 ] ) { exchange ( j , j + 1 ) ; b -> exchange ( j , j + 1 ) ; k = j ; } } ; i = k ; } ; delete b ; b = 0 ; }
sort
 this becomes the permutation to bring vector a into a non-decreasing order
 size of a and this permutation must be identical
sort this becomes the permutation to bring vector a into a non - decreasing order size of a and this permutation must be identical