Dirk Laurie on Fri, 24 Aug 2012 11:17:34 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
In-place update of matrix row causes lvalue error in gp2c
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: In-place update of matrix row causes lvalue error in gp2c
- From: Dirk Laurie <dirk.laurie@gmail.com>
- Date: Fri, 24 Aug 2012 11:17:26 +0200
- Delivery-date: Fri, 24 Aug 2012 11:17:34 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=jStrwYWq8grUzxTSFCocBY/Y4RItvLfnJoDJN1Ef1Vs=; b=qPn7pWB/1eAht2lj7x2dMER3Yb3yuPsWWbB2llLtrHsOV37nH1E/Y6WZMx6fshUPbt mdL/m7aZwj1fRq8CahPSBhE9f3qFyGiHFR0EoPwPMNB2jMd6n9TGFqWTsLudPXtJ2aL/ YEds3Qty/pUB32zjjxq2rKJPzZg1PwXhDHpy/Sk027iwLnfVnZDlVNywOdN0QZN4zlEo erUEDLKL6O2fNk25pyZSocPQTRrWqesn7B5KRotmKNhDN5Gc4loogxIlKznchNBRJzN/ 6v1OxxLCfJV49B/dFYO4dev9skt/of6JQ579xDm6lchESRJk48Th7suLN2uT/8/9SEkD S70A==
When gp2c compiles the following GP code:
X[1,] += [10,20]
the corresponding line of C generated is:
rowcopy(X, 1) = gadd(rowcopy(X, 1), p2);
This causes the error message
error: lvalue required as left operand of assignment
The problem can be worked around by changing that line to
X[1,] = X[1,] + [10,20]
Version information (Ubuntu 12.04):
GP/PARI CALCULATOR Version 2.5.0 (released)
i686 running linux (ix86/GMP kernel) 32-bit version
compiled: Nov 17 2011, gcc-4.6.2 (Ubuntu/Linaro 4.6.2-2ubuntu1)
(readline v6.2 enabled, extended help enabled)