Interpolation expose ending refinement interations to othre fn

This commit is contained in:
Pitchaya Boonsarngsuk
2018-01-31 16:04:19 +00:00
parent 7bb1cd755b
commit 0b0cd6d545
3 changed files with 11 additions and 9 deletions

View File

@@ -22,7 +22,7 @@ import {placeNearToNearestNeighbour} from "./interpCommon";
* @param {number} endingIts - for phase 3, how many iterations to refine the
* placement of each interpolated point
*/
export default function(sampleSet, remainderSet, numPivots, distanceFn) {
export default function(sampleSet, remainderSet, numPivots, distanceFn, endingIts) {
// Pivot based parent finding
let numBuckets = Math.floor(Math.sqrt(sampleSet.length));
let sets = takeSampleFrom(sampleSet, numPivots);
@@ -126,6 +126,6 @@ export default function(sampleSet, remainderSet, numPivots, distanceFn) {
if (sampleSubsetDistanceCache[k] === undefined)
sampleSubsetDistanceCache[k] = distanceFn(node, sampleSubset[k]);
}
placeNearToNearestNeighbour(node, nearSample, minDist, sampleSubset, sampleSubsetDistanceCache);
placeNearToNearestNeighbour(node, nearSample, minDist, sampleSubset, sampleSubsetDistanceCache, endingIts);
}
}