delpi  0.0.1
DElta-complete LP solver
Loading...
Searching...
No Matches
Row.cpp
1
6#include "delpi/solver/Row.h"
7
8#include <ostream>
9#include <sstream>
10
11namespace delpi {
12
13std::ostream& operator<<(std::ostream& os, const Row& row) {
14 os << "Row{ ";
15 bool print_plus = false;
16 for (const auto& [var, coeff] : row.addends) {
17 os << (print_plus ? " + " : "");
18 if (coeff != 1) os << coeff << " * ";
19 os << var;
20 print_plus = true;
21 }
22 return os << " in [ " << (row.lb.has_value() ? (std::stringstream{} << row.lb.value()).str() : "-inf") << " , "
23 << (row.ub.has_value() ? (std::stringstream{} << row.ub.value()).str() : "inf") << " ] }";
24}
25
26} // namespace delpi
Global namespace for the delpi library.
Structure representing a row in the LP solver in the form of a linear combination of variables.
Definition Row.h:24