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