@thi.ng/geom-accel
Advanced tools
Comparing version 1.1.17 to 1.2.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@1.1.17...@thi.ng/geom-accel@1.2.0) (2019-07-07) | ||
### Features | ||
* **geom-accel:** enable TS strict compiler flags (refactor) ([e19e6bc](https://github.com/thi-ng/umbrella/commit/e19e6bc)) | ||
## [1.1.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@1.1.16...@thi.ng/geom-accel@1.1.17) (2019-05-22) | ||
@@ -8,0 +19,0 @@ |
import { ICopy, Pair } from "@thi.ng/api"; | ||
import { ISpatialAccel } from "@thi.ng/geom-api"; | ||
import { ReadonlyVec } from "@thi.ng/vectors"; | ||
declare type MaybeKdNode<K extends ReadonlyVec, V> = KdNode<K, V> | null; | ||
export declare class KdNode<K extends ReadonlyVec, V> { | ||
parent: KdNode<K, V>; | ||
l: KdNode<K, V>; | ||
r: KdNode<K, V>; | ||
parent: KdNode<K, V> | null; | ||
l: KdNode<K, V> | null; | ||
r: KdNode<K, V> | null; | ||
d: number; | ||
k: K; | ||
v: V; | ||
constructor(parent: KdNode<K, V>, dim: number, key: K, val: V); | ||
constructor(parent: MaybeKdNode<K, V>, dim: number, key: K, val: V); | ||
[Symbol.iterator](): IterableIterator<Pair<K, V>>; | ||
keys(): IterableIterator<K>; | ||
height(): any; | ||
height(): number; | ||
} | ||
@@ -24,3 +25,3 @@ /** | ||
export declare class KdTree<K extends ReadonlyVec, V> implements ICopy<KdTree<K, V>>, ISpatialAccel<K, V> { | ||
root: KdNode<K, V>; | ||
root: KdNode<K, V> | null; | ||
dim: number; | ||
@@ -43,4 +44,5 @@ protected _length: number; | ||
balanceRatio(): number; | ||
protected buildSelection(q: Readonly<K>, maxNum: number, maxDist?: number): [number, KdNode<K, V>][]; | ||
protected buildTree(points: Pair<K, V>[], depth: number, parent: KdNode<K, V>): KdNode<K, V>; | ||
protected buildSelection(q: Readonly<K>, maxNum: number, maxDist?: number): [number, KdNode<K, V> | null][]; | ||
protected buildTree(points: Pair<K, V>[], depth: number, parent: KdNode<K, V> | null): KdNode<K, V> | null; | ||
} | ||
export {}; |
@@ -112,3 +112,3 @@ import { ensureArray } from "@thi.ng/arrays"; | ||
has(k, eps = EPS) { | ||
return (this.root && | ||
return (!!this.root && | ||
!!nearest1(k, [eps * eps, null], [], this.dim, this.root)[1]); | ||
@@ -173,3 +173,5 @@ } | ||
buildSelection(q, maxNum, maxDist = Infinity) { | ||
const nodes = new Heap(null, { compare: CMP }); | ||
const nodes = new Heap(null, { | ||
compare: CMP | ||
}); | ||
maxDist *= maxDist; | ||
@@ -186,3 +188,3 @@ const c = [maxDist, null]; | ||
if (n === 0) { | ||
return; | ||
return null; | ||
} | ||
@@ -218,3 +220,3 @@ this._length++; | ||
if (!node) | ||
return; | ||
return null; | ||
if (node.d === dim) { | ||
@@ -221,0 +223,0 @@ return node.l ? findMin(node.l, dim) : node; |
@@ -110,3 +110,3 @@ 'use strict'; | ||
has(k, eps = math.EPS) { | ||
return (this.root && | ||
return (!!this.root && | ||
!!nearest1(k, [eps * eps, null], [], this.dim, this.root)[1]); | ||
@@ -171,3 +171,5 @@ } | ||
buildSelection(q, maxNum, maxDist = Infinity) { | ||
const nodes = new heaps.Heap(null, { compare: CMP }); | ||
const nodes = new heaps.Heap(null, { | ||
compare: CMP | ||
}); | ||
maxDist *= maxDist; | ||
@@ -184,3 +186,3 @@ const c = [maxDist, null]; | ||
if (n === 0) { | ||
return; | ||
return null; | ||
} | ||
@@ -209,3 +211,3 @@ this._length++; | ||
if (!node) | ||
return; | ||
return null; | ||
if (node.d === dim) { | ||
@@ -212,0 +214,0 @@ return node.l ? findMin(node.l, dim) : node; |
@@ -107,3 +107,3 @@ (function (global, factory) { | ||
has(k, eps = math.EPS) { | ||
return (this.root && | ||
return (!!this.root && | ||
!!nearest1(k, [eps * eps, null], [], this.dim, this.root)[1]); | ||
@@ -168,3 +168,5 @@ } | ||
buildSelection(q, maxNum, maxDist = Infinity) { | ||
const nodes = new heaps.Heap(null, { compare: CMP }); | ||
const nodes = new heaps.Heap(null, { | ||
compare: CMP | ||
}); | ||
maxDist *= maxDist; | ||
@@ -181,3 +183,3 @@ const c = [maxDist, null]; | ||
if (n === 0) { | ||
return; | ||
return null; | ||
} | ||
@@ -206,3 +208,3 @@ this._length++; | ||
if (!node) | ||
return; | ||
return null; | ||
if (node.d === dim) { | ||
@@ -209,0 +211,0 @@ return node.l ? findMin(node.l, dim) : node; |
{ | ||
"name": "@thi.ng/geom-accel", | ||
"version": "1.1.17", | ||
"version": "1.2.0", | ||
"description": "nD spatial indexing data structures", | ||
@@ -28,16 +28,16 @@ "module": "./index.js", | ||
"@types/mocha": "^5.2.6", | ||
"@types/node": "^11.13.7", | ||
"@types/node": "^12.0.8", | ||
"mocha": "^6.1.4", | ||
"nyc": "^14.0.0", | ||
"typedoc": "^0.14.2", | ||
"typescript": "^3.4.5" | ||
"typescript": "^3.5.2" | ||
}, | ||
"dependencies": { | ||
"@thi.ng/api": "^6.2.0", | ||
"@thi.ng/arrays": "^0.1.9", | ||
"@thi.ng/geom-api": "^0.2.3", | ||
"@thi.ng/heaps": "^1.0.10", | ||
"@thi.ng/math": "^1.3.0", | ||
"@thi.ng/transducers": "^5.3.7", | ||
"@thi.ng/vectors": "^2.5.6" | ||
"@thi.ng/api": "^6.3.0", | ||
"@thi.ng/arrays": "^0.2.0", | ||
"@thi.ng/geom-api": "^0.2.4", | ||
"@thi.ng/heaps": "^1.1.0", | ||
"@thi.ng/math": "^1.4.0", | ||
"@thi.ng/transducers": "^5.4.0", | ||
"@thi.ng/vectors": "^3.0.0" | ||
}, | ||
@@ -61,3 +61,3 @@ "keywords": [ | ||
"sideEffects": false, | ||
"gitHead": "5a4226d52724f320fb25656f08addb2825375fee" | ||
"gitHead": "efa9fdd61dd4ad2187cefe0a26df3bf2baade24b" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
77307
1038
- Removed@thi.ng/arrays@0.1.9(transitive)
- Removed@thi.ng/vectors@2.5.6(transitive)
Updated@thi.ng/api@^6.3.0
Updated@thi.ng/arrays@^0.2.0
Updated@thi.ng/geom-api@^0.2.4
Updated@thi.ng/heaps@^1.1.0
Updated@thi.ng/math@^1.4.0
Updated@thi.ng/transducers@^5.4.0
Updated@thi.ng/vectors@^3.0.0