Richard Heylen on Thu, 17 Oct 2013 21:42:53 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: gp/pari version of the "Map" datatype and "reduce" function
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: gp/pari version of the "Map" datatype and "reduce" function
- From: Richard Heylen <richardheylen@gmail.com>
- Date: Thu, 17 Oct 2013 20:42:42 +0100
- Delivery-date: Thu, 17 Oct 2013 21:42:53 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=mUBc/Zm1m6kEZVt8yfzpJeitx8OeygBz0IiwauHC47s=; b=BqNhTk6mQU/aAEHwRSObsf5KA48QJDI7Cav8CZstbOfN9vSCzg+o7nrcIsMoAYhTv6 Sc1B42U7EStdWImpAxiDTeCgNXME5WCIdSSijOVY8ahrz1XLOeskYkRSAGQbxZ1sgbHw NHCtDToYrnPvum13UMsi7NTlJlclNBP5YBY+qSCFOcx5J9Nz8duMnkesYtKzTz5mfWTa XtwWPaNDx31GjlK2wFb40ATR9Z0btJKnI+WNZQX4JIdmBwC3Q4ueK3M/E8zn48K6p+BE 6cmMPIg0soDZ/ZYMSwcP3hBZVKq0KLx7z4dcIkaks/RdCVWz2NKFfd7z+ghkw5y5pdd7 KPxw==
- In-reply-to: <20131017181230.GA17124@yellowpig>
- References: <CAGeO=y28ziR_rer=zxJAqYY=+_xh_WRLQWL+gyDHJJ5XT46zDQ@mail.gmail.com> <20131017114210.GD11344@yellowpig> <CAAkfSGJHwpm3gSDDh=Bq-+huvJ3M0Riw-MgX_x+eOoT0KVYU0Q@mail.gmail.com> <20131017181230.GA17124@yellowpig>
I would strongly recommend that an initial value is passed in so that
the function is called once per element. T
On 17 October 2013 19:12, Bill Allombert
<Bill.Allombert@math.u-bordeaux1.fr> wrote:
> On Thu, Oct 17, 2013 at 01:11:18PM -0400, Charles Greathouse wrote:
>> I think "fold" is good and avoids clashes.
>
> There is the question of associativity.
> I suggest we make it strictly less associative.
>
> However to answer Richard, lots of GP functions fold automatically, or
> there are variants that do:
>
> ? vecmax([1,2,3])
> %2 = 3
> ? gcd([4,6,9])
> %3 = 1
> ? factorback([1,2,3,4])
> %4 = 24
>
> Cheers,
> Bill.
>