Remove unnecessary methods

This commit is contained in:
Tiago Gomes 2012-12-28 01:35:59 +00:00
parent 7d9af75c35
commit 3363019c93
2 changed files with 3 additions and 31 deletions

View File

@ -36,35 +36,11 @@ Var::isValidState (int stateIndex)
bool
Var::isValidState (const string& stateName)
{
States states = Var::getVarInfo (varId_).states;
return Util::contains (states, stateName);
}
void
Var::setEvidence (int ev)
Var::setEvidence (int evidence)
{
assert (ev < (int) range_);
evidence_ = ev;
}
void
Var::setEvidence (const string& ev)
{
States states = Var::getVarInfo (varId_).states;
for (size_t i = 0; i < states.size(); i++) {
if (states[i] == ev) {
evidence_ = i;
return;
}
}
assert (false);
assert (evidence < (int) range_);
evidence_ = evidence;
}

View File

@ -59,12 +59,8 @@ class Var
bool isValidState (int);
bool isValidState (const string&);
void setEvidence (int);
void setEvidence (const string&);
string label (void) const;
States states (void) const;