Re: forpart of zero and fixed length

Bill Allombert <[email protected]>
Newsgroups gmane.comp.mathematics.pari.user
Message-ID <aCzYKaTWJLIwKW28@seventeen>
On Tue, May 20, 2025 at 02:52:20PM -0400, Max Alekseyev wrote:
> On a related note, I do not understand why I'm getting different results in
> the following two examples (fist one looks like a bug):
> 
> ? forpart(p=5,print(p),[0,5],[2,2])
> Vecsmall([1, 4])
> Vecsmall([2, 3])

This is correct: the length is the number of nonzero entries.

> ? forpart(p=5,print(p),[0,5],2)
> Vecsmall([0, 5])
> Vecsmall([1, 4])
> Vecsmall([2, 3])
> 
> Also, in the second case, shouldn't 2 be interpreted as nmax and partitions
> with smaller parts (=1) be also generated?

   By default, parts are positive and we remove zero entries unless amin <= 0, in which case we fix the size #X = nmax.

Cheers,
Bill.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.