Bill Allombert on Wed, 04 Dec 2024 20:12:56 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: setunion() on a vector of sets
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: setunion() on a vector of sets
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Wed, 4 Dec 2024 20:12:49 +0100
- Delivery-date: Wed, 04 Dec 2024 20:12:56 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=math.u-bordeaux.fr; s=2022; t=1733339574; bh=tPvDUASw8d3dTqHGn+Z6J8rt0FaY+zIvszSzSaZtqIk=; h=Date:From:To:Subject:References:In-Reply-To:From; b=jW+nUq6KdvG5KqzGJ19efaoPTmqf+qC26XPrfHjhzYplkRYnCYXqsxLfG65tIujny UGKz1TX9NdBmA1KNC8ujlG4bXSfH0XWeMlFpItGIiel1ckQ9cTk6+xtqgGOUtLAbGC it7KVCd0Y0EJLbrd92Xfb+XYgCDlbbTavBZZJFG3PG5KykjRw8LA9ggl/zP1TMJvG3 bZYQkgCqi+MJKw+oq0zARfxhTXy77N5pG3Ih0K3yKkqi87KPBh6yYizAZbcmYjKlMa njJir/bwfBQ/b5WvA1FMUMGvVqiV06VzBNNqmZG7mnRDpD8mshcWRYUisI8pU+QxKN p3/CY3fwpo/e4XfzIuhOiDVW7VxAxy7XbAVsFf/91lhUgGOwmFK1Tj7dlStYTeES0X pykSMc+0Yv6/LyXbxBexC7c17it/77tFSQYahMtm5YLEHHJBVVF0VG4bqtqtQI1AA0 L4vOARY9wqocINGQKHpLndhzqqBEn2lR08NLRqB14Kl1kK11Zu5q8xYiwayODbDlKd J3xGxhZtjnJiXviDsZyJZclBV2DgvSIManWECuYA8tFD42h/lK6LcP2YFIbEeemfbS JLyCHD+qtY67aRLaVaOmigheP510mr08f8sOF03LzeLUuC8FfQJhHf7K5JWCz3eW9M F7TDikrwXhnMDZMBXaLaFVr8=
- In-reply-to: <CANXmBjzMcgg3WOaC1cHZcC4sYxTe09EPABdmcCHYt8uOA3Pz4Q@mail.gmail.com>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <CAJkPp5PMh7rQxkOEwVAaq6q6EesjETx2H=bZ1e_MA65AcvRWow@mail.gmail.com> <Z1Bu48JH36OPnFxZ@seventeen> <CAJkPp5MPjMnbS-cpLDsNSBGb5C0Gj8NXxDFDFnajjNJJBQTR0w@mail.gmail.com> <CANXmBjzMcgg3WOaC1cHZcC4sYxTe09EPABdmcCHYt8uOA3Pz4Q@mail.gmail.com>
On Wed, Dec 04, 2024 at 01:51:54PM -0500, Charles Greathouse wrote:
> It wouldn't be hard, I think -- just naively calling fold gives something
> like
>
> GEN
> setunion0(GEN x, GEN y)
> {
> if(y) return setunion(x, y);
> pari_sp ltop = avma;
> GEN res = genfold(strtofunction("setunion"), gp_call2, x);
> res = gerepilecopy(ltop, p1);
> return res;
> }
>
> and it could always be optimized later if there was a need.
Look for gassoc_proto instead, but this is not optimal either:
the union can be computed in one pass.
But then Max will ask the same for setintersect, setdelta, etc.
This is not sustainable.
Cheers,
Bill.