19 #include "drwnVarUniverse.h" 21 #include "drwnTableFactor.h" 22 #include "drwnTableFactorMapping.h" 44 const char *
type()
const {
return "drwnSparseFactor"; }
50 int entries()
const {
return _assignments.size(); }
51 const std::map<drwnLocalAssignment, double>& getAssignments()
const {
return _assignments; }
virtual void addVariable(int var)
add variable by id
Definition: drwnTableFactor.cpp:98
std::vector< int > drwnLocalAssignment
defines an assignment to a subset of variables in the universe relative to some local scope (and fixe...
Definition: drwnVarAssignment.h:42
drwnSparseFactor(const drwnVarUniversePtr &ptr)
create an empty sparse factor
Definition: drwnSparseFactor.h:40
std::vector< int > drwnFullAssignment
defines a complete assignment to all variables in the universe
Definition: drwnVarAssignment.h:36
defines an assignment to a subset of the variables
Definition: drwnVarAssignment.h:47
Generic interface for a factor. Currently only inherited by drwnTableFactor.
Definition: drwnTableFactor.h:40
Data structures and utilities for encoding assignments to variables.
drwnSparseFactor * clone(void) const
returns a copy of the class usually implemented as virtual Foo* clone() { return new Foo(*this); } ...
Definition: drwnSparseFactor.h:45
const char * type() const
returns object type as a string (e.g., Foo::type() { return "Foo"; })
Definition: drwnSparseFactor.h:44
Encapsulates variables that the represented function is a function of. Allows user to add variables...
Definition: drwnSparseFactor.h:33
std::map< drwnLocalAssignment, double > _assignments
maps variable values to costs
Definition: drwnSparseFactor.h:36