Pascal Molin on Tue, 04 Jun 2013 22:43:28 +0200


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

Re: new GP loop: forpart()


I have commited to pascal-forpart a forpart_prev that goes backward.

A flag allows to choose the direction of forpart: by default from [1,1,1] to [3].

--
Pascal


2013/6/1 Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>
On Sat, Jun 01, 2013 at 07:46:15PM +0200, Joerg Arndt wrote:
> * Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr> [May 30. 2013 14:06]:
> > Dear PARI developers,
> >
> > I have commited a patch by Pascal and myself that adds GP function
> > to loop over partitions:
> >
> > forpart(v=5,print(v))
> > Vecsmall([1,1,1,1,1])
> > Vecsmall([1,1,1,2])
> > Vecsmall([1,2,2])
> > Vecsmall([1,1,3])
> > Vecsmall([2,3])
> > Vecsmall([1,4])
> > Vecsmall([5])
> >
> > Also I have changed the partitions function to provide the same interface
> > as forpart. An unfortunate side effect is that the order of the partitions
> > is reversed.
>
> With "reversed" you mean: they are lists in ascending order?

No: they are listED in ascending order, see the example above.

> Please see
> Â http://jjj.de/fxt/demo/comb/index.html#partition-asc
> programmed and uploaded a minute ago. ÂThere, in
> Â http://jjj.de/fxt/demo/comb/partition-asc.h
> see the method prev()

Could you write a GP function that take a partition and return the previous one
according to forpart order, and that work even when abound and nbound are specified ?

Cheers,
Bill.