Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
Clasp::MinimizeBuilder Class Reference

Helper class for creating minimize constraints. More...

#include <minimize_constraint.h>

List of all members.

Classes

struct  CmpByLit
struct  CmpByWeight
struct  Weight

Public Types

typedef SharedMinimizeData SharedData

Public Member Functions

MinimizeBuilderaddLit (uint32 lev, WeightLiteral lit)
MinimizeBuilderaddRule (const WeightLitVec &lits, wsum_t adjustSum=0)
 Adds a minimize statement.
SharedDatabuild (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_

Detailed Description

Helper class for creating minimize constraints.

Definition at line 189 of file minimize_constraint.h.


Member Typedef Documentation

typedef std::pair<Literal, Weight*> Clasp::MinimizeBuilder::LitRep [private]

Definition at line 225 of file minimize_constraint.h.

Definition at line 226 of file minimize_constraint.h.

Definition at line 191 of file minimize_constraint.h.


Constructor & Destructor Documentation

Definition at line 546 of file minimize_constraint.cpp.

Definition at line 547 of file minimize_constraint.cpp.


Member Function Documentation

Definition at line 777 of file minimize_constraint.cpp.

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.

Parameters:
litsthe literals of the minimize statement
adjustSumthe 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.

Parameters:
ctxA ctx object used to simplify minimize statements.
Returns:
a new data object representing previously added minimize statements or 0 if minimize statements are initially inconsistent!

Definition at line 668 of file minimize_constraint.cpp.

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.

Definition at line 592 of file minimize_constraint.cpp.

Definition at line 582 of file minimize_constraint.cpp.


Member Data Documentation

Definition at line 246 of file minimize_constraint.h.

Definition at line 245 of file minimize_constraint.h.

Definition at line 247 of file minimize_constraint.h.


The documentation for this class was generated from the following files:


clasp
Author(s): Benjamin Kaufmann
autogenerated on Thu Aug 27 2015 12:41:41