uncomplicate

2018-04-23T09:01:36.000229Z

@matan you copy! them to the subvectors of your matrix

2018-04-23T09:02:02.000296Z

but you also can read them directly into the matrix using entry!

2018-04-23T09:02:44.000529Z

might be native-float, but also cublas-float, or clblast-float, or whatever else you implement

2018-04-23T09:04:06.000333Z

row gets the raw access to the memory of the row elements of the matrix. then you can use copy! or entry! to set those elements. alter! is when you change those elements by applying a function to the old values.

2018-04-23T09:05:01.000105Z

in a general, I think that multiplication with a sparse matrix for the setup of its elements would be extremely ineficient.

2018-04-23T09:07:32.000065Z

I usually set up elements using entry!, or If my data is in another structure (seqs, clojure vectors, etc.) by providing them as constructor argument(s). Most of the time I am not setting elements explicitly, but by applying linear algebra operations, or calling functions that work with the whole structure in bulk.

2018-04-23T09:09:11.000021Z

if you just want to initialize all elements to one constant value, use something like (entry! m 1.0).

2018-04-23T15:06:10.000787Z

and yes, if you already have a matrix and need to transfer data to it, use transfer!

2018-04-23T15:07:00.000597Z

if there is not an implementation to transfer from/to the particular structure you have, write a specialized implementation of transfer! for it