Version 0.0.1.5-0 of linear-grammar is deprecated.
The latest version of linear-grammar is 0.0.2.1-0.
linear-grammar
Version 0.0.1.5 revision 0 uploaded by athanclark.
Package meta
- Synopsis
- A simple grammar for building linear equations and inclusive inequalities.
- Description
This library provides some simple tools for building abstract syntax trees, representing linear equations and (inclusive) inequalities. As an example:
12x + 3y - 4z + 12 <= 43x - 7b + 8q
Would look like...
f = (12 :: Double) .*. EVar "x" .+. (3 :: Double) .*. EVar "y" .+. (-4 :: Double) .*. EVar "z" .+. ELit 12 .<=. (43 :: Double) .*. EVar "x" .+. (-7 :: Double) .*. EVar "b" .+. (8 :: Double) .*. EVar "q"
I've added some overloading functionality, to help ease the verbosity of the above statements - an
IsString
instance, and some other utilities. To pack the equation into standard form, use thesandardForm
function:stdF = standardForm f
- Author
- Athan Clark <athan.clark@gmail.com>
- Bug reports
- n/a
- Category
- Math, Algebra
- Copyright
- n/a
- Homepage
- n/a
- Maintainer
- Athan Clark <athan.clark@gmail.com>
- Package URL
- n/a
- Stability
- n/a