Karim Belabas on Wed, 11 Dec 2024 22:24:17 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Is this the way to use auxiliary variables in vector initialized via multiple iterators?
|
- To: hermann@stamm-wilbrandt.de
- Subject: Re: Is this the way to use auxiliary variables in vector initialized via multiple iterators?
- From: Karim Belabas <Karim.Belabas@math.u-bordeaux.fr>
- Date: Wed, 11 Dec 2024 22:24:14 +0100
- Cc: pari-users@pari.math.u-bordeaux.fr
- Delivery-date: Wed, 11 Dec 2024 22:24:18 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=math.u-bordeaux.fr; s=2022; t=1733952255; bh=uu7cUMsWpfShH8QmJDmlCPLrMGGWPCEYYLlqQm/+p28=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WjS3ZsHjVn3suEOAOj4AUBldQgsGhal5RfXnFV60SAsn5QrDKaF1MxIrs2oDVD0Mk Q2scBLndOvhjFbUp4SESUakBd1MHGiHdDqzBwWqLe/g+GoQ+XSZ3dU/xjsiHwzPTTb xfHhF8NxEV6K7Y0vCaBVlGPG5NUECy7shjAx9DjtU7CbeN14d/GLyJq1ALV0GcmzQC 0M5VyoLxu2TSKn1GWM+y4CwlIXO+ctE/PKgHqwxsTEhH0HV0xxWhDtSHtZ4ohAbtSW ZJh0iUyUuFaebQJI3YZM6yC0oiSfWA7I9vctIFoCOxGznEkIIlD6ZTBm1rp3JSEn7s 97KrU58R1iBXIs0GVyO8NunTtMx0MeySWpvnIA4D3YDE9E1PjZlzpvT4+bcOaM29wK qXXU4YMN0SVBVWG47zlx1tXPUYWjRaMdIdB2qCEm7RfgEFG7+7FAaG/vpmFY4f/Vr0 rt2/kdw5Io1VkMHkJBvaiGR4ErJJll8J2RtaYImpII8h+E4ioCBVf3F5vlJoY7ZZtw NsE6pZj+/wYBPdQeNlUYQGYc+wQVqWTe4rjXnDAWqq/38NgH5lIwG1Me0f8ApPrP8J gH8x7arf8fDAzXtQsuX+xLQkx/81/WHWEmag6qWZXBXBbc/Bfowf0LOrWKeONcnmKt fwi85XYCnXyhIOGEqbWI4yTc=
- In-reply-to: <aedc5877d37d87f01df04b099964c84d@stamm-wilbrandt.de>
- Mail-followup-to: hermann@stamm-wilbrandt.de, pari-users@pari.math.u-bordeaux.fr
- References: <aedc5877d37d87f01df04b099964c84d@stamm-wilbrandt.de>
* hermann@stamm-wilbrandt.de [2024-12-11 22:16]:
> Doc talks about
> https://pari.math.u-bordeaux.fr/pub/pari/manuals/2.17.0/users.pdf#page=25
>
> "To iterate over more than one variable, you may separate clauses with ; as
> in"
>
> I found no mentioning how to introduce auxiliary variables to avoid
> repetition of terms.
>
> I wanted to use auxiliary variable s for sum p^2+4*q^2, and this does the
> job:
>
> ? P=primes([2,100]);vecmin([s|p<-P;q<-P;s<-[p^2+4*q^2],isprime(s)])
> 41
> ?
>
> Is there another way of assignment to s without having to introduce
> auxiliary single element set?
P = primes([2,100]); vecmin([s | p<-P;q<-P, isprime(s = p^2+4*q^2)])
Cheers,
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/