MCPcopy Create free account
hub / github.com/breck7/scroll / getSparsity

Method getSparsity

external/.scrollLibs.js:15523–15533  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15521 return copy
15522 }
15523 getSparsity() {
15524 const particles = this.getSubparticles()
15525 const fields = this._getUnionNames()
15526 let count = 0
15527 this.getSubparticles().forEach(particle => {
15528 fields.forEach(field => {
15529 if (particle.has(field)) count++
15530 })
15531 })
15532 return 1 - count / (particles.length * fields.length)
15533 }
15534 // todo: rename. what is the proper term from set/cat theory?
15535 getBiDirectionalMaps(propertyNameOrFn, propertyNameOrFn2 = particle => particle.getAtom(0)) {
15536 const oneToTwo = {}

Callers

nothing calls this directly

Calls 4

getSubparticlesMethod · 0.95
_getUnionNamesMethod · 0.95
forEachMethod · 0.80
hasMethod · 0.45

Tested by

no test coverage detected