bjonnh
05/16/2018, 4:58 PMfun kroneckerProduct_(x: MatrixStore<Double>, y: MatrixStore<Double>): MatrixStore<Double> {
val newRows = x.countRows() * y.countRows()
val newCols = x.countColumns() * y.countColumns()
val store = SparseStore.PRIMITIVE.make(newRows, newCols)
var count = 0
for (i in 0 until x.countRows()) {
for (k in 0 until y.countRows()) {
for (j in 0 until x.countColumns()) {
for (l in 0 until y.countColumns()) {
store.set((count/newRows)%newCols, count%newRows , x.get(i, j) * y.get(k, l))
count++
}
}
}
}
return store
}