Skip to content

Commit c95d5c2

Browse files
committed
fix: Use java.lang.Double.isFinite for Scala 2.12 compatibility
1 parent baea713 commit c95d5c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/scala/com/massivedatascience/clusterer/ml/df/kernels/SequenceKernel.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ class SoftDTWKernel(
267267

268268
/** Soft minimum: -γ log(Σ exp(-x_i/γ)) */
269269
private def softMin(values: Double*): Double = {
270-
val filtered = values.filter(_.isFinite)
270+
val filtered = values.filter(java.lang.Double.isFinite)
271271
if (filtered.isEmpty) Double.PositiveInfinity
272272
else {
273273
val maxVal = filtered.max
@@ -591,7 +591,7 @@ object DTWBarycenter {
591591
val dtw = Array.fill(n)(Array.fill(m)(Double.PositiveInfinity))
592592
def d(i: Int, j: Int): Double = { val diff = x(i) - y(j); diff * diff }
593593
def softMin(a: Double, b: Double, c: Double): Double = {
594-
val vals = Array(a, b, c).filter(_.isFinite)
594+
val vals = Array(a, b, c).filter(java.lang.Double.isFinite)
595595
if (vals.isEmpty) Double.PositiveInfinity
596596
else {
597597
val maxV = vals.max

0 commit comments

Comments
 (0)