Hi I am using ginac in a symbolic regression program. It generates different polynomials using genetic programming, mulitplies each monomial by a weight and then fits the resulting expression using regression. I need to extract each monomial from the polynomial. Until now , I have been getting by only dealing with the case where the top level class is "add", and the program worked well enough for me to publish a paper on the use of symbolic regression in software modelling. Yes , I wanted to let the authors know, they have another citation :-). But this restricts the program. Is there a better way to do this ? Will ex::expand () convert the expression to a polynomial I should mention that the ginac expression itself is generated from a genetic evolved tree, so that I can generate all the monomials while doing this conversion, but that will leave me with the task of collecting like terms, something I would rather have done for me :-). Thanks Anish -- Anish Muttreja ~ Graduate Student Electrical Engineering ~ Princeton University ======================================================== As an adolescent I aspired to lasting fame, I craved factual certainty, and I thirsted for a meaningful vision of human life - so I became a scientist. This is like becoming an archbishop so you can meet girls. -Matt Cartmill, anthropology professor and author (1943- )
Hi! On Sun, Apr 04, 2004 at 10:32:18PM -0400, Anish Muttreja wrote:
I need to extract each monomial from the polynomial.
Until now , I have been getting by only dealing with the case where the top level class is "add",
Is there much more to it? After calling expand(), the polynomial is either a monomial or a sum of monomials. Bye, Christian -- / Physics is an algorithm \/ http://www.uni-mainz.de/~bauec002/
Apparently not always ... I have seen expand leave me with a factored expression like (x+1)*(x+2) e.g. At least that was occasionally the case with 1.0.8. I switched to 1.2.0 and the problem seems to have disappeared... Might have been a bug in my program ... thanks for the reply... I was just a little unsure about the semantics. Anyway it works now ! Anish -- Anish Muttreja ~ Graduate Student Electrical Engineering ~ Princeton University ======================================================== As an adolescent I aspired to lasting fame, I craved factual certainty, and I thirsted for a meaningful vision of human life - so I became a scientist. This is like becoming an archbishop so you can meet girls. -Matt Cartmill, anthropology professor and author (1943- ) On Apr 11, 2004, at 6:45 AM, Christian Bauer wrote:
Hi!
On Sun, Apr 04, 2004 at 10:32:18PM -0400, Anish Muttreja wrote:
I need to extract each monomial from the polynomial.
Until now , I have been getting by only dealing with the case where the top level class is "add",
Is there much more to it? After calling expand(), the polynomial is either a monomial or a sum of monomials.
Bye, Christian
-- / Physics is an algorithm \/ http://www.uni-mainz.de/~bauec002/
participants (2)
-
Anish Muttreja
-
Christian Bauer