fix remove nested tuple

This commit is contained in:
denon1 2023-04-01 11:48:24 +02:00
parent dbb0a4b263
commit 76ce702f9d

View File

@ -48,10 +48,10 @@ object EigenVectorsForSparseSymmetric {
val partialNonzeros = nonzeros.foldRight(baseCase)
val (matrix, numEntries, maxRow, maxCol) = partialNonzeros{
case ((i, j, v), (matrix, numEntries, maxRow, maxCol) ) => (i, j) match {
case (_, _) if (i > maxRow) && (j > maxCol) => (matrix.set(i, j, v), (numEntries += 1, i, j))
case (_, _) if (i > maxRow) => (matrix.set(i, j, v), (numEntries += 1, i, maxCol))
case (_, _) if (j > maxCol) => (matrix.set(i, j, v), (numEntries += 1, maxRow, j))
case (_, _) => (matrix.set(i, j, v), (numEntries += 1, maxRow, maxCol))
case (_, _) if (i > maxRow) && (j > maxCol) => (matrix.set(i, j, v), numEntries += 1, i, j)
case (_, _) if (i > maxRow) => (matrix.set(i, j, v), numEntries += 1, i, maxCol)
case (_, _) if (j > maxCol) => (matrix.set(i, j, v), numEntries += 1, maxRow, j)
case (_, _) => (matrix.set(i, j, v), numEntries += 1, maxRow, maxCol)
}
}