Added empty() to graphs

release/4.3a0
Alex Cunningham 2012-02-02 22:45:41 +00:00
parent 45ee37fde6
commit 0a842cf0ec
1 changed files with 3 additions and 0 deletions

View File

@ -138,6 +138,9 @@ template<class CONDITIONAL, class CLIQUE> class BayesTree;
/** return the number of factors and NULLS */
size_t size() const { return factors_.size();}
/** Simple check for an empty graph - faster than comparing size() to zero */
bool empty() const { return factors_.empty(); }
/** const cast to the underlying vector of factors */
operator const std::vector<sharedFactor>&() const { return factors_; }