[Frederik Eaton] Added unary minus to TProb<>
authorJoris Mooij <joris.mooij@tuebingen.mpg.de>
Fri, 27 Nov 2009 21:12:07 +0000 (22:12 +0100)
committerJoris Mooij <joris.mooij@tuebingen.mpg.de>
Fri, 27 Nov 2009 21:12:07 +0000 (22:12 +0100)
include/dai/prob.h

index 851828d..1627299 100644 (file)
@@ -390,6 +390,9 @@ template <typename T> class TProb {
             return r;
         }
 
+        /// Returns negative of \c *this
+        TProb<T> operator- () const { return pwUnaryTr( std::negate<T>() ); }
+
         /// Returns pointwise absolute value
         TProb<T> abs() const { return pwUnaryTr( fo_abs<T>() ); }