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: Hans Aberg
Subject: Re: how to parse linear equations
Date: Sat, 16 Jan 2010 15:44:04 +0100

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






reply via email to

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