question: private double calculateEntropy ( double ... masses ) { double res = 0 ; for ( double d : masses ) { res -= ( d == 0 ) ? 0 : d * Math . log ( d ) ; } return res / LOG2 ; }
target:  Calculates the entropy corresponding to the input masses.