Bill Allombert on Sun, 25 Feb 2018 11:17:28 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: forpart() behavior


On Sat, Feb 24, 2018 at 05:26:51PM -0500, Max Alekseyev wrote:
> On Sat, Feb 24, 2018 at 4:50 PM, Bill Allombert
> <Bill.Allombert@math.u-bordeaux.fr> wrote:
> > On Sat, Feb 24, 2018 at 04:24:15PM -0500, Max Alekseyev wrote:
> >> Dear Bill,
> >>
> >> Could you please support of partitions of 0 when amin=0 as in
> >> "forpart(p=0,print(p),[0,5],3)"?
> >> It would be very natural to produce a vector of all zeros.
> >
> > this is inconsistent with the documentation: the result must
> > be a vector with 3 non-zero components.
> 
> Why?
> According to the documentation, nmax when amin=0 gives the length
> (i.e., number of components), but the components don't have to be all
> nonzero.
> E.g., similar construction for partitions of 1 gives a vector with 3
> components, with only one of them being nonzero.
> 
> ? forpart(p=1,print(p),[0,5],3)
> Vecsmall([0, 0, 1])

Ah yes, I mixed 3 and [3,3].

Cheers,
Bill.