[scilab-Users] SciLab question dealing with linear algebra / tensor multiplication.
Mike Page
Mike at Page-One.Waitrose.com
Wed May 19 20:54:20 CEST 2010
Hi Julien,
You can use the matrix( ) function to format the data back as a matrix. In
your case:
B = matrix (A(1, :, :), ,j, k);
will do what you want I think.
Be careful that you understand the data ordering that Scilab uses when
storing Hypermatrices, or you may get the result permuted in the wrong way.
There is also a useful function permute (), which allows you to "transpose"
hypermatrices. I'm not sure it's what you need, but check it out anyway.
HTH.
Mike.
-----Original Message-----
From: Julien Colmars [mailto:julien.colmars at imelavi.fr]
Sent: 19 May 2010 18:42
To: users at lists.scilab.org
Subject: [scilab-Users] SciLab question dealing with linear algebra /
tensor multiplication.
Hi,
I've a SciLab problem dealing with linear algebra / tensor multiplication.
Let's say I have a matrix A wich size is i * j * k ( is it called a matrix
in SciLab ? a 3rd order tensor ? a table ?...)
SciLab knows that A(:,:,1) is a matrix, and SciLab is able to multiply it
with another matrix...
But it is not the case of A(1,:,:) for example.... which seems to be a
table of 2 1x2 vectors. [at least in SciLab 4.2.1]
I'm looking for an elegant solution to avoid many loops... my calculation
is becoming too slow :
So these are my questions :
a.. why it is not implemented in SciLab ? (sorry for this naive
question) Is there a specific reason not to authorize to build a matrix from
table values ?
b.. How could it be done (call to external C/Fortran routine or specific
linear algebra libraries) ?
c.. Is it possible to simply make a permutation of two subscript : for
example from A(i,j,k) I want to get B = A(k,j,i) ? This way I could make my
basic multiplications...
I hope it is clear enough...
Thank you in advance for your help.
Julien Colmars
PhD student,
Équipe Mécanique de l'Arbre et du Bois
Laboratoire de Mécanique et Génie Civil
Adresse : LMGC - UMR5508
Université Montpellier 2
CC 048 Place Eugène Bataillon
34090 Montpellier, France
Tel. : +33 (0)4 67 14 96 42
Fax. : +33 (0)4 67 14 47 92
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20100519/71292eda/attachment.htm>
More information about the users
mailing list