lib/sbm.js
function(sbm) {
    // if the matrix ain't square, symmetry is off
    if (sbm.x !== sbm.y) {
      return false
    }

    // symmetry status
    var symmetry = true
    // iterate
    for (var i = 0; i < sbm.x; i++) {
      for (var j = 0; j <= i; j++) {
        symmetry = symmetry && ((_.includes(sbm.data[i], j) ^ _.includes(sbm.data[j], i)) === 0)
      }
    }
    // return
    return symmetry
  }
function(sbm) {
    // if the matrix ain't square, symmetry is off
    if (sbm.x !== sbm.y) {
      return false
    }

    // symmetry status
    var symmetry = true
    // iterate
    for (var i = 0; i < sbm.x; i++) {
      for (var j = 0; j <= i; j++) {
        symmetry = symmetry && ((_.includes(sbm.data[i], j) ^ _.includes(sbm.data[j], i)) === 0)
      }
    }
    // return
    return symmetry
  }
function ( sbm ) { // if the matrix ain't square, symmetry is off if ( sbm . x !== sbm . y ) { return false } // symmetry status var symmetry = true // iterate for ( var i = 0 ; i < sbm . x ; i ++ ) { for ( var j = 0 ; j <= i ; j ++ ) { symmetry = symmetry && ( ( _ . includes ( sbm . data [ i ] , j ) ^ _ . includes ( sbm . data [ j ] , i ) ) === 0 ) } } // return return symmetry }
returns true if the matrix is symmetric
returns true if the matrix is symmetric