On Fri, Feb 03, 2012 at 03:53:10AM -0800, Martin Baker wrote:
> relative performance issues so I will leave you to choose whether to
> substitute this:
well I did some measurements which indicate that you code is faster,
the difference increasing with the size of the matrices.
Profiling indicates that horizConcat and vertConcat seem to add
avoidable overhead. Don't know whether it can be improved,
that's perhaps the price to pay for compactness.
Trying map from MATCAT2,
with the function  aij +-> aij*B fails with the error

   "Function:  0 : () -> % is missing from domain: Matrix(Float)"

here is the test (debian amd64):

g:=normal(0,1)$RFDIST

randmat(n) ==
  matrix [[g() for i in 1..n] for j in 1..n]

for k in 1..100 repeat A:=tensorProduct(randmat(10),randmat(10));
                                                           Type: Void
                                           Time: 3.36 (EV) = 3.36 sec
for k in 1..100 repeat A:=kroneckerProduct(randmat(10),randmat(10));
                                                           Type: Void
                  Time: 0.004 (IN) + 3.18 (EV) + 0.01 (OT) = 3.20 sec
for k in 1..100 repeat A:=tensorProduct(randmat(20),randmat(10));
                                                           Type: Void
                                         Time: 14.71 (EV) = 14.71 sec
for k in 1..100 repeat A:=kroneckerProduct(randmat(20),randmat(10));
                                                           Type: Void
                                         Time: 11.67 (EV) = 11.67 sec
for k in 1..100 repeat A:=tensorProduct(randmat(30),randmat(30));
                                                           Type: Void
                                       Time: 386.77 (EV) = 386.77 sec
for k in 1..100 repeat A:=kroneckerProduct(randmat(30),randmat(30));
                                                           Type: Void
                                       Time: 248.20 (EV) = 248.20 sec

best,
Franz

-- 
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.

Reply via email to