Skip to content

Commit c1a7ff7

Browse files
committed
Add unrelated test
I wanted to get the test in anyway and this will hopefully get the CI unstuck.
1 parent cfe5e55 commit c1a7ff7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/pos/matrixOps.scala

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
object Test with
2+
3+
type Matrix = Array[Array[Double]]
4+
type Vector = Array[Double]
5+
6+
given (m: Matrix)
7+
def nRows = m.length
8+
def nCols = m(0).length
9+
def row(i: Int): Vector = m(i)
10+
def col(j: Int): Vector = Array.tabulate(m.length)(i => m(i)(j))
11+
12+
def pairwise(m: Matrix) =
13+
for
14+
i <- 0 until m.nRows
15+
j <- 0 until m.nCols
16+
yield
17+
m.row(i).zip(m.row(j)).map(_ - _).sum

0 commit comments

Comments
 (0)