Re: [sage-support] IntegerVectors question

2012-05-18 Thread Emil
On 18 May 2012 18:48, Emil wrote: > Looking at the code, the cardinality() is done sensibly for > IntegerVectors_nkconstraints, but not for IntegerVectors_nk, which is > what will be used by default. It should be a simple patch (I can do it > if no-one else wants to) - as the code is essentially a

Re: [sage-support] IntegerVectors question

2012-05-18 Thread Emil
Looking at the code, the cardinality() is done sensibly for IntegerVectors_nkconstraints, but not for IntegerVectors_nk, which is what will be used by default. It should be a simple patch (I can do it if no-one else wants to) - as the code is essentially already there in IntegerVectors_nkconstraint

Re: [sage-support] IntegerVectors question

2012-05-18 Thread David Loeffler
The size of this set is the binomial coefficient (m + n - 1) choose ( n - 1 ). David On 17 May 2012 14:26, Martin Albrecht wrote: > Hi, > > currently when running e.g. > > sage: IV53 = IntegerVectors(5,3) # length 3 vectors that sum to 5 > sage: IV53.cardinality() > > The algorithm is simply to

[sage-support] IntegerVectors question

2012-05-17 Thread Martin Albrecht
Hi, currently when running e.g. sage: IV53 = IntegerVectors(5,3) # length 3 vectors that sum to 5 sage: IV53.cardinality() The algorithm is simply to enumerate all elements (which is the default algorithm). My question is: is that because that's the best we can do, or just because nobody sat