git master
----------
+* Removed interfaces deprecated in 0.2.6.
* Fixed a bug in JTree::findMaximum() (reported by zhengyun84 and Dhruv Batra):
if one or more variables had a MAP belief with more than one maximum, an
incorrect MAP state could result.
* \idea Cache second-order neighborhoods in BipartiteGraph.
*/
class BipartiteGraph {
- /// Describes the neighbor relationship of two nodes in a BipartiteGraph.
- /** \deprecated Please use dai::Neighbor instead
- */
- typedef dai::Neighbor Neighbor;
-
- /// Describes the neighbors of some node.
- /** \deprecated Please use dai::Neighbors instead
- */
- typedef dai::Neighbors Neighbors;
-
- /// Represents an edge: an Edge(\a n1,\a n2) corresponds to the edge between node \a n1 of type 1 and node \a n2 of type 2.
- /** \deprecated Please use dai::Edge instead
- */
- typedef dai::Edge Edge;
-
private:
/// Contains for each node of type 1 a vector of its neighbors
std::vector<Neighbors> _nb1;
* parent and children nodes.
*/
class DAG {
- /// Describes the parent/child relationship of two nodes in a DAG.
- /** \deprecated Please use dai::Neighbor instead
- */
- typedef dai::Neighbor Neighbor;
-
- /// Type for storing the parents/children of some node.
- /** \deprecated Please use dai::Neighbors instead
- */
- typedef dai::Neighbors Neighbors;
-
- /// Represents a directed edge: an Edge(\a n1,\a n2) corresponds to the edge from node \a n1 to node \a n2.
- /** \deprecated Please use dai::Edge instead
- */
- typedef dai::Edge Edge;
-
private:
/// Contains for each node a vector of its parent nodes
std::vector<Neighbors> _pa;
};
-/// Runs Gibbs sampling for \a iters iterations (of which \a burnin for burn-in) on FactorGraph \a fg, and returns the resulting state
+/// Runs Gibbs sampling for \a maxiter iterations (of which \a burnin for burn-in) on FactorGraph \a fg, and returns the resulting state
/** \relates Gibbs
*/
-std::vector<size_t> getGibbsState( const FactorGraph &fg, size_t iters );
+std::vector<size_t> getGibbsState( const FactorGraph &fg, size_t maxiter );
} // end of namespace dai
* neighboring nodes.
*/
class GraphAL {
- public:
- /// Describes the neighbor relationship of two nodes in a GraphAL.
- /** \deprecated Please use dai::Neighbor instead
- */
- typedef dai::Neighbor Neighbor;
-
- /// Describes the neighbors of some node.
- /** \deprecated Please use dai::Neighbors instead
- */
- typedef dai::Neighbors Neighbors;
-
- /// Represents an edge: an Edge(\a n1,\a n2) corresponds to the edge between node \a n1 and node \a n2.
- /** \deprecated Please use dai::Edge instead
- */
- typedef dai::Edge Edge;
-
private:
/// Contains for each node a vector of its neighbors
std::vector<Neighbors> _nb;
std::vector<std::string> tokenizeString( const std::string& s, bool singleDelim, const std::string& delim="\t\n" );
-/// Split a string into tokens delimited by one of the characters in \a delim
-/** \deprecated Please use dai::tokenizeString( const std::string&, bool, const std::string& ) instead
- */
-void tokenizeString( const std::string& s, std::vector<std::string>& outTokens, const std::string& delim="\t\n" );
-
-
/// Enumerates different ways of normalizing a probability measure.
/**
* - NORMPROB means that the sum of all entries should be 1;
void Gibbs::setProperties( const PropertySet &opts ) {
- /// \deprecated The 'iters' property has been renamed into 'maxiters'
- DAI_ASSERT( opts.hasKey("maxiter") || opts.hasKey("iters") );
- if( opts.hasKey("maxiter") )
- props.maxiter = opts.getStringAs<size_t>("maxiter");
- else
- props.maxiter = opts.getStringAs<size_t>("iters");
+ DAI_ASSERT( opts.hasKey("maxiter") );
+ props.maxiter = opts.getStringAs<size_t>("maxiter");
if( opts.hasKey("restart") )
props.restart = opts.getStringAs<size_t>("restart");
}
-std::vector<size_t> getGibbsState( const FactorGraph &fg, size_t iters ) {
+std::vector<size_t> getGibbsState( const FactorGraph &fg, size_t maxiter ) {
PropertySet gibbsProps;
- gibbsProps.set( "maxiter", iters );
+ gibbsProps.set( "maxiter", maxiter );
gibbsProps.set( "burnin", size_t(0) );
gibbsProps.set( "verbose", size_t(0) );
Gibbs gibbs( fg, gibbsProps );
}
-void tokenizeString(const std::string& s, std::vector<std::string>& outTokens, const std::string& delim) {
- size_t start = 0;
- while (start < s.size()) {
- size_t end = s.find_first_of(delim, start);
- if (end > s.size())
- end = s.size();
- outTokens.push_back(s.substr(start, end - start));
- start = end + 1;
- }
-}
-
-
} // end of namespace dai