[Scilab-users] vector product (hyper)matrix and vector

Adelson Oliveira adelson.oliveira at gmail.com
Sun May 28 17:14:35 CEST 2017


Well, I guess this is not the most efficient way to do this, is it? I mean,
there are a lot of copies and temporary files ...

2017-05-28 0:42 GMT-03:00 Samuel Gougeon <sgougeon at free.fr>:

> Le 28/05/2017 à 03:55, Adelson Oliveira a écrit :
>
> Thanks,
>
> The trick is to create an auxiliar matrix "A" where replics of array "a"
> fill the columns and to perform regular elemental multiplications with a
> reshaped version of the target hypermatrix "H" and then reshape the result
> as original H. It maybe fast because of vectorization but I still have two
> questions. This demands addtional memory space if one cannot to do
> everything in one step,
>
> and, would it be possible to multiply a line vector "b=(1:5)" to all lines of "H" or another array
>
> "c" to the third dimension of H in a vectorized way?
>
>
> Yes: you must first use permute() to put in first position the dimension
> along which you want to multiply the vector, then process as before, and
> finally re-permute() the result in the reverse way.
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170528/6b577c21/attachment.htm>


More information about the users mailing list