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

June 2017

S M T W T F S
     1 2 3
4 5 67 8 9 10
11 12 13 14 15 16 17
18 19 20 21 222324
252627282930 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 22nd, 2017 06:29 pm
Powered by Dreamwidth Studios