lib/sbm.js
function(sbm) {
    // create the matrix
    var mat = {}
    mat.x = sbm.y
    mat.y = sbm.x
    mat.data = []
    // populate
    for (var i = 0; i < mat.x; i++) {
      mat.data.push([])
      for (var j = 0; j < mat.y; j++) {
        if (_.includes(sbm.data[j], i)) {
            mat.data[i].push(j)
        }
      }
    }
    return mat
  }
function(sbm) {
    // create the matrix
    var mat = {}
    mat.x = sbm.y
    mat.y = sbm.x
    mat.data = []
    // populate
    for (var i = 0; i < mat.x; i++) {
      mat.data.push([])
      for (var j = 0; j < mat.y; j++) {
        if (_.includes(sbm.data[j], i)) {
            mat.data[i].push(j)
        }
      }
    }
    return mat
  }
function ( sbm ) { // create the matrix var mat = { } mat . x = sbm . y mat . y = sbm . x mat . data = [ ] // populate for ( var i = 0 ; i < mat . x ; i ++ ) { mat . data . push ( [ ] ) for ( var j = 0 ; j < mat . y ; j ++ ) { if ( _ . includes ( sbm . data [ j ] , i ) ) { mat . data [ i ] . push ( j ) } } } return mat }
transposes the matrix
transposes the matrix