MCPcopy Create free account
hub / github.com/Gecode/gecode / printIntVar

Function printIntVar

gecode/flatzinc/flatzinc.cpp:1770–1788  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1768 };
1769
1770 void printIntVar(std::ostream& os, const std::string name, const Int::IntView& x) {
1771 os << "var ";
1772 if (x.assigned()) {
1773 os << "int: " << name << " = " << x.val() << ";";
1774 } else if (x.range()) {
1775 os << x.min() << ".." << x.max() << ": " << name << ";";
1776 } else {
1777 os << "array_union([";
1778 Gecode::Int::ViewRanges<Int::IntView> r(x);
1779 while (true) {
1780 os << r.min() << ".." << r.max();
1781 ++r;
1782 if (!r()) break;
1783 os << ',';
1784 }
1785 os << "]): " << name << ";";
1786 }
1787 os << "\n";
1788 }
1789 void printBoolVar(std::ostream& os, const std::string name, const BoolVar& b) {
1790 os << "var bool: " << name;
1791 if(b.assigned())

Callers 1

getDomainsMethod · 0.85

Calls 6

rFunction · 0.85
assignedMethod · 0.45
valMethod · 0.45
rangeMethod · 0.45
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected