[GiNaC-list] (no subject)

Javier Ros Ganuza jros at unavarra.es
Tue Mar 7 19:31:30 CET 2006


Hello! :)

When performing matrix multiplications expressions get expanded like in
the following Example.

Is there a way to avoid expansion, that is to leave the parenthesis

Thanks

Javier Ros


Example:
-----------------
matrix aux1

[[-d331*sin(q3)*dq3-d332*cos(q3)*dq3],[d331*cos(q3)*dq3-d332*sin(q3)*dq3],[0]]

matrix R23

[[cos(q3),-sin(q3),0],[sin(q3),cos(q3),0],[0,0,1]]

matrix R12.mul(aux1)

[[d332*sin(q2)*sin(q3)*dq3-d331*cos(q2)*sin(q3)*dq3-d332*cos(q3)*cos(q2)*dq3-d331*sin(q2)*cos(q3)*dq3],[-d332*cos(q2)*sin(q3)*dq3-d331*sin(q2)*sin(q3)*dq3+d331*cos(q3)*cos(q2)*dq3-d332*sin(q2)*cos(q3)*dq3],[0]]
-----------------

What I want is to obtain something like

cos(q3)*(-d331*sin(q3)*dq3-d332*cos(q3)*dq3)+.... and so on for the
first (0,0) matrix element.






More information about the GiNaC-list mailing list