Bill Allombert on Sun, 08 Jan 2023 23:26:48 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: lookup-optimization
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Sun, 8 Jan 2023 23:25:36 +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=1673216736; c=relaxed/relaxed; bh=MygZaYQKT0rwk0FJX/4N/fnbVM9XDnigOiwGfzzgAL0=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; b=spOsLpHFusx1ppCCkOTAtXNyrcBGqOxB+W0lgYXND+PqoRAZYKFgziMzrZfVtxxvMnLJes4ZRijnXhSkUGf9ht/swve1u6QOrL52O2x5Qs4mom6eyPemGnYy4bmzP1okgruFVWLkRMKcC/WzwAEipE7LKAkeN3nASGkCkv/f9yEx+kNsFWmIJ7rlXaXWlyhxwiAWXfoelfexfpFdRsm8GvpyssLFnVsrmfe7N28mgbBb7rdF1YnNXw+jKCJrlEx4m6IoMoZhP+NKb1CCroq141YYQKIRsb7MOg0KDOrfVo95PvHkiJke3RhArUfGzMHr6mzWo2PLVRZBUY5lqj9tB1vA8OJzCeNaAd5Zq6Z7ditk2braSB7a2ejUC9AOEgapv/Ll7SMs8zv1YnyuweuLHJCDNZDcPN22Zpv4JCHLJdMyc72ZZMX7IcuT+Wru3LZ8wJy6aSyevVvCD3/ARjeSfggBoqGQKvAOj9gjSsObwzzPGLT02I05V+uP2oTY0xuHei+e9vGlI/Vxx3IVaCasJYUZZkLZUZCR3+N5l83a08WWwy17al6juxUeo2bdVGG3AbPzQyhKME42Wq+fIaKKUjlADrjlIn7ilORq7om//3peQ3LNy5p/BoAL0t0LTXb185H7OqdBIHzpTgzXr6bSoKKEaDkQ7O5HXMVao3+dcSw=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1673216736; cv=none; b=Yj5tO+ZcbaipcYZ8GAvkiufNepVXVKMHmMIK3zXOHQX3bo7X9cN3MoIFxCgILj5t57XchvokA5wpXQo2mfF5Rhlyua6CXPstsTKVzmb4310o1UTMTPkffN97M6UYr5Uw9cIawNV7dUedo9YqKpwUyW9AKtoV6e3Ur0z74HFOKMwgD9oY188LltA/9yb+idYsFN2fEhzeUoGp5j/OrvJteOzRQIh+D8iHErM25gebmtXWea4MQtnNeUrIV0xKSIvxX8sA+eeNqvjJhTAnsPakZme/TPR+0CDdeSWaDATlxEYx34tp2AfplVBKVCvMzK/GhH5K9CDekwCFDCMg/ah1JxZd1aggsjWwmXehNeq5yfCUUz635zd2RXCmVcuUD/x3/v+3VpuM2nXQ+SlM2L07GhzZ3nBIc1XtfndEDYeAh0pygBdMgZB/RUsbCIVqbhJYddslakWth/Sow+AEEz8LArK9iMw1SAhvdCNRh6tKCsR7Kmzev/KyRtBJIszmrJw+GcX0hkfhlseI0p6WHGZVO9O6L6KjNmv9iYXgC2ockXr5J7v9otT/MCfbYW+VxDhtZTvRP3p30USdLps6yvCf7uq38QHFB7EhT449eG3CjOKn+hsviVKc61VVjeyRS0ChnV7jELfsH6JePx1n+Z/Mv6eGSyo7y/sJgjDmt0zljfI=
- Authentication-results: smail; arc=none
- Delivery-date: Sun, 08 Jan 2023 23:26:48 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1673216736; bh=MygZaYQKT0rwk0FJX/4N/fnbVM9XDnigOiwGfzzgAL0=; h=Date:From:To:Subject:References:In-Reply-To:From; b=O4jyOpcdAjqKvtZ6EnCg+GXgHRjhWBIKXHvPL19c4bYhahOgn7x3hkd/zLi7ktHNP V5pPDPVEC+zwi9XGn9eEYY+STZFNUUhrkRFXrsXzWSIM7N+s/9YqwEO+eYIDxJrMgV PjEHvQuwjowP5vnGjhnC5CcyiQ5kt1N7smHqNLj6HKWTCLOlGn3Bdee+UfKLSQjhtB Gac7Gx7OS0p0s+gvPmFxurfJY9RdO1ChnibulErg24hcqxC9yXzAm/hcKPCcz3LIft leohffcFqo4M0DAsdeTVC0OwzQ2I9rMYNGgv9Iz9LZybU8euL86/0/JOTGlN9egOon yPrs46hCcll0NI8wB1qFXmOn70iIiS1LWLabXIEmV6otAbSUlH7XlBTbrv5eiIUNn9 6QNUUBCtobCayrxfIx5PV8NNi29CHfbyk5oWQiKkWFuFrQIj0CTmTTHv5hq/I23fgN QWuXSdxB6LVDXPs4+fT0ff1h+bWbOiOovo1OvyJUKI1uUVLz3/gyWcBKBnYhPYxZcj B+2TakeHniW5QGDhw7J0+EMftzrkjEn4uU2UyBbsf54YUhqzzfbAwfjZ2Qv5xUKffF +9QzNR72B0W8XU90qbaDs8zamHGZXP6P5J5HNmOodAtBrH2ZXa/wz0A8wocPQy4Tl3 k2w1+QYDowcfKEXSAQy+IdV0=
- In-reply-to: <3296bf3c-11ee-d3d5-89a8-9088af372b5d@isolution.nl>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <3296bf3c-11ee-d3d5-89a8-9088af372b5d@isolution.nl>
On Sun, Jan 08, 2023 at 09:48:29PM +0100, Ruud H.G. van Tol wrote:
> A243115( N=575, V=0 )= {
> my
> ( r= [] /* result */
> , s= [] /* lookup-set */
> , t= [ [1,2,1,1], [2,1,1,0] ] /* detailed table */
> );
>
> forstep
> ( v2= 3, N, 4
> , my( found= 0 );
> for /* Look up v2-class in s */
> ( i=1, #s
> , if
> ( s[i][2] == v2 % 2^s[i][1]
> , found= 1;
> break;
> );
> );
> if( found, next );
You could replace break by next(2) and get rid of found.
You could replace s by a Map: v2 -> p2:
s = Map()
...
for(i=1,logint(v2,2)+1,
my(nv2=v2%2^i,p2);
if (mapisdefined(s,nv2,&p2) && nv2==v2%2^p2, next(2)));
...
mapput(~s,v2,p2); \\instead of s=Set(...)
You should get below 1s for A243115(10^5);
Cheers,
Bill