diff options
Diffstat (limited to 'native/src/linprog/io.cpp')
| -rw-r--r-- | native/src/linprog/io.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/native/src/linprog/io.cpp b/native/src/linprog/io.cpp index 14eeca5..801e833 100644 --- a/native/src/linprog/io.cpp +++ b/native/src/linprog/io.cpp | |||
| @@ -22,6 +22,21 @@ std::ostream& operator<<(std::ostream &os, const LinearExpression &exp) | |||
| 22 | return os; | 22 | return os; |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | std::ostream& operator<<(std::ostream &os, const LinearProgram &lp) | ||
| 26 | { | ||
| 27 | os << "maximize " << *lp.get_objective() << " subject to:" << std::endl; | ||
| 28 | foreach (lp.get_equalities(), it) | ||
| 29 | { | ||
| 30 | os << *(it->first) << " = " << it->second << std::endl; | ||
| 31 | } | ||
| 32 | foreach (lp.get_inequalities(), it) | ||
| 33 | { | ||
| 34 | os << *(it->first) << " <= " << it->second << std::endl; | ||
| 35 | } | ||
| 36 | |||
| 37 | return os; | ||
| 38 | } | ||
| 39 | |||
| 25 | void dump_lp_solution( | 40 | void dump_lp_solution( |
| 26 | VarMapper& vars, | 41 | VarMapper& vars, |
| 27 | const ResourceSharingInfo& info, | 42 | const ResourceSharingInfo& info, |
