Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Quafadas committed Nov 14, 2023
1 parent 18da4ef commit 1004242
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/js/src/main/scala/vecxt/array.extensions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ package object vecxt:

end extension

extension (vec: Array[Float64Array])
extension (vec: Seq[Float64Array])
inline def horizontalSum: Float64Array =
val out = new Float64Array(vec.head.length)
var i = 0
Expand Down
2 changes: 1 addition & 1 deletion core/jvm/src/main/scala/vecxt/array.extensions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ package object vecxt:

end extension

extension (vec: Array[Array[Double]])
extension (vec: Seq[Array[Double]])
inline def horizontalSum: Array[Double] =
val out = new Array[Double](vec.head.length)
var i = 0
Expand Down
2 changes: 1 addition & 1 deletion core/native/src/main/scala/vecxt/array.extensions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ package object vecxt:

end extension

extension (vec: Array[Array[Double]])
extension (vec: Seq[Array[Double]])
inline def horizontalSum: Array[Double] =
val out = new Array[Double](vec.head.length)
var i = 0
Expand Down
4 changes: 2 additions & 2 deletions tests/shared/src/test/scala/arrayExtensions.test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class ArrayExtensionSuite extends munit.FunSuite:
val v2 = v1 * 2.0
val v3 = v1 * 3.0

val l = Array(v1, v2, v3)
val summed = l.horizontalSum
val l = List(v1, v2, v3)
val summed = l.toIndexedSeq.horizontalSum

assert(summed(0) == 1 + 2 + 3)
assert(summed(1) == 2 + 4 + 6)
Expand Down

0 comments on commit 1004242

Please sign in to comment.