fslaborg / flips

Fsharp LInear Programming System
https://flipslibrary.com/#/
MIT License
251 stars 32 forks source link

Pretty printing for expressions #206

Open florenzen opened 2 weeks ago

florenzen commented 2 weeks ago

The change adds PrettyPrint methods to LinearExpression and ConstraintExpression that formats the reduced expression in a readable form. Coefficients close to 1 are omitted (i. e. ... + y - ... instead of ... + 1 * y - ...).

Since it needs the private reduce function of LinearExpression, I could not implement it outside of the LinearExpression type.