How to use the binary-search-bounds.eq function in binary-search-bounds

To help you get started, we’ve selected a few binary-search-bounds examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mikolalysenko / cdt2d / index.html View on Github external
x = b
        y = c
        z = a
      }
    } else if(c < a) {
      x = c
      y = a
      z = b
    }
    if(x < 0) {
      return -1
    }
    key[0] = x
    key[1] = y
    key[2] = z
    return bsearch.eq(this.cells, key, compareCell)
  }
})()
github mikolalysenko / cdt2d / lib / filter.js View on Github external
x = b
        y = c
        z = a
      }
    } else if(c < a) {
      x = c
      y = a
      z = b
    }
    if(x < 0) {
      return -1
    }
    key[0] = x
    key[1] = y
    key[2] = z
    return bsearch.eq(this.cells, key, compareCell)
  }
})()
github mikolalysenko / cdt2d / lib / triangulation.js View on Github external
return function(i, j) {
    e[0] = Math.min(i,j)
    e[1] = Math.max(i,j)
    return bsearch.eq(this.edges, e, compareLex) >= 0
  }
})()
github emilbayes / eff-diceware-passphrase / index.js View on Github external
module.exports.indexOf = function (word) {
  assert(typeof word === 'string', 'word must be string')

  return binarySearch.eq(wordlist, word)
}
github mikolalysenko / l1-path-finder / clarkson.js View on Github external
function glueVertex(tree, e, v) {
    if(e[0] < tree.x) {
      glueVertex(tree.left, e, v)
    } else if(e[0] > tree.x) {
      glueVertex(tree.right, e, v)
    } else {
      var idx = bsearch.eq(tree.verts, e, comparePair)
      tree.edges[idx].push(v)
    }
  }
github mikolalysenko / local-perception-filter-demo / bundle.js View on Github external
function virtualKeyCode(key) {
  return bsearch.eq(keyNames, key)
}
github mikolalysenko / cdt2d / lib / monotone.js View on Github external
function mergeHulls(hulls, points, event) {
  //Swap pointers for merge search
  var tmp = event.a
  event.a = event.b
  event.b = tmp
  var mergeIdx = bsearch.eq(hulls, event, findSplit)
  var upper = hulls[mergeIdx]
  var lower = hulls[mergeIdx-1]
  lower.upperIds = upper.upperIds
  hulls.splice(mergeIdx, 1)
}
github mikolalysenko / game-shell / shell.js View on Github external
function virtualKeyCode(key) {
  return bsearch.eq(keyNames, key)
}

binary-search-bounds

Better binary searching

MIT
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis