Martin Baker wrote:
>
> On Thursday 02 Feb 2012 19:16:51 Waldek Hebisch wrote:
> > I do not think we have this operation. We could add this, however:
>
> I have added Kronecker product and Kronecker sum to Matrix code here:
> https://github.com/martinbaker/fricas/blob/master/src/algebra/matrix.spad.p=
> amphlet
>
> Its probably better if you make any changes to RepresentationPackage1.
>
> > - currently inner loop is wasting work testing for equality of
> > indices, I think it is possible to eliminate it
>
> I have put 2 versions of kroneckerSum in the above code (kroneckerSum
> and kroneckerSum2) because I'm not sure which is most efficient,
> please delete the one that you like the least.
I have decided to use a somewhat different version, which directly
computes product and sum for list of matrices. Two argument
version just builds list and calls list version. There is small
overhead due to this, but it should be negligible except for
very small matrices. But I did a few optimizations, so even
for small matrices the new kroneckerProduct should be faster
than old tensorProduct. One certainly could do more optimizations,
but I think that current version is good enough. I have now
commited it to MatrixCategory, that way it will work not
only for Matrix but also for some other kings of Matrices.
I hope that this gives what you need for graphs.
--
Waldek Hebisch
[email protected]
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en.