[Scilab-users] vector product (hyper)matrix and vector
Samuel Gougeon
sgougeon at free.fr
Sun May 28 05:42:07 CEST 2017
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170528/ab51bc49/attachment.htm>
More information about the users
mailing list