fix: stabilize localization comparison semantics
This commit is contained in:
@@ -25,9 +25,9 @@ function requestedAlgorithm(options) {
|
||||
*/
|
||||
export function estimateLocalizationWorkload(options) {
|
||||
const algorithm = requestedAlgorithm(options);
|
||||
return isDasAlgorithm(algorithm.id)
|
||||
? estimateDasWorkload(options)
|
||||
: estimateGccPhatWorkload(options);
|
||||
if (isDasAlgorithm(algorithm.id)) return estimateDasWorkload(options);
|
||||
if (algorithm.id === "gcc-phat") return estimateGccPhatWorkload(options);
|
||||
throw new RangeError("No workload estimator is registered for " + algorithm.id + ".");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,9 +35,9 @@ export function estimateLocalizationWorkload(options) {
|
||||
*/
|
||||
export function createLocalizationAnalysisPlan(options) {
|
||||
const algorithm = requestedAlgorithm(options);
|
||||
return isDasAlgorithm(algorithm.id)
|
||||
? createDasAnalysisPlan(options)
|
||||
: createGccPhatAnalysisPlan(options);
|
||||
if (isDasAlgorithm(algorithm.id)) return createDasAnalysisPlan(options);
|
||||
if (algorithm.id === "gcc-phat") return createGccPhatAnalysisPlan(options);
|
||||
throw new RangeError("No analysis-plan factory is registered for " + algorithm.id + ".");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ export function createLocalizationAnalysisPlan(options) {
|
||||
*/
|
||||
export async function computeLocalizationMap(options) {
|
||||
const algorithm = requestedAlgorithm(options);
|
||||
return isDasAlgorithm(algorithm.id)
|
||||
? computeDasMap(options)
|
||||
: computeGccPhatMap(options);
|
||||
if (isDasAlgorithm(algorithm.id)) return computeDasMap(options);
|
||||
if (algorithm.id === "gcc-phat") return computeGccPhatMap(options);
|
||||
throw new RangeError("No CPU localization implementation is registered for " + algorithm.id + ".");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user