I have translated the Haskell code for vector partitions by M. C. Err, The 
Computer Journal, Vol. 31, 1988, 283-284, into Python (2 or 3, stand-alone 
file with 60 lines total).

The code works significantly faster than the Sage implementation:

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.0, Release Date: 2020-01-01                     │
│ Using Python 3.7.3. Type "help()" for help.                        │
└────────────────────────────────────────────────────────────────────┘
sage: import vpartitions
sage: %time myvparts=vpartitions.vPartitionso([6,6,6])
CPU times: user 9.13 s, sys: 89.8 ms, total: 9.22 s
Wall time: 9.22 s
sage: %time sagevparts=list(VectorPartitions([6,6,6]))
CPU times: user 2min 10s, sys: 177 ms, total: 2min 10s
Wall time: 2min 10s
sage: myvparts[::-1]==sagevparts
True

If someone would take over the job of contributing this code to Sage, I 
would be glad to help. There are a few caveats:

1) the code is recursive;
2) there is no "min" option like in the Sage implementation.

I do not know how difficult (or necessary) it would be to address these 
points.

Of course, anyone can take it up straight from Err's paper instead, I won't 
be jealous:)

Cheers,

Denis

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-combinat-devel/5997b88f-50fb-4bc3-a5a7-b6accfa9e190%40googlegroups.com.

Reply via email to