Skip to content

Commit

Permalink
fixed warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
c committed Oct 5, 2023
1 parent 6a66281 commit 97d314c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ trait UnivariateHistogram[DOMAIN](using `#`: Numeric[DOMAIN]) {
val bucketWidth: Double = (MAX - min).toDouble / size.toDouble

protected val integerDigits: Int = Math.log10(MAX.toDouble).toInt + 1
protected val fractionDigits: Int = Math.log10( if (bucketWidth < 1.0) (1.0 / bucketWidth) else (100.0 / bucketWidth)).toInt + 1
protected val fractionDigits: Int = Math.log10( if (bucketWidth < 1.0) { 1.0 / bucketWidth } else { 100.0 / bucketWidth } ).toInt + 1

protected val binLabelFormat:String = s"%${integerDigits + fractionDigits + 1}.${fractionDigits}f"

Expand All @@ -53,8 +53,8 @@ trait UnivariateHistogram[DOMAIN](using `#`: Numeric[DOMAIN]) {
}

def binLabel(bINdex:Int):String = {
var floor = min.toDouble + (bINdex * bucketWidth)
var ceiling = floor + bucketWidth
val floor = min.toDouble + (bINdex * bucketWidth)
val ceiling = floor + bucketWidth
val lastBracket = if (bINdex >= size - 1) "]" else ")"
s"[${pad(floor)},${pad(ceiling)} $lastBracket"
}
Expand All @@ -72,7 +72,7 @@ trait UnivariateHistogram[DOMAIN](using `#`: Numeric[DOMAIN]) {
val end = index(MAX)

while (bIndex <= index(MAX)) {
maxBinMass = Math.max(maxBinMass, binMass((bIndex)) / mass)
maxBinMass = Math.max(maxBinMass, binMass(bIndex) / mass)
bIndex += 1
}

Expand Down Expand Up @@ -245,7 +245,7 @@ object UnivariateGenerativeModel {

var total:Double = 0.0

var end = hist.index(hist.MAX)
val end = hist.index(hist.MAX)
var bINdex: Int = hist.index(hist.min)

while (bINdex <= end) {
Expand Down

0 comments on commit 97d314c

Please sign in to comment.