* Added TProb<T>::divided_by(const TProb<T>&) const
-* Removed TProb<T>::makeZero(double), TProb<T>::makePositive(double),
- TFactor<T>::makeZero(double), TFactor<T>::makePositive(double)
* Fixed bug in BipartiteGraph::eraseEdge()
* Added python and octave ports for examples/example_sprinkler.cpp
* [Patrick Pletscher] Added SWIG wrapper code for python and octave
--- /dev/null
+The following functions are obsolete and will be removed in the next major release (0.3.0):
+
+TFactor<T>& TFactor<T>::makeZero( T epsilon );
+TFactor<T>& TFactor<T>::makePositive( T epsilon );
+TProb<T>& TProb<T>::makePositive( T epsilon );
+TProb<T>& TProb<T>::makeZero( T epsilon );
+virtual void InfAlg::clamp( const Var &v, size_t x, bool backup = false ) = 0;
+void DAIAlg<GRM>::clamp( const Var &v, size_t x, bool backup = false );
+virtual void FactorGraph::clamp( const Var &v, size_t x, bool backup = false );
+size_t FactorGraph::VV2E(size_t n1, size_t n2) const;
+const Edge& FactorGraph::edge(size_t e) const;
+void FactorGraph::indexEdges();
+size_t FactorGraph::nr_edges() const;
+const std::vector<Edge>& FactorGraph::edges() const;
+bool BipartiteGraph::_edge_indexed;
+std::vector<Edge> BipartiteGraph::_edges;
+hash_map<Edge,size_t> BipartiteGraph::_vv2e;
+void BipartiteGraph::indexEdges();
+const Edge& BipartiteGraph::edge(size_t e) const;
+const std::vector<Edge>& BipartiteGraph::edges() const;
+size_t BipartiteGraph::VV2E(size_t n1, size_t n2) const;
+size_t BipartiteGraph::nr_edges() const;
+To do for the next release (0.2.3):
+
Improve documentation:
-index.h
-factor.h
-weightedgraph.h
-factorgraph.h
-clustergraph.h
-regiongraph.h
-properties.h
-util.h
-daialg.h
-alldai.h
-exactinf.h
-mf.h
-bp.h
-jtree.h
-hak.h
-treeep.h
-lc.h
-mr.h
-gibbs.h
-bp_dual.h
-bbp.h
-cbp.h
-evidence.h
-emalg.h
-doc.h
+ index.h
+ factor.h
+ weightedgraph.h
+ factorgraph.h
+ clustergraph.h
+ regiongraph.h
+ properties.h
+ util.h
+ daialg.h
+ alldai.h
+ exactinf.h
+ mf.h
+ bp.h
+ jtree.h
+ hak.h
+ treeep.h
+ lc.h
+ mr.h
+ gibbs.h
+ bp_dual.h
+ bbp.h
+ cbp.h
+ evidence.h
+ emalg.h
+ doc.h
return pointwiseOp(*this,f,std::minus<T>());
}
+ // OBSOLETE
+ /// Sets all values that are smaller than epsilon to 0
+ /** \note Obsolete, to be removed soon
+ */
+ TFactor<T>& makeZero( T epsilon ) {
+ _p.makeZero( epsilon );
+ return *this;
+ }
+
+ // OBSOLETE
+ /// Sets all values that are smaller than epsilon to epsilon
+ /** \note Obsolete, to be removed soon
+ */
+ TFactor<T>& makePositive( T epsilon ) {
+ _p.makePositive( epsilon );
+ return *this;
+ }
+
/// Returns pointwise inverse of *this.
/** If zero == true, uses 1 / 0 == 0; otherwise 1 / 0 == Inf.
*/
return *this;
}
+ // OBSOLETE
+ /// Sets entries that are smaller (in absolute value) than \a epsilon to 0
+ /** \note Obsolete, to be removed soon
+ */
+ TProb<T>& makeZero( T epsilon ) {
+ for( size_t i = 0; i < size(); i++ )
+ if( (_p[i] < epsilon) && (_p[i] > -epsilon) )
+ _p[i] = 0;
+ return *this;
+ }
+
+ // OBSOLETE
+ /// Sets entries that are smaller than \a epsilon to \a epsilon
+ /** \note Obsolete, to be removed soon
+ */
+ TProb<T>& makePositive( T epsilon ) {
+ for( size_t i = 0; i < size(); i++ )
+ if( (0 < _p[i]) && (_p[i] < epsilon) )
+ _p[i] = epsilon;
+ return *this;
+ }
+
/// Adds scalar \a x to each entry
TProb<T>& operator+= (T x) {
std::transform( _p.begin(), _p.end(), _p.begin(), std::bind2nd( std::plus<T>(), x ) );