model_server/edge/src/matrix.cxx
// matrix crossings - # of nodes crossed by horizontal edges
// at the same level - matrix is not symmetrical any more
matrix crossings - # of nodes crossed by horizontal edges
at the same level - matrix is not symmetrical any more
matrix crossings - # of nodes crossed by horizontal edges at the same level - matrix is not symmetrical any more
int matrix::symm_crossings()
{
  register int i, j, k, total;
  total = 0;
   for (i=0; i<rows; i++) {
       for (j=1, k=i+2; k<rows; k++, j++)
           total += ( m[i][k] * j );
   }
   for (i=rows-1; i > 1; i--) {
       for (j= rows - 2, k= 0; k < i - 1; k++, j--)
           total += ( m[i][k] * j );
   }
   return total;
}
int matrix :: symm_crossings ( ) { register int i , j , k , total ; total = 0 ; for ( i = 0 ; i < rows ; i ++ ) { for ( j = 1 , k = i + 2 ; k < rows ; k ++ , j ++ ) total += ( m [ i ] [ k ] * j ) ; } for ( i = rows - 1 ; i > 1 ; i -- ) { for ( j = rows - 2 , k = 0 ; k < i - 1 ; k ++ , j -- ) total += ( m [ i ] [ k ] * j ) ; } return total ; }
matrix crossings - # of nodes crossed by horizontal edges
at the same level - matrix is not symmetrical any more
matrix crossings - # of nodes crossed by horizontal edges at the same level - matrix is not symmetrical any more
//   j = # of nodes between nodes i and k; #rows = # columns // from llower to upper indexes // from upper to lower indexes