ravensat 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ravensat/dimacs_encoder.rb +3 -1
- data/lib/ravensat/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2206c8010f299d713c19b74682a2c46470d0c4cc7e27ade7e429ee0de09622de
|
4
|
+
data.tar.gz: 14b05657764ab053b091da8f0ddb339201ea2cd469d2828eccc04fd0b3c4e49e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba52ce15498089d710d8e7ded3b8f35da11364a74a6f72241482ceb794cec83164423142e5b3d3feb90b0a444d8ec62327d7be830cac6d4390844fb9ce10cb6e
|
7
|
+
data.tar.gz: 83509b606c6693373ce2918fe4ae9feda5aafbd241bca5510ed795cc52aae6dc0120cfc0e0294dd76a53004dbb825c1a9b0aa27664c47ff04a5e311ebf7bb167
|
@@ -8,7 +8,7 @@ module Ravensat
|
|
8
8
|
def to_dimacs(formula)
|
9
9
|
return nil unless formula.cnf?
|
10
10
|
|
11
|
-
dimacs_header = "p cnf #{formula.vars_size} #{formula.clauses_size}"
|
11
|
+
dimacs_header = "p cnf #{formula.vars_size} #{formula.clauses_size}\n"
|
12
12
|
dimacs_body = ""
|
13
13
|
create_table(formula)
|
14
14
|
formula.each do |node|
|
@@ -20,6 +20,8 @@ module Ravensat
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
# dimacs_body formatting
|
24
|
+
dimacs_body.strip! << ' '
|
23
25
|
dimacs_body.gsub!(/\n{2,}/, "\n").gsub!(/\n/, "0\n") << '0'
|
24
26
|
|
25
27
|
dimacs_header + dimacs_body
|
data/lib/ravensat/version.rb
CHANGED