lib/sbm.js
function(sbm) {
    // creating matrix
    var mat = []
    // populate
    for (var i = 0; i < sbm.x; i++) {
      mat.push([])
      for (var j = 0; j < sbm.y; j++) {
        mat[i][j] = _.includes(sbm.data[i], j) ? 1 : 0
      }
    }
    // return the matrix
    return mat
  }
function(sbm) {
    // creating matrix
    var mat = []
    // populate
    for (var i = 0; i < sbm.x; i++) {
      mat.push([])
      for (var j = 0; j < sbm.y; j++) {
        mat[i][j] = _.includes(sbm.data[i], j) ? 1 : 0
      }
    }
    // return the matrix
    return mat
  }
function ( sbm ) { // creating matrix var mat = [ ] // populate for ( var i = 0 ; i < sbm . x ; i ++ ) { mat . push ( [ ] ) for ( var j = 0 ; j < sbm . y ; j ++ ) { mat [ i ] [ j ] = _ . includes ( sbm . data [ i ] , j ) ? 1 : 0 } } // return the matrix return mat }
returns the sbm in line-based matrix form
returns the sbm in line - based matrix form