model_server/edge/src/matrix.cxx
/*
 * permute_columns
 * permutes the columns of this matrix according to permutation p.
 * this[..][j] becomes this[..][p[j]].
 * size of p and columns of this matrix must be identical.
 */
permute_columns
permutes the columns of this matrix according to permutation p.
permute_columns permutes the columns of this matrix according to permutation p .
void 
matrix::permute_columns(permutation* p) 
{
  int* oldv = new int[columns];
  for (int r=0; r<rows; r++) {
    int c;
    for (c=0; c<columns; c++) {
      oldv[c]=m[r].v[c];
    };
    for (c=0; c<columns; c++) {
      m[r].v[c]=oldv[p->v[c]];
    }
  };
  delete oldv;
  oldv = 0;
}
void matrix :: permute_columns ( permutation * p ) { int * oldv = new int [ columns ] ; for ( int r = 0 ; r < rows ; r ++ ) { int c ; for ( c = 0 ; c < columns ; c ++ ) { oldv [ c ] = m [ r ] . v [ c ] ; } ; for ( c = 0 ; c < columns ; c ++ ) { m [ r ] . v [ c ] = oldv [ p -> v [ c ] ] ; } } ; delete oldv ; oldv = 0 ; }
permute_columns
 permutes the columns of this matrix according to permutation p.
 this[..][j] becomes this[..][p[j]].
permute_columns permutes the columns of this matrix according to permutation p . this [ .. ] [ j ] becomes this [ .. ] [ p [ j ]] .