help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to parse linear equations


From: Michael Chen
Subject: Re: how to parse linear equations
Date: Sat, 16 Jan 2010 08:52:39 -0600

Exactly, I would like to first process the linear expression, which
are coefficients and a constant; how can I do it over my ast tree
recursively?

          +
    *               *
2    +          3      -
    x   y             z     x


Michael

On Sat, Jan 16, 2010 at 8:44 AM, Hans Aberg <address@hidden> wrote:
> On 16 Jan 2010, at 15:21, Michael Chen wrote:
>
>> My goal is to get to the matrix form Ax =b by collecting and combining
>> linear terms while I am parsing the ast tree. Once I get a clean
>> matrix form Ax=b, it is straightforward to call my other routines to
>> solve it.
>
> It may be easier to first parse polynomial expressions, which is, since it
> is linear, the coefficients plus the constant. When the equality "="
> appears, you can combine the two sides. WHen you have collected all
> equalities, build the matrix. This method then generalizes to polynomial
> equations, if you would like to do so later.
>
>  Hans
>
>
>



-- 
Best regards,
Michael Chen
Google Voice Phone.: 847-448-0647




reply via email to

[Prev in Thread] Current Thread [Next in Thread]