Helper class for creating minimize constraints. More...
#include <minimize_constraint.h>
Classes | |
struct | CmpByLit |
struct | CmpByWeight |
struct | Weight |
Public Types | |
typedef SharedMinimizeData | SharedData |
Public Member Functions | |
MinimizeBuilder & | addLit (uint32 lev, WeightLiteral lit) |
MinimizeBuilder & | addRule (const WeightLitVec &lits, wsum_t adjustSum=0) |
Adds a minimize statement. | |
SharedData * | build (SharedContext &ctx) |
Creates a new data object from previously added minimize statements. | |
void | clear () |
bool | hasRules () const |
MinimizeBuilder () | |
uint32 | numLits () const |
uint32 | numRules () const |
~MinimizeBuilder () | |
Private Types | |
typedef std::pair< Literal, Weight * > | LitRep |
typedef PodVector< LitRep >::type | LitRepVec |
Private Member Functions | |
weight_t | addFlattened (SharedData::WeightVec &x, const Weight &w) |
weight_t | addLitImpl (uint32 lev, WeightLiteral lit) |
void | addTo (LitRep l, SumVec &vec) |
bool | eqWeight (const SharedData::LevelWeight *lhs, const Weight &rhs) |
void | mergeReduceWeight (LitRep &x, LitRep &by) |
bool | prepare (SharedContext &ctx) |
void | unfreeze () |
Private Attributes | |
SumVec | adjust_ |
LitRepVec | lits_ |
bool | ready_ |
Helper class for creating minimize constraints.
Definition at line 189 of file minimize_constraint.h.
typedef std::pair<Literal, Weight*> Clasp::MinimizeBuilder::LitRep [private] |
Definition at line 225 of file minimize_constraint.h.
typedef PodVector<LitRep>::type Clasp::MinimizeBuilder::LitRepVec [private] |
Definition at line 226 of file minimize_constraint.h.
Definition at line 191 of file minimize_constraint.h.
Definition at line 546 of file minimize_constraint.cpp.
Definition at line 547 of file minimize_constraint.cpp.
weight_t Clasp::MinimizeBuilder::addFlattened | ( | SharedData::WeightVec & | x, |
const Weight & | w | ||
) | [private] |
Definition at line 777 of file minimize_constraint.cpp.
MinimizeBuilder & Clasp::MinimizeBuilder::addLit | ( | uint32 | lev, |
WeightLiteral | lit | ||
) |
Definition at line 567 of file minimize_constraint.cpp.
weight_t Clasp::MinimizeBuilder::addLitImpl | ( | uint32 | lev, |
WeightLiteral | lit | ||
) | [inline, private] |
Definition at line 240 of file minimize_constraint.h.
MinimizeBuilder & Clasp::MinimizeBuilder::addRule | ( | const WeightLitVec & | lits, |
wsum_t | adjustSum = 0 |
||
) |
Adds a minimize statement.
lits | the literals of the minimize statement |
adjustSum | the initial sum of the minimize statement |
Definition at line 558 of file minimize_constraint.cpp.
void Clasp::MinimizeBuilder::addTo | ( | LitRep | l, |
SumVec & | vec | ||
) | [private] |
Definition at line 575 of file minimize_constraint.cpp.
Creates a new data object from previously added minimize statements.
The function creates a new minimize data object from the previously added minimize statements. The returned object can be used to attach one or more MinimizeConstraints.
ctx | A ctx object used to simplify minimize statements. |
Definition at line 668 of file minimize_constraint.cpp.
void Clasp::MinimizeBuilder::clear | ( | ) |
Definition at line 548 of file minimize_constraint.cpp.
bool Clasp::MinimizeBuilder::eqWeight | ( | const SharedData::LevelWeight * | lhs, |
const Weight & | rhs | ||
) | [private] |
Definition at line 789 of file minimize_constraint.cpp.
bool Clasp::MinimizeBuilder::hasRules | ( | ) | const [inline] |
Definition at line 195 of file minimize_constraint.h.
void Clasp::MinimizeBuilder::mergeReduceWeight | ( | LitRep & | x, |
LitRep & | by | ||
) | [private] |
Definition at line 705 of file minimize_constraint.cpp.
uint32 Clasp::MinimizeBuilder::numLits | ( | ) | const [inline] |
Definition at line 197 of file minimize_constraint.h.
uint32 Clasp::MinimizeBuilder::numRules | ( | ) | const [inline] |
Definition at line 196 of file minimize_constraint.h.
bool Clasp::MinimizeBuilder::prepare | ( | SharedContext & | ctx | ) | [private] |
Definition at line 592 of file minimize_constraint.cpp.
void Clasp::MinimizeBuilder::unfreeze | ( | ) | [private] |
Definition at line 582 of file minimize_constraint.cpp.
SumVec Clasp::MinimizeBuilder::adjust_ [private] |
Definition at line 246 of file minimize_constraint.h.
LitRepVec Clasp::MinimizeBuilder::lits_ [private] |
Definition at line 245 of file minimize_constraint.h.
bool Clasp::MinimizeBuilder::ready_ [private] |
Definition at line 247 of file minimize_constraint.h.