output = {
const min = Math.min;
const n = histogram.length;
const a = Array(n).fill(0);
const Entropy = (A, B) => {
return Shannon(A) + Shannon(B);
};
const Albuquerque = (A, B) => {
const tA = Tsallis(A, q);
const tB = Tsallis(B, q);
return tA + tB + (1 - q) * tA * tB;
};
const Nie = (A, B) => {
return Masi(A, r) + Masi(B, r);
};
const LinOu = (A, B) => {
return min(Shannon(A), Tsallis(B, q));
};
const OuLin = (A, B) => {
return min(Tsallis(A, q), Shannon(B));
};
const MasiTsallis = (A, B) => {
return min(Masi(A, r), Tsallis(B, q));
};
const TsallisMasi = (A, B) => {
return min(Tsallis(A, q), Masi(B, r));
};
const methods = {
Entropy: Entropy,
Albuquerque: Albuquerque,
Nie: Nie,
LinOu: LinOu,
OuLin: OuLin,
MasiTsallis: MasiTsallis,
TsallisMasi: TsallisMasi
};
const method = methods[methodName];
for (let t = 1; t < n - 1; ++t) {
const A = histogram.slice(0, t);
const B = histogram.slice(t);
a[t] = method(A, B);
}
return a;
}