git HEAD
--------
+* Fixed division-by-zero issue in pow() which caused problems for GLC+ with sparse factors
* Fixed bugs in unit test prob_test.cpp: replaced all occurences of
BOOST_CHECK_CLOSE(...,(Real)0.0,tol) with BOOST_CHECK_SMALL(...,tol)
* Merged Generalized Loop Correction code kindly provided by Siamak Ravanbakhsh
return std::exp(x);
}
-/// Returns \a to the power \a y
+/// Returns \a x to the power \a y
+/** We use the convention that division by zero yields zero;
+ * for powers, this means that if \a x == 0.0 and \a y < 0.0, we
+ * return 0.0 instead of generating an error.
+ */
inline Real pow( Real x, Real y ) {
errno = 0;
+ if( x == 0.0 && y < 0.0 )
+ return 0.0;
Real result = std::pow(x, y);
DAI_DEBASSERT( errno == 0 );
return result;