Bill Allombert on Sun, 14 Jul 2024 19:04:54 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Should forvec_t / forvec_init() / forvec_next() work in shared library code?
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: Should forvec_t / forvec_init() / forvec_next() work in shared library code?
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Sun, 14 Jul 2024 19:04:46 +0200
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1720976691; c=relaxed/relaxed; bh=OJCNqRDC15ZJDR4UAN+Khk7DIVGe1lLOkXGtfdQiRsk=; 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=FepER9jOU03s90P0F4aNGnx0N4wf04b2nkEwG+cwr1C580VJPyzFKkEfy9zoy/2sXq71ST5w4td1wMmoa7WCoBBq44mOpMImtBtRbl18KgORv+JbkdRsDPpi92iBqvXUP8qJqEMsYc+Ax/rpPenZH16/hMsvETKDI03XZnuIRlQJ578G4IAJWV+lemkgxrEAapFH6iyP59JqkgrBqepuzNxn4xOVpMOHXDJeToWcOe8Bah+R2Z9z71uAFWxEKALN70gUZEN92V6c+Kq1oPXNP+zP+UZuzQcUWeom+sunNAMxi6ZV5wA5ZYD+gHNxEiQFPJ6zHZu9/eth2bk0hpGiHSGzZgf0HD25hS4Y0enetpOQufUCrZXHwUkvyTO/dazI7unKgAoCXE8EBKqLLjQ+F3MPdh9rimBJhLxcUMvo8pJD8Juy4dQzb+KIcbdDYCLSXvE5qa5ynVG9diH0b8KCbfgurIPkCYOXHBAwno061rlAalohMjuZeS3Ffxy293d4kVsfOv0MrzFkSap8JjWcJSHNhk8oPeA07CtQsfdlseSlsgowXiceaqpsQF1i0KqQp3E3KzhrZ6dmN38aT+o8mDvMNYiFdTVrUW+IanMN9DaIL1uMpqAW5WbBpoIXh+LmrgpHIs4HfXdm7HNWeUAhstu3roGQ4cht462UGeujZko=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1720976691; cv=none; b=NKEo6PIky+7uNzLnyfFEo06vUm9tRb0IysZDLWD9S7htL65iFzBq3CrkAC9/+hP03LSmaAtXJ9/WxCZCFdkj9g0AH+8zJzC+cb0jxaxCfhX+152tycpKyHr/PVubcnkTAuC0/jju/K1ib7WcPTC8CRQHoN8MbQK1LV9YLEdeGXRv0S7iNcoxcWiPyAz/Qff8ocI/UErBXnyqpzg9pKwbVUJm8VZncV9pDLe87XRQ48+gdqu+L2VfdoMomOsGgjVvj08L8vw+gCWXnNfq/NoyyAEmb/ciVneAKf8i4yFh0UcKcFFTSXg3zlu+LeGQg+vO0JsavAWh8vEYwZg3c5Kd6IlkBuWSdxf0s23/Wgl7IMqCUc1Ovk7shF9PRZURmQTarFO+jbjvMNORxuRQi5SFZ5/SeWl1yq0ezsS+5dSLm2mc15s3SnR5gsIUnnnDP4I7iCZ+OS3QZ+nkze5eR1gOs+IKgi+Ajs4fVLT4LQ19GmCI6KrNBMHovH29s7K5/pmZ1JlhTOYtje8cP5t24ScScsqmwPwZVyhTdxLjM4q7mL/QpsWaEJ/wphvK6usU/egNMFg8F/uZg2mJt/uj1bwT+KCfgLykGn6Z3+5fnWsims0AE6jmkjJEmZVcpbu9zihrJZ7hdagyWQPZsyLNxelx5h3EM/DzUoKvgmwNlMGFbRM=
- Authentication-results: smail; dmarc=none header.from=math.u-bordeaux.fr
- Authentication-results: smail; arc=none
- Delivery-date: Sun, 14 Jul 2024 19:04:54 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1720976691; bh=OJCNqRDC15ZJDR4UAN+Khk7DIVGe1lLOkXGtfdQiRsk=; h=Date:From:To:Subject:References:In-Reply-To:From; b=pS/zNHMA+8CVsnjzoukMvACedvwKNlqcYDfM6REUk2YF4jBM4VZvJ9TMSIAcK/fbf sa6hbM7c6ncpQzQJcK+V2gX79yGqRol+Rw3c8wqE1XRF9trKIDiXn6ag3cukg8BL3W eW2/s7RkRSKpIntfTtz/WvorehZVgic6sMYbfJey28owNyP3eXSU3aMEYSKAagBMIG CmUNkNw1UGA8HWkTdzsck7OeEYSVNuNjVLsJOZuTaFNkW2CLAFOUe4XD8ujm0o19EZ snkxUvEhtnY2GDxyxKqszB1dj6NfJux8QewGLCkD46i7ul9TIJlCJeg0pRbnlFUaYs 5+cMQNaMJKCr+DeOzwc5MWB7mCZpAwgCh+aszB5VjZgm/rRZVpH+yGXHgrQE4kWjMM kUa189vnt7B46eHVoQ10C+QIagSas6JsrRCfhpWWen1LFLDVp86kX/YarMUMeHy32K XNWjn2PvBloc2UmnDLccBafs9Q/x1/0vpHmbJ4/F+kQwJfll8WSjsFVDmEksRRVoSQ GdGXMqx3BMNvp2C8g1R18F9Wr2RjkRSNyUMNNE9u7Fz5WwWz6bL3KmT8J17sQfgriF azL7v65LTwOS6b/6UYx0VTmSLNaEpbNCtLjGwltcMb5PUTOjUzKEnWHhhRkkoyh8tJ BqOjRcsMl6Ey8iRHfQZvMWjA=
- In-reply-to: <9a458f962779cb3c47ece4c537163637@stamm-wilbrandt.de>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <9a458f962779cb3c47ece4c537163637@stamm-wilbrandt.de>
On Sat, Jul 13, 2024 at 11:36:58PM +0200, hermann@stamm-wilbrandt.de wrote:
> I tried to use them today, and code stopped to work.
> I found workaround to iterate for C for() loop from 1
> until lg(points)-1 for t_VEC type GEN in libpari code:
> https://github.com/Hermann-SW/cgal4gp/blob/main/cgal4gp.cpp#L48-L53
>
> So should forvec_t / forvec_init() / forvec_next() work
> when compiled with "g++ -O3 -ffp-contract=off -fno-strict-aliasing -fPIC
> …"?
Sure. Maybe you are deleting data created by forvec_init in the PARI stack that
is still in use.
Send me your code if you like, I will tell you how to fix it.
For example, this code works fine:
{
forvec_t iter; /* forvec */
GEN p1, p2, p3; /* vec */
p1 = cgetg(3, t_VEC);
p2 = cgetg(3, t_VEC);
gel(p2, 1) = gen_1;
gel(p2, 2) = stoi(3);
gel(p1, 1) = p2;
p3 = cgetg(3, t_VEC);
gel(p3, 1) = gen_2;
gel(p3, 2) = stoi(4);
gel(p1, 2) = p3;
forvec_init(&iter, p1, 0);
{
GEN v; /* vec */
while ((v = forvec_next(&iter)))
pari_printf("%Ps\n", v);
}
Cheers,
Bill