juan_gandhi: (Default)
[personal profile] juan_gandhi
def matrix(h: VectorSpace, w: VectorSpace, values: Double*): Matrix[w.type, h.type] = {
val m = Matrix(w, h)
for {
i <- 0 until h.dim
j <- 0 until w.dim
} m(i, j) = values(i*w.dim+j)

m
}
The method is in a test, generates matrix from values.



Date: 2017-06-19 04:09 am (UTC)
From: [personal profile] andy_ivanov
Вот может пригодится http://hal.in2p3.fr/hal-01533675/document.
Там написано для Спарка
"Симметричная и асимметричная агрегированная функция в
Массивно параллельные вычисления
Чао Чжан, Фарук Тумани, Эммануэль Ганглер"

Date: 2017-06-19 07:33 am (UTC)
From: [personal profile] sassa_nf
Does it make sense to zip values and the tuples of dimensions? I don't know, maybe that's a waste.

Date: 2017-06-20 06:12 am (UTC)
From: [personal profile] sassa_nf
Maybe.

In its current form it is not obvious values are taken sequentially, or that the sizes of the values array and the matrix match.

Profile

juan_gandhi: (Default)
juan_gandhi

September 2017

S M T W T F S
      1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
1718 1920 21 2223
24252627282930

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 23rd, 2017 12:09 am
Powered by Dreamwidth Studios