Karim Belabas on Fri, 03 Nov 2023 15:59:00 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: asking for a new GP-Pari command
|
- To: John Cremona <john.cremona@gmail.com>
- Subject: Re: asking for a new GP-Pari command
- From: Karim Belabas <Karim.Belabas@u-bordeaux.fr>
- Date: Fri, 3 Nov 2023 15:58:51 +0100
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1699023534; c=relaxed/relaxed; bh=zEgOra7ffJU0pH1SNodqAw2T3xXdoyH/47IRVnA4cLo=; h=Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References: MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; b=ULsqPPeciADiz0gXjPScz+3oKHQWQFITpkb8ao+ffxjAbIs186HYA/1T1A+mHchDdwMZWcazERAJEhLeDdfWswnyAIJ+oaOq28ge6dJkm6WF6qobefNZrpQO/P9/BrUPB2io/yq60Xa6sFeo0ll+9Gj2pWtDlQ9QBtHaKytAQ+GYk2d4+gn5eVXzbXpDBomTTuO9th5z6dNd4pCdYVEAnkliF7FKc5Ot4ExnzX9niev3VnwpB5YmQeoRBJnZIVi0Hl9wvcPmI29gHAQZQKlSG7czN8a/7HTHNmnLR3iwEm4ngPJ4yKmbX/fblMkU0Myjk/PgiP6qQLF+03CB2OVzozLVqBxyvmguRhJ3vrlMV0k2QCPax7vn3Ag53i4C0eLNya5S6UrZ02opI/9CKRbXztYVCK4FXZ7c49QtY+AZYUZA/UcTy7WtNvqGRKbItgKG0eQu9twIZQv2U/oBOM4OxLgxENMTh7DILm/4UWMDqsjDTXcF18otJ3LPVmUp551bCFpEa9CgpGXSArm2oeDHQE72OVzYgSjBnoWOX1vDodsK0exQKYEhoU88s+ra+scBDBHY54rNdZM6ecyG8Jk3eIHBToy8OJ5KRuPlJ76IMbvKl+DMHJi8egQL8mGm6V3F/7AnEavxnyHd9gRjabm/4cxO0D/IPqM+XgH3DRKAIGk=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1699023534; cv=none; b=mDjsngG0fw2XRQS0eYC16pqQJ/jSYHpH+5MmFv2/bPrEv1UrlRDaWlNGVzr6GZjqubqOpIIIbXvgNKQnZVrS2hiIN3jL9agz0oFPUgq59Zyw17iCMFXDe/EptEPUJLwKPx/t292bazrRdPrKxPjL8X3hbn8Dn3HNdliAb+V07x0Qpbjt6/jSJATNc/FBFN3Cr6L3IFfLIV3fQupnvBAMDatjbsDK/Hk7JgYvJ0O7bKzyR5+YLMqE96ttERegAigO6BBRNeXyxJWo6HhelJsUt6/uSv3yL3U/LMFH9zqWKLn9cnzsEcYfCe0Z7bZ2VFBONBkfLUjy2lVfyGS8jiA6Krto4TUT4KsFNKlRhO9oJoVlIFZhDzKtdsJ389a2pG50yxC177UQo47Aj2C5QyC4Tg5YSaoV4QR+oxwLDmoFWptsUf09UraXZU0bNr+eycmbi4lF9PgObiIvj5G+IG31E5RHmUkpLp+E6o6INOm/ooGcsP7s2cxQMQYo8F6PHYml431KUpyIGbJFXoe/o6PUrTZ39qC+oYcUBdQi/sT+tEPLoH7rixXWn5+qgdzaxDFK6HfDhbx2Cr8+wXAjBZoww4vK1Eg56fvGKqG9Z+SH7KJpFDXQaJ/zWoG2BYznYzksWTnc0jLViNCnyikj2hV84U+Vg9Qvh1UMj2RnUSgB/Og=
- Authentication-results: smail; dmarc=none header.from=u-bordeaux.fr
- Authentication-results: smail; arc=none
- Cc: pari-users@pari.math.u-bordeaux.fr
- Delivery-date: Fri, 03 Nov 2023 15:59:00 +0100
- In-reply-to: <CAD0p0K68bynSi6cjAw9-imzfikA5VF_1wjHnZbxJ7hYabWi9Sg@mail.gmail.com>
- Mail-followup-to: John Cremona <john.cremona@gmail.com>, pari-users@pari.math.u-bordeaux.fr
- References: <cfe89aa6-61a2-4a45-ae61-10db967e21f0@gmail.com> <ZUS1BvHCe4u411nV@seventeen> <CAD0p0K68bynSi6cjAw9-imzfikA5VF_1wjHnZbxJ7hYabWi9Sg@mail.gmail.com>
Dear John,
you're looking at the short form of the documentation (intended as a
1 or 2-line general description and not as a complete reference)
Please check '?? matreduce' for the actual documentation.
Cheers,
K.B.
* John Cremona [2023-11-03 12:43]:
> On Fri, 3 Nov 2023 at 08:53, Bill Allombert <
> Bill.Allombert@math.u-bordeaux.fr> wrote:
>
> > On Thu, Nov 02, 2023 at 04:28:04PM -0700, American Citizen wrote:
> > > To all:
> > >
> > > Recently I had to remove duplicate entries from a vector.
> > >
> > > Can GP-Pari create a command which will work with both lists and vectors
> > to
> > > output duplicate entries?
> > >
> > > I am aware that vecsort has flag=8 in vecsort(V,,8) and listsort has
> > flag =
> > > 1 in listsort(L,1) to remove duplicates, but I need to find them, not
> > erase
> > > them.
> > >
> > > Suppose v = [1,2,3,4,5,3,6]
> > >
> > > Then I would like a GP-Pari command called "duplicates(v)" to produce the
> > > following output.
> > >
> > > duplicates(v) = [3]
> >
> > You can do that:
> >
> > duplicates(v) = [x[1]|x<-matreduce(v)~,x[2]>1];
> >
>
>
> That's interesting, I did not know that matreduce() could do that. I
> suggest that its documentation "reduce the factorization matrix m to
> canonical form (sorted first row with unique elements) matrix." is
> incomplete, it certainly suggests that the input must be a matrix. As far
> as I can see, given a list (or vector) it returns a matrix with two
> columns, the unique entries in the first column (sorted) and their
> multiplicities in the second. And the entries don't have to be numbers, I
> just tried with a random list of letters (i.e. variables).
>
> Please can the documentation for matreduce be revised?
>
> John
>
> >
> > ? v = [1,2,3,4,5,3,6]
> > ? duplicates(v)
> > %6 = [3]
> >
> > Cheers,
> > Bill
> >
> >
K.B.
--
Pr. Karim Belabas, U. Bordeaux, Vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/