Open zhaoli-IHEP opened 4 years ago
The problem here is that the RHS in a fill statement is not worked out until the table element gets used. This means that your elements are unexpanded expressions which do not exist by the time you want to use the elements. Hence ‘illegal’. The way around this is to use the FillExpression statement. That is also usually much less work for the programmer. The opposite, to convert tables into expressions, exists also with the table_ function.
Jos
On 18 Jul 2020, at 05:47, zhaoli-IHEP notifications@github.com wrote:
We were trying to extract the coefficients of the multivariate polynomial. And below is the sample code.
-
symbol x,y,a,b,c; Table,sparse,test_table;
Local expr = bx^2y+cxy^2+axy; .sort
bracket x,y; .sort
Local coeff1 = expr[xy]; Local coeff2 = expr[x^2y]; Local coeff3 = expr[x*y^2]; .sort
fill test_table = coeff1; fill test_table = coeff2; fill test_table = coeff3; .sort
TableBase "test_table.tbl" create; TableBase "test_table.tbl" addto [test_table]; .sort
.end However, it gives the error message "Illegal subterm while writing". We also tried the approach
bracket x, y; .sort collect Coeff; .sort But in the practical code, the coefficients could be so long that it cannot be solved by increasing the option "maxtermsize". Therefore, we are looking for an alternative approach to avoid the limit of "maxtermsize".
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vermaseren/form/issues/363, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJPCETPEIHV3OONATSE4UDR4ELO5ANCNFSM4O7KOWNQ.
The manual also says (for the fill
statement) that this (right-hand-side expressions) can be avoided by the use of $-variables expanded at compile-time (in preprocessor).
The problem here is that the RHS in a fill statement is not worked out until the table element gets used. This means that your elements are unexpanded expressions which do not exist by the time you want to use the elements. Hence ‘illegal’. The way around this is to use the FillExpression statement. That is also usually much less work for the programmer. The opposite, to convert tables into expressions, exists also with the table_ function. Jos …
Thank you. I think we will go back to use fillexpression.
We were trying to extract the coefficients of the multivariate polynomial. And below is the sample code.
However, it gives the error message "Illegal subterm while writing". We also tried the approach
But in the practical code, the coefficients could be so long that it cannot be solved by increasing the option "maxtermsize". Therefore, we are looking for an alternative approach to avoid the limit of "maxtermsize".