A class for defining a PB-problem. More...
#include <program_builder.h>

Public Member Functions | |
| bool | addConstraint (WeightLitVec &lits, weight_t bound, bool eq=false, weight_t cw=0) |
| Adds the given PB-constraint to the problem. | |
| bool | addObjective (const WeightLitVec &min) |
| Adds min as an objective function to the problem. | |
| Literal | addProduct (LitVec &lits) |
| Adds the given product to the problem. | |
| uint32 | numVars () const |
| Returns the number of variables in the problem. | |
| PBBuilder () | |
| void | prepareProblem (uint32 numVars, uint32 maxProduct, uint32 maxSoft, uint32 constraintHint=100) |
| Creates necessary variables and prepares the problem. | |
| bool | setSoftBound (wsum_t bound) |
| Only allow solutions where the sum of violated soft constraint is less than bound. | |
Private Types | |
| typedef std::map< LitVec, Literal > | ProductIndex |
Private Member Functions | |
| void | addProductConstraints (Literal eqLit, LitVec &lits) |
| bool | doEndProgram () |
| void | doGetAssumptions (LitVec &) const |
| bool | doParse (StreamSource &prg) |
| Parses prg as a PB-problem in OPB-format. | |
| bool | doStartProgram () |
| int | doType () const |
| bool | doUpdateProgram () |
| void | getMinBound (SumVec &out) const |
| Var | getNextVar () |
| bool | productSubsumed (LitVec &lits, Literal &subLit) |
Private Attributes | |
| uint32 | maxVar_ |
| uint32 | nextVar_ |
| ProductIndex | products_ |
| wsum_t | soft_ |
A class for defining a PB-problem.
Definition at line 160 of file program_builder.h.