From: Joris Mooij Date: Thu, 31 Oct 2013 11:14:48 +0000 (+0100) Subject: [Julien Rebetez] added FactorGraph::printDot() to SWIG interface X-Git-Tag: v0.3.2~6 X-Git-Url: http://git.tuebingen.mpg.de/?p=libdai.git;a=commitdiff_plain;h=f883f2ce225c29592b8866149e219d5390e7464c;ds=sidebyside [Julien Rebetez] added FactorGraph::printDot() to SWIG interface --- diff --git a/ChangeLog b/ChangeLog index 1701530..9e911c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ git HEAD -------- +* [Julien Rebetez] added FactorGraph::printDot() to SWIG interface +* Build system: optional compilation targets are now set in include/dai/dai_config.h instead of Makefile.ALL +* Workaround for bug in Boost Graph Library version 1.54 ("The graph may not contain an edge with negative weight") by not using Prim's minimum spanning tree algorithm anymore +* Removed conversion script FastInf->libDAI because it is buggy (uses wrong permutation of factor entries) * Extended SWIG python interface (inspired by Kyle Ellrott): inference is possible in Python now! * Added toString() formatting functions to the classes that had an output streaming operator<< * Replaced all occurrences of std::size_t by size_t to avoid SWIG problems diff --git a/include/dai/dai_config.h b/include/dai/dai_config.h index 1f3ed4f..1f53f8a 100644 --- a/include/dai/dai_config.h +++ b/include/dai/dai_config.h @@ -14,19 +14,19 @@ #define __defined_libdai_config_h -//#define DAI_WITH_BP -//#define DAI_WITH_FBP -//#define DAI_WITH_TRWBP -//#define DAI_WITH_MF -//#define DAI_WITH_HAK -//#define DAI_WITH_LC -//#define DAI_WITH_TREEEP -//#define DAI_WITH_JTREE -//#define DAI_WITH_MR -//#define DAI_WITH_GIBBS -//#define DAI_WITH_CBP -//#define DAI_WITH_DECMAP -//#define DAI_WITH_GLC +#define DAI_WITH_BP +#define DAI_WITH_FBP +#define DAI_WITH_TRWBP +#define DAI_WITH_MF +#define DAI_WITH_HAK +#define DAI_WITH_LC +#define DAI_WITH_TREEEP +#define DAI_WITH_JTREE +#define DAI_WITH_MR +#define DAI_WITH_GIBBS +#define DAI_WITH_CBP +#define DAI_WITH_DECMAP +#define DAI_WITH_GLC #endif diff --git a/swig/dai.i b/swig/dai.i index 9f3074f..5384d36 100644 --- a/swig/dai.i +++ b/swig/dai.i @@ -8,6 +8,8 @@ %module dai +#include + %include "std_string.i" %include "std_vector.i" %template(IntVector) std::vector; @@ -109,6 +111,11 @@ typedef std::vector VecVecFactor; %extend dai::FactorGraph { inline const char* __str__() const { return (*self).toString().c_str(); } /* for python */ inline std::string __str() const { return (*self).toString(); } /* for octave */ + inline void printDot(const std::string& fname) const { + std::ofstream o(fname.c_str(), std::ofstream::out); + self->printDot(o); + o.close(); + } } // ************************************************************************************************