File tree 2 files changed +19
-1
lines changed
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 9
9
10
10
#include " dimacs_cnf.h"
11
11
12
+ #include < util/magic.h>
13
+
12
14
#include < iostream>
15
+ #include < sstream>
13
16
14
17
dimacs_cnft::dimacs_cnft ():break_lines(false )
15
18
{
@@ -60,9 +63,23 @@ static void write_dimacs_clause(
60
63
61
64
void dimacs_cnft::write_clauses (std::ostream &out)
62
65
{
66
+ std::size_t count = 0 ;
67
+ std::stringstream output_block;
63
68
for (clausest::const_iterator it=clauses.begin ();
64
69
it!=clauses.end (); it++)
65
- write_dimacs_clause (*it, out, break_lines);
70
+ {
71
+ write_dimacs_clause (*it, output_block, break_lines);
72
+
73
+ // print the block once in a while
74
+ if (++count % CNF_DUMP_BLOCK_SIZE == 0 )
75
+ {
76
+ out << output_block.str ();
77
+ output_block.str (" " );
78
+ }
79
+ }
80
+
81
+ // make sure the final block is printed as well
82
+ out << output_block.str ();
66
83
}
67
84
68
85
void dimacs_cnf_dumpt::lcnf (const bvt &bv)
Original file line number Diff line number Diff line change 7
7
8
8
#include < cstddef>
9
9
10
+ const std::size_t CNF_DUMP_BLOCK_SIZE = 4096 ;
10
11
const std::size_t MAX_FLATTENED_ARRAY_SIZE=1000 ;
11
12
const std::size_t STRING_REFINEMENT_MAX_CHAR_WIDTH = 16 ;
12
13
You can’t perform that action at this time.
0 commit comments