diff --git a/packages/CLPBN/clpbn/bp/Util.cpp b/packages/CLPBN/clpbn/bp/Util.cpp index 20f33a6c7..f9890fce6 100644 --- a/packages/CLPBN/clpbn/bp/Util.cpp +++ b/packages/CLPBN/clpbn/bp/Util.cpp @@ -37,6 +37,17 @@ unsigned Statistics::primaryNetCount_; namespace Util { + +template <> std::string +toString (const bool& b) +{ + std::stringstream ss; + ss << std::boolalpha << b; + return ss.str(); +} + + + void toLog (Params& v) { diff --git a/packages/CLPBN/clpbn/bp/Util.h b/packages/CLPBN/clpbn/bp/Util.h index 0b4d4173c..58e838d63 100644 --- a/packages/CLPBN/clpbn/bp/Util.h +++ b/packages/CLPBN/clpbn/bp/Util.h @@ -36,6 +36,8 @@ template bool contains ( template std::string toString (const T&); +template <> std::string toString (const bool&); + void toLog (Params&); void fromLog (Params&); @@ -312,6 +314,7 @@ void pow (Params&, double); }; + struct NetInfo { NetInfo (unsigned size, bool loopy, unsigned nIters, double time)