#include <groundclause.h>
Public Member Functions | |
GroundClause (const Clause *const &c, GroundPredicateHashArray *const &gndPredHashArray) | |
~GroundClause () | |
void | deleteParentWtPtrs () |
void | deleteFoClauseFrequencies () |
void | addWt (const double &wt) |
void | setWt (const double &wt) |
double | getWt () const |
void | setWtToHardWt () |
bool | isHardClause () const |
int | getNumGroundPredicates () const |
const GroundPredicate * | getGroundPredicate (const int &i, GroundPredicateHashArray *const &gndPredHashArray) const |
void | appendToGndPreds (GroundPredicateHashArray *const &gndPredHashArray) |
Appends this GroundClause to all GroundPredicates in it. | |
bool | getGroundPredicateSense (const int &i) const |
void | setGroundPredicateIndex (const int &i, const int &gndPredIdx) |
int | getGroundPredicateIndex (const int &i) const |
const Array< int > * | getGndPredIndexes () const |
void | appendParentWtPtr (const double *const &wtPtr) |
void | setWtToSumOfParentWts () |
IntPair * | getClauseFrequencies () |
int | getClauseFrequency (int clauseno) |
void | incrementClauseFrequency (int clauseno, int increment) |
size_t | hashCode () |
bool | same (const GroundClause *const &gc) |
void | printWithoutWt (ostream &out) const |
void | print (ostream &out) const |
ostream & | print (ostream &out, const Domain *const &domain, const bool &withWt, const bool &asInt, const bool &withStrVar, const GroundPredicateHashArray *const &predHashArray) const |
ostream & | printWithoutWt (ostream &out, const Domain *const &domain, const GroundPredicateHashArray *const &predHashArray) const |
ostream & | printWithoutWtWithStrVar (ostream &out, const Domain *const &domain, const GroundPredicateHashArray *const &predHashArray) const |
ostream & | printWithWtAndStrVar (ostream &out, const Domain *const &domain, const GroundPredicateHashArray *const &predHashArray) const |
ostream & | print (ostream &out, const Domain *const &domain, const GroundPredicateHashArray *const &predHashArray) const |
ostream & | printWithoutWtWithStrVarAndPeriod (ostream &out, const Domain *const &domain, const GroundPredicateHashArray *const &predHashArray) const |
double | sizeKB () |
Computes and returns the size of this ground clause. |
Definition at line 101 of file groundclause.h.
void GroundClause::appendToGndPreds | ( | GroundPredicateHashArray *const & | gndPredHashArray | ) |
Appends this GroundClause to all GroundPredicates in it.
gndPredHashArray | Reference HashArray containing the GroundPredicates indexed in the GroundClause. |
Definition at line 124 of file groundclause.cpp.
References Array< Type >::size().
Referenced by MRF::addUnknownGndClause(), and VariableState::getActiveClauses().
00126 { 00127 // For each ground pred in this clause 00128 for (int i = 0; i < gndPredIndexes_->size(); i++) 00129 { 00130 bool sense = ((*gndPredIndexes_)[i] > 0); 00131 int index = abs((*gndPredIndexes_)[i]) - 1; 00132 // Tell the ground pred that it occurs in this ground clause 00133 bool ok = (*gndPredHashArray)[index]->appendGndClause(this, sense); 00134 assert(ok); ok = true; // avoid compilation warning 00135 } 00136 }