+git HEAD
+--------
+
+* Removed deprecated functionality
+* Updated ChangeLog for libDAI-0.2.4 (forgot a few entries)
+
+
libDAI-0.2.4 (2010-02-11)
-------------------------
* Implemented various heuristics for choosing a variable elimination sequence
in JTree
* Added BETHE method for GBP/HAK cluster choice
+* Made alias support official part of the library
Build system:
* Moved platform independent build options into Makefile.ALL
Code cleanup:
* Cleaned up utils/createfg and tests/testdai
+* Cleanup of some duplicate code in BP, FBP, TRWBP
Interface changes (the old interface is marked obsolete and will be removed in the next release):
* Removed obsolete/deprecated stuff
and using log-domain updates
* Fixed bug in HAK for trivial region graphs (with only one outer region
and no inner regions), reported by Alejandro Lage.
+* Fixed long-standing bug in TreeEP (now, within-loop propagation optimization works)
libDAI-0.2.3 (2009-11-16)
include Makefile.conf
# Set version and date
-DAI_VERSION="0.2.4"
-DAI_DATE="February 11, 2010"
+DAI_VERSION="git HEAD"
+DAI_DATE="February 11, 2010 - or later"
# Directories of libDAI sources
# Location libDAI headers
-------------------------------------------------------------------------------
-Version: 0.2.4
-Date: February 11, 2010
+Version: git HEAD
+Date: February 11, 2010 - or later
See also: http://www.libdai.org
-------------------------------------------------------------------------------
size_t addNode2() { _nb2.push_back( Neighbors() ); return _nb2.size() - 1; }
- /// Adds a node of type 1 without neighbors and returns the index of the added node.
- /** \deprecated Please use dai::BipartiteGraph::addNode1() instead.
- */
- size_t add1() { return addNode1(); }
-
- /// Adds a node of type 2 without neighbors and returns the index of the added node.
- /** \deprecated Please use dai::BipartiteGraph::addNode2() instead.
- */
- size_t add2() { return addNode2(); }
-
/// Adds a node of type 1, with neighbors specified by a range of nodes of type 2.
/** \tparam NodeInputIterator Iterator that iterates over instances of \c size_t.
* \param begin Points to the first index of the nodes of type 2 that should become neighbors of the added node.
return _nb2.size() - 1;
}
- /// Adds a node of type 1, with neighbors specified by a range of nodes of type 2.
- /** \deprecated Please use dai::BipartiteGraph::addNode1( NodeInputIterator, NodeInputIterator, size_t) instead.
- */
- template <typename NodeInputIterator>
- size_t add1( NodeInputIterator begin, NodeInputIterator end, size_t sizeHint = 0 ) {
- return addNode1( begin, end, sizeHint );
- }
-
- /// Adds a node of type 2, with neighbors specified by a range of nodes of type 1.
- /** \deprecated Please use dai::BipartiteGraph::addNode2( NodeInputIterator, NodeInputIterator, size_t) instead.
- */
- template <typename NodeInputIterator>
- size_t add2( NodeInputIterator begin, NodeInputIterator end, size_t sizeHint = 0 ) {
- return addNode2( begin, end, sizeHint );
- }
-
/// Adds an edge between node \a n1 of type 1 and node \a n2 of type 2.
/** If \a check == \c true, only adds the edge if it does not exist already.
*/
/// Removes node \a n2 of type 2 and all incident edges; indices of other nodes are changed accordingly.
void eraseNode2( size_t n2 );
- /// Removes node \a n1 of type 1 and all incident edges; indices of other nodes are changed accordingly.
- /** \deprecated Please use dai::BipartiteGraph::eraseNode1(size_t) instead.
- */
- void erase1( size_t n1 ) { eraseNode1( n1 ); }
-
- /// Removes node \a n2 of type 2 and all incident edges; indices of other nodes are changed accordingly.
- /** \deprecated Please use dai::BipartiteGraph::eraseNode2(size_t) instead.
- */
- void erase2( size_t n2 ) { eraseNode2( n2 ); }
-
/// Removes edge between node \a n1 of type 1 and node \a n2 of type 2.
void eraseEdge( size_t n1, size_t n2 );
//@}
/// Returns number of nodes of type 2
size_t nrNodes2() const { return _nb2.size(); }
- /// Returns number of nodes of type 1
- /** \deprecated Please use dai::BipartiteGraph::nrNodes1() instead.
- */
- size_t nr1() const { return nrNodes1(); }
-
- /// Returns number of nodes of type 2
- /** \deprecated Please use dai::BipartiteGraph::nrNodes2() instead.
- */
- size_t nr2() const { return nrNodes2(); }
-
/// Calculates the number of edges, time complexity: O(nrNodes1())
size_t nrEdges() const {
size_t sum = 0;
return result;
}
-
- /// Calculates cost of eliminating the \a i 'th variable.
- /** The cost is measured as "number of added edges in the adjacency graph",
- * where the adjacency graph has the variables as its nodes and connects
- * nodes \a i1 and \a i2 iff \a i1 and \a i2 occur together in some common cluster.
- * \deprecated Please use dai::eliminationCost_MinFill() instead.
- */
- size_t eliminationCost( size_t i ) const;
-
- /// Performs Variable Elimination, only keeping track of the interactions that are created along the way.
- /** \param ElimSeq The sequence in which to eliminate the variables
- * \return A set of elimination "cliques"
- * \deprecated Please use dai::ClusterGraph::VarElim( sequentialVariableElimination( ElimSeq ) ) instead.
- */
- ClusterGraph VarElim( const std::vector<Var> &ElimSeq ) const;
-
- /// Performs Variable Elimination using the "MinFill" heuristic
- /** The "MinFill" heuristic greedily minimizes the cost of eliminating a variable,
- * measured with eliminationCost().
- * \return A set of elimination "cliques".
- * \deprecated Please use dai::ClusterGraph::VarElim( greedyVariableElimination( eliminationCost_MinFill ) ) instead.
- */
- ClusterGraph VarElim_MinFill() const;
//@}
};
/** \mainpage Reference manual for libDAI - A free/open source C++ library for Discrete Approximate Inference methods
* \author Joris Mooij, Frederik Eaton
- * \version 0.2.4
- * \date February 11, 2010
+ * \version git HEAD
+ * \date February 11, 2010 - or later
*
* <hr size="1">
* \section about About libDAI
#endif
}
- /// Constructs a region graph from a factor graph, a vector of outer regions, a vector of inner regions and a vector of edges
- /** \note The counting numbers for the outer regions need to be 1.
- * \deprecated Please use dai::RegionGraph::RegionGraph( const FactorGraph &, const std::vector<VarSet> &, const std::vector<Region> &, const std::vector<std::pair<size_t,size_t> > & ) instead.
- */
- RegionGraph( const FactorGraph &fg, const std::vector<Region> &ors, const std::vector<Region> &irs, const std::vector<std::pair<size_t,size_t> > &edges );
-
/// Constructs a region graph from a factor graph and a vector of outer clusters (CVM style)
/** The region graph is constructed as in the Cluster Variation Method.
*
};
-/// \deprecated Please use dai::GraphEL instead.
-typedef GraphEL Graph;
-
-
/// Represents an undirected weighted graph, with weights of type \a T, implemented as a std::map mapping undirected edges to weights
template<class T> class WeightedGraph : public std::map<UEdge, T> {};
}
-size_t ClusterGraph::eliminationCost( size_t i ) const {
- return eliminationCost_MinFill( *this, i );
-}
-
-
-ClusterGraph ClusterGraph::VarElim( const std::vector<Var> &ElimSeq ) const {
- return VarElim( sequentialVariableElimination( ElimSeq ) );
-}
-
-
-ClusterGraph ClusterGraph::VarElim_MinFill() const {
- return VarElim( greedyVariableElimination( &eliminationCost_MinFill ) );
-}
-
-
size_t sequentialVariableElimination::operator()( const ClusterGraph &cl, const std::set<size_t> &/*remainingVars*/ ) {
return cl.findVar( seq.at(i++) );
}
}
-RegionGraph::RegionGraph( const FactorGraph &fg, const std::vector<Region> &ors, const std::vector<Region> &irs, const std::vector<std::pair<size_t,size_t> > &edges ) {
- vector<VarSet> ors_alt;
- ors_alt.reserve( ors.size() );
- for( size_t alpha = 0; alpha < ors.size(); alpha++ ) {
- ors_alt.push_back( ors[alpha] );
- DAI_ASSERT( ors[alpha].c() == 1.0 );
- }
- construct( fg, ors_alt, irs, edges );
-
- // Check counting numbers
-#ifdef DAI_DEBUG
- checkCountingNumbers();
-#endif
-}
-
-
void RegionGraph::calcCountingNumbers() {
// Calculates counting numbers of inner regions based upon counting numbers of outer regions