model_server/edge/src/matrix.cxx
/*
 * crossings_rev_columns_quick
 * computes difference of the number of crossings before and after reversing
 * columns c and c+1 by assuming that at most one edge exists between two nodes
 */
crossings_rev_columns_quick
computes difference of the number of crossings before and after reversing
columns c and c+1 by assuming that at most one edge exists between two nodes
crossings_rev_columns_quick computes difference of the number of crossings before and after reversing columns c and c + 1 by assuming that at most one edge exists between two nodes
int 
matrix::crossings_rev_columns_quick(int c)
{
  register int s, i, subcolumn0, subcolumn1;
  s = subcolumn0 = subcolumn1 = 0;
  for (i=1; i<rows; i++) {
    subcolumn0 += m[i-1][c];
    subcolumn1 += m[i-1][c+1];
    if (m[i][c]) s += subcolumn1; 
    if (m[i][c+1]) s -= subcolumn0;
  } 
  return s;
}
int matrix :: crossings_rev_columns_quick ( int c ) { register int s , i , subcolumn0 , subcolumn1 ; s = subcolumn0 = subcolumn1 = 0 ; for ( i = 1 ; i < rows ; i ++ ) { subcolumn0 += m [ i - 1 ] [ c ] ; subcolumn1 += m [ i - 1 ] [ c + 1 ] ; if ( m [ i ] [ c ] ) s += subcolumn1 ; if ( m [ i ] [ c + 1 ] ) s -= subcolumn0 ; } return s ; }
crossings_rev_columns_quick
 computes difference of the number of crossings before and after reversing
 columns c and c+1 by assuming that at most one edge exists between two nodes
crossings_rev_columns_quick computes difference of the number of crossings before and after reversing columns c and c + 1 by assuming that at most one edge exists between two nodes