randomSAT: fixed random sat generation; satlabcxx: fixed *2bson converters

This commit is contained in:
Tom
2019-04-05 13:07:38 +02:00
parent 0ed2b27b99
commit 9a8c908eae
6 changed files with 13 additions and 10 deletions

View File

@@ -13,7 +13,7 @@ namespace satlab
template<typename = bsoncxx::builder::stream::array, typename = KSATinstance::MODEL>
void convert(bsoncxx::builder::stream::array& builder, const KSATinstance::MODEL& model)
{
builder = bsoncxx::builder::stream::array();
builder.clear();
for(auto& lit : model)
{

View File

@@ -18,7 +18,7 @@ void convert(bsoncxx::builder::stream::document& builder, const MinisatResult& r
using ARRAY_BUILDER = bsoncxx::builder::stream::array;
using DOCUMENT_BUILDER = bsoncxx::builder::stream::document;
builder = DOCUMENT_BUILDER();
builder.clear();
ARRAY_BUILDER model;
DOCUMENT_BUILDER stats;

View File

@@ -13,7 +13,7 @@ namespace satlab
template<typename = bsoncxx::builder::stream::document, typename = MinisatStats>
void convert(bsoncxx::builder::stream::document& builder, const MinisatStats& stats)
{
builder = bsoncxx::builder::stream::document();
builder.clear();
builder << "solves" << static_cast<int>(stats.getSolves())
<< "starts" << static_cast<int>(stats.getStarts())