1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-25 15:42:41 +02:00

refactor: rename

This commit is contained in:
Justin Lin
2022-03-21 14:59:05 +08:00
parent a9b40f133b
commit 7e66869bca

View File

@@ -72,10 +72,10 @@ function _wf_collapse(wf, x, y, states, weights, leng, threshold, i = 0) =
// Shannon entropy
function wf_entropy(wf, x, y) =
let(
weights = wf_weights(wf),
states_weights = [for(state = wf_eigenstates_at(wf, x, y)) hashmap_get(weights, state)],
sumOfWeights = sum(states_weights),
sumOfWeightLogWeights = sum([for(w = states_weights) w * ln(w)])
all_weights = wf_weights(wf),
weights = [for(state = wf_eigenstates_at(wf, x, y)) hashmap_get(all_weights, state)],
sumOfWeights = sum(weights),
sumOfWeightLogWeights = sum([for(w = weights) w * ln(w)])
)
ln(sumOfWeights) - (sumOfWeightLogWeights / sumOfWeights);