Extended SWIG python interface (inspired by Kyle Ellrott): inference is possible...
[libdai.git] / include / dai / factor.h
index b157586..ec236f4 100644 (file)
@@ -177,6 +177,13 @@ class TFactor {
         bool operator==( const TFactor<T>& y ) const {
             return (_vs == y._vs) && (_p == y._p);
         }
+
+        /// Formats a factor as a string
+        std::string toString() const {
+            std::stringstream ss;
+            ss << *this;
+            return ss.str();
+        }
     //@}
 
     /// \name Unary transformations