gecoder-with-gecode 0.7.1-mswin32 → 0.8.0-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +7 -0
- data/README +10 -1
- data/lib/gecode.dll +0 -0
- data/lib/gecoder/bindings/bindings.rb +407 -731
- data/lib/gecoder/interface/binding_changes.rb +1 -1
- data/lib/gecoder/interface/branch.rb +25 -25
- data/lib/gecoder/interface/constraints.rb +47 -4
- data/lib/gecoder/interface/constraints/bool/boolean.rb +18 -16
- data/lib/gecoder/interface/constraints/bool_enum/boolean.rb +13 -11
- data/lib/gecoder/interface/constraints/int/arithmetic.rb +5 -4
- data/lib/gecoder/interface/constraints/int/domain.rb +8 -9
- data/lib/gecoder/interface/constraints/int/linear.rb +10 -8
- data/lib/gecoder/interface/constraints/int_enum/arithmetic.rb +4 -4
- data/lib/gecoder/interface/constraints/int_enum/channel.rb +2 -2
- data/lib/gecoder/interface/constraints/int_enum/count.rb +4 -5
- data/lib/gecoder/interface/constraints/int_enum/distinct.rb +7 -2
- data/lib/gecoder/interface/constraints/int_enum/element.rb +2 -2
- data/lib/gecoder/interface/constraints/int_enum/equality.rb +6 -3
- data/lib/gecoder/interface/constraints/int_enum/sort.rb +17 -5
- data/lib/gecoder/interface/constraints/set_enum/distinct.rb +0 -36
- data/lib/gecoder/interface/constraints/set_var_constraints.rb +5 -0
- data/lib/gecoder/interface/model.rb +3 -3
- data/lib/gecoder/interface/search.rb +5 -4
- data/lib/gecoder/version.rb +1 -1
- data/specs/branch.rb +27 -27
- data/specs/constraints/arithmetic.rb +48 -30
- data/specs/constraints/bool_enum.rb +39 -19
- data/specs/constraints/boolean.rb +10 -10
- data/specs/constraints/cardinality.rb +12 -9
- data/specs/constraints/channel.rb +6 -6
- data/specs/constraints/connection.rb +22 -26
- data/specs/constraints/constraint_helper.rb +125 -41
- data/specs/constraints/count.rb +22 -15
- data/specs/constraints/distinct.rb +10 -64
- data/specs/constraints/element.rb +14 -12
- data/specs/constraints/equality.rb +4 -4
- data/specs/constraints/int_domain.rb +8 -7
- data/specs/constraints/int_relation.rb +12 -8
- data/specs/constraints/linear.rb +4 -4
- data/specs/constraints/reification_sugar.rb +22 -4
- data/specs/constraints/selection.rb +2 -2
- data/specs/constraints/set_domain.rb +7 -3
- data/specs/constraints/set_operation.rb +2 -2
- data/specs/constraints/set_relation.rb +2 -6
- data/specs/constraints/sort.rb +20 -16
- data/specs/model.rb +4 -4
- data/tasks/dependencies.txt +21 -0
- data/tasks/distribution.rake +13 -5
- data/vendor/gecode/win32/lib/libgecodeint.dll +0 -0
- data/vendor/gecode/win32/lib/libgecodekernel.dll +0 -0
- data/vendor/gecode/win32/lib/libgecodeminimodel.dll +0 -0
- data/vendor/gecode/win32/lib/libgecodesearch.dll +0 -0
- data/vendor/gecode/win32/lib/libgecodeset.dll +0 -0
- data/vendor/gecode/win32/lib/libgecodesupport.dll +0 -0
- data/vendor/rust/include/rust_checks.hh +2 -1
- data/vendor/rust/include/rust_conversions.hh +2 -2
- data/vendor/rust/rust/attribute.rb +2 -2
- data/vendor/rust/rust/class.rb +2 -2
- data/vendor/rust/rust/cxxclass.rb +0 -2
- data/vendor/rust/rust/function.rb +2 -2
- data/vendor/rust/rust/templates/AttributeDefinition.rusttpl +1 -1
- data/vendor/rust/rust/templates/StandaloneClassDeclarations.rusttpl +1 -1
- data/vendor/rust/rust/templates/VariableFunctionCall.rusttpl +1 -1
- data/vendor/rust/rust/type.rb +1 -1
- metadata +4 -3
- data/tasks/building.howto +0 -65
data/specs/constraints/linear.rb
CHANGED
@@ -54,7 +54,7 @@ describe Gecode::Constraints::Int::Linear do
|
|
54
54
|
(@x + @y).must_be.greater_than(@z, hash)
|
55
55
|
@model.solve!
|
56
56
|
end
|
57
|
-
@expect_options =
|
57
|
+
@expect_options = option_expectation do |strength, kind, reif_var|
|
58
58
|
# TODO: this is hard to spec from this level.
|
59
59
|
end
|
60
60
|
end
|
@@ -187,7 +187,7 @@ describe Gecode::Constraints::Int::Linear do
|
|
187
187
|
(@x * :foo).should be_nil
|
188
188
|
end
|
189
189
|
|
190
|
-
it_should_behave_like 'constraint
|
190
|
+
it_should_behave_like 'reifiable constraint'
|
191
191
|
end
|
192
192
|
|
193
193
|
describe Gecode::Constraints::Int::Linear, '(with booleans)' do
|
@@ -202,7 +202,7 @@ describe Gecode::Constraints::Int::Linear, '(with booleans)' do
|
|
202
202
|
(@x + @y).must_be.greater_than(@z, hash)
|
203
203
|
@model.solve!
|
204
204
|
end
|
205
|
-
@expect_options =
|
205
|
+
@expect_options = option_expectation do |strength, kind, reif_var|
|
206
206
|
# TODO: this is hard to spec from this level.
|
207
207
|
end
|
208
208
|
end
|
@@ -326,7 +326,7 @@ describe Gecode::Constraints::Int::Linear, '(with booleans)' do
|
|
326
326
|
(@x * :foo).should be_nil
|
327
327
|
end
|
328
328
|
|
329
|
-
it_should_behave_like 'constraint
|
329
|
+
it_should_behave_like 'reifiable constraint'
|
330
330
|
end
|
331
331
|
|
332
332
|
|
@@ -27,14 +27,23 @@ describe Gecode::Constraints::ReifiableConstraint do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
it 'should translate disjunctions' do
|
30
|
+
Gecode::Raw.should_receive(:rel).once.with(
|
31
|
+
an_instance_of(Gecode::Raw::Space),
|
32
|
+
an_instance_of(Gecode::Raw::BoolVar), Gecode::Raw::BOT_OR,
|
33
|
+
an_instance_of(Gecode::Raw::BoolVar),
|
34
|
+
an_instance_of(Gecode::Raw::BoolVar),
|
35
|
+
Gecode::Raw::ICL_DEF, Gecode::Raw::PK_DEF
|
36
|
+
)
|
30
37
|
Gecode::Raw.should_receive(:rel).once.with(
|
31
38
|
an_instance_of(Gecode::Raw::Space),
|
32
39
|
an_instance_of(Gecode::Raw::IntVar), Gecode::Raw::IRT_GR, 0,
|
33
|
-
an_instance_of(Gecode::Raw::BoolVar), Gecode::Raw::ICL_DEF
|
40
|
+
an_instance_of(Gecode::Raw::BoolVar), Gecode::Raw::ICL_DEF,
|
41
|
+
Gecode::Raw::PK_DEF)
|
34
42
|
Gecode::Raw.should_receive(:rel).once.with(
|
35
43
|
an_instance_of(Gecode::Raw::Space),
|
36
44
|
an_instance_of(Gecode::Raw::IntVar), Gecode::Raw::IRT_EQ, 3,
|
37
|
-
an_instance_of(Gecode::Raw::BoolVar), Gecode::Raw::ICL_DEF
|
45
|
+
an_instance_of(Gecode::Raw::BoolVar), Gecode::Raw::ICL_DEF,
|
46
|
+
Gecode::Raw::PK_DEF)
|
38
47
|
(@x.must > 0) | (@y.must == 3)
|
39
48
|
sol = @model.solve!
|
40
49
|
end
|
@@ -52,14 +61,23 @@ describe Gecode::Constraints::ReifiableConstraint do
|
|
52
61
|
end
|
53
62
|
|
54
63
|
it 'should translate conjunctions' do
|
64
|
+
Gecode::Raw.should_receive(:rel).once.with(
|
65
|
+
an_instance_of(Gecode::Raw::Space),
|
66
|
+
an_instance_of(Gecode::Raw::BoolVar), Gecode::Raw::BOT_AND,
|
67
|
+
an_instance_of(Gecode::Raw::BoolVar),
|
68
|
+
an_instance_of(Gecode::Raw::BoolVar),
|
69
|
+
Gecode::Raw::ICL_DEF, Gecode::Raw::PK_DEF
|
70
|
+
)
|
55
71
|
Gecode::Raw.should_receive(:rel).once.with(
|
56
72
|
an_instance_of(Gecode::Raw::Space),
|
57
73
|
an_instance_of(Gecode::Raw::IntVar), Gecode::Raw::IRT_GR, 0,
|
58
|
-
an_instance_of(Gecode::Raw::BoolVar), Gecode::Raw::ICL_DEF
|
74
|
+
an_instance_of(Gecode::Raw::BoolVar), Gecode::Raw::ICL_DEF,
|
75
|
+
Gecode::Raw::PK_DEF)
|
59
76
|
Gecode::Raw.should_receive(:rel).once.with(
|
60
77
|
an_instance_of(Gecode::Raw::Space),
|
61
78
|
an_instance_of(Gecode::Raw::IntVar), Gecode::Raw::IRT_EQ, 2,
|
62
|
-
an_instance_of(Gecode::Raw::BoolVar), Gecode::Raw::ICL_DEF
|
79
|
+
an_instance_of(Gecode::Raw::BoolVar), Gecode::Raw::ICL_DEF,
|
80
|
+
Gecode::Raw::PK_DEF)
|
63
81
|
(@x.must > 0) & (@y.must == 2)
|
64
82
|
sol = @model.solve!
|
65
83
|
end
|
@@ -79,7 +79,7 @@ describe 'selection constraint', :shared => true do
|
|
79
79
|
@stub.must_be.subset_of(@target, hash)
|
80
80
|
@model.solve!
|
81
81
|
end
|
82
|
-
@expect_options =
|
82
|
+
@expect_options = option_expectation do |strength, kind, reif_var|
|
83
83
|
@expect.call(17, Gecode::Raw::SRT_SUB, @target, reif_var, false)
|
84
84
|
end
|
85
85
|
end
|
@@ -267,7 +267,7 @@ describe Gecode::Constraints::SetEnum::Selection, ' (disjoint)' do
|
|
267
267
|
@sets[@set].must_be.disjoint(hash)
|
268
268
|
@model.solve!
|
269
269
|
end
|
270
|
-
@expect_options =
|
270
|
+
@expect_options = option_expectation do |strength, kind, reif_var|
|
271
271
|
@expect.call(@set)
|
272
272
|
end
|
273
273
|
end
|
@@ -35,7 +35,7 @@ describe Gecode::Constraints::Set::Domain do
|
|
35
35
|
@set.must_be.superset_of(@non_range, hash)
|
36
36
|
@model.solve!
|
37
37
|
end
|
38
|
-
@expect_options =
|
38
|
+
@expect_options = option_expectation do |strength, kind, reif_var|
|
39
39
|
@expect.call(Gecode::Raw::SRT_SUP, @non_range, reif_var, false)
|
40
40
|
end
|
41
41
|
end
|
@@ -100,6 +100,7 @@ describe Gecode::Constraints::Set::Domain, ' (equality)' do
|
|
100
100
|
@range = 0..1
|
101
101
|
@non_range = [0, 2]
|
102
102
|
@singleton = 0
|
103
|
+
@model.branch_on @model.wrap_enum([@set])
|
103
104
|
|
104
105
|
@expect = lambda do |relation_type, rhs, reif_var|
|
105
106
|
@model.allow_space_access do
|
@@ -123,7 +124,7 @@ describe Gecode::Constraints::Set::Domain, ' (equality)' do
|
|
123
124
|
@set.must_be.equal_to(@non_range, hash)
|
124
125
|
@model.solve!
|
125
126
|
end
|
126
|
-
@expect_options =
|
127
|
+
@expect_options = option_expectation do |strength, kind, reif_var|
|
127
128
|
@expect.call(Gecode::Raw::SRT_EQ, @non_range, reif_var)
|
128
129
|
end
|
129
130
|
end
|
@@ -174,7 +175,10 @@ describe Gecode::Constraints::Set::Domain, ' (equality)' do
|
|
174
175
|
|
175
176
|
it 'should constrain the domain with inequality' do
|
176
177
|
@set.must_not == @singleton
|
177
|
-
@model.solve
|
178
|
+
@model.solve!
|
179
|
+
@set.should be_assigned
|
180
|
+
@set.value.should include(@singleton)
|
181
|
+
@set.value.size.should > 1
|
178
182
|
end
|
179
183
|
|
180
184
|
it_should_behave_like 'reifiable set constraint'
|
@@ -31,7 +31,7 @@ describe Gecode::Constraints::Set::Operation do
|
|
31
31
|
@set1.union(@set2).must_be.superset_of(@rhs, hash)
|
32
32
|
@model.solve!
|
33
33
|
end
|
34
|
-
@expect_options =
|
34
|
+
@expect_options = option_expectation do |strength, kind, reif_var|
|
35
35
|
@expect.call(@set1, Gecode::Raw::SOT_SUP, @set2, Gecode::Raw::SRT_SUP,
|
36
36
|
@rhs, reif_var, false)
|
37
37
|
end
|
@@ -199,7 +199,7 @@ describe 'set enum operation constraint', :shared => true do
|
|
199
199
|
@stub.must_be.superset_of(@rhs, hash)
|
200
200
|
@model.solve!
|
201
201
|
end
|
202
|
-
@expect_options =
|
202
|
+
@expect_options = option_expectation do |strength, kind, reif_var|
|
203
203
|
@expect.call(@sets, @operation_type, Gecode::Raw::SRT_SUP, @rhs,
|
204
204
|
reif_var, false)
|
205
205
|
end
|
@@ -31,7 +31,7 @@ describe Gecode::Constraints::Set::Relation do
|
|
31
31
|
@set.must_be.superset_of(@set2, hash)
|
32
32
|
@model.solve!
|
33
33
|
end
|
34
|
-
@expect_options =
|
34
|
+
@expect_options = option_expectation do |strength, kind, reif_var|
|
35
35
|
@expect.call(Gecode::Raw::SRT_SUP, @set2, reif_var, false)
|
36
36
|
end
|
37
37
|
end
|
@@ -84,7 +84,7 @@ describe Gecode::Constraints::Set::Relation, ' (equality)' do
|
|
84
84
|
@set.must_be.equal_to(@set2, hash)
|
85
85
|
@model.solve!
|
86
86
|
end
|
87
|
-
@expect_options =
|
87
|
+
@expect_options = option_expectation do |strength, kind, reif_var|
|
88
88
|
@expect.call(Gecode::Raw::SRT_EQ, @set2, reif_var)
|
89
89
|
end
|
90
90
|
end
|
@@ -146,10 +146,6 @@ describe Gecode::Constraints::Set::Relation, ' (elements)' do
|
|
146
146
|
@invoke_options = lambda do |hash|
|
147
147
|
@set.elements.must_be.equal_to(@int_var, hash)
|
148
148
|
end
|
149
|
-
|
150
|
-
@invoke_options = lambda do |hash|
|
151
|
-
@set.elements.must_be.equal_to(@int_var, hash)
|
152
|
-
end
|
153
149
|
end
|
154
150
|
|
155
151
|
Gecode::Constraints::Util::RELATION_TYPES.each_pair do |relation, type|
|
data/specs/constraints/sort.rb
CHANGED
@@ -28,24 +28,28 @@ describe Gecode::Constraints::IntEnum::Sort, ' (without :as and :order)' do
|
|
28
28
|
@vars.must_be.sorted(hash)
|
29
29
|
@model.solve!
|
30
30
|
end
|
31
|
-
@expect_options =
|
31
|
+
@expect_options = option_expectation do |strength, kind, reif_var|
|
32
32
|
if reif_var.nil?
|
33
33
|
Gecode::Raw.should_receive(:rel).exactly(@vars.size - 1).times.with(
|
34
34
|
an_instance_of(Gecode::Raw::Space),
|
35
35
|
an_instance_of(Gecode::Raw::IntVar), Gecode::Raw::IRT_LQ,
|
36
|
-
an_instance_of(Gecode::Raw::IntVar), strength)
|
36
|
+
an_instance_of(Gecode::Raw::IntVar), strength, kind)
|
37
37
|
else
|
38
|
+
Gecode::Raw.should_receive(:rel).once.with(
|
39
|
+
an_instance_of(Gecode::Raw::Space), anything,
|
40
|
+
an_instance_of(Gecode::Raw::BoolVarArray),
|
41
|
+
anything, anything, anything)
|
38
42
|
Gecode::Raw.should_receive(:rel).exactly(@vars.size - 1).times.with(
|
39
43
|
an_instance_of(Gecode::Raw::Space),
|
40
44
|
an_instance_of(Gecode::Raw::IntVar), Gecode::Raw::IRT_LQ,
|
41
45
|
an_instance_of(Gecode::Raw::IntVar),
|
42
|
-
an_instance_of(Gecode::Raw::BoolVar), strength)
|
46
|
+
an_instance_of(Gecode::Raw::BoolVar), strength, kind)
|
43
47
|
end
|
44
48
|
end
|
45
49
|
end
|
46
50
|
|
47
51
|
it 'should translate into n relation constraints' do
|
48
|
-
@expect_options.call(
|
52
|
+
@expect_options.call({})
|
49
53
|
@invoke_options.call({})
|
50
54
|
end
|
51
55
|
|
@@ -62,7 +66,7 @@ describe Gecode::Constraints::IntEnum::Sort, ' (without :as and :order)' do
|
|
62
66
|
values.should_not == values.sort
|
63
67
|
end
|
64
68
|
|
65
|
-
it_should_behave_like 'constraint
|
69
|
+
it_should_behave_like 'reifiable constraint'
|
66
70
|
end
|
67
71
|
|
68
72
|
describe Gecode::Constraints::IntEnum::Sort, ' (with :as)' do
|
@@ -78,16 +82,16 @@ describe Gecode::Constraints::IntEnum::Sort, ' (with :as)' do
|
|
78
82
|
@vars.must_be.sorted hash.update(:as => @sorted)
|
79
83
|
@model.solve!
|
80
84
|
end
|
81
|
-
@expect_options =
|
82
|
-
Gecode::Raw.should_receive(:
|
85
|
+
@expect_options = option_expectation do |strength, kind, reif_var|
|
86
|
+
Gecode::Raw.should_receive(:sorted).once.with(
|
83
87
|
an_instance_of(Gecode::Raw::Space),
|
84
88
|
an_instance_of(Gecode::Raw::IntVarArray),
|
85
|
-
an_instance_of(Gecode::Raw::IntVarArray), strength)
|
89
|
+
an_instance_of(Gecode::Raw::IntVarArray), strength, kind)
|
86
90
|
end
|
87
91
|
end
|
88
92
|
|
89
93
|
it 'should translate into a sortedness constraints' do
|
90
|
-
@expect_options.call(
|
94
|
+
@expect_options.call({})
|
91
95
|
@invoke_options.call({})
|
92
96
|
end
|
93
97
|
|
@@ -107,7 +111,7 @@ describe Gecode::Constraints::IntEnum::Sort, ' (with :as)' do
|
|
107
111
|
Gecode::MissingConstraintError)
|
108
112
|
end
|
109
113
|
|
110
|
-
it_should_behave_like 'constraint
|
114
|
+
it_should_behave_like 'non-reifiable constraint'
|
111
115
|
end
|
112
116
|
|
113
117
|
describe Gecode::Constraints::IntEnum::Sort, ' (with :order)' do
|
@@ -124,22 +128,22 @@ describe Gecode::Constraints::IntEnum::Sort, ' (with :order)' do
|
|
124
128
|
@vars.must_be.sorted hash.update(:order => @indices, :as => @sorted)
|
125
129
|
@model.solve!
|
126
130
|
end
|
127
|
-
@expect_options =
|
128
|
-
Gecode::Raw.should_receive(:
|
131
|
+
@expect_options = option_expectation do |strength, kind, reif_var|
|
132
|
+
Gecode::Raw.should_receive(:sorted).once.with(
|
129
133
|
an_instance_of(Gecode::Raw::Space),
|
130
134
|
an_instance_of(Gecode::Raw::IntVarArray),
|
131
135
|
an_instance_of(Gecode::Raw::IntVarArray),
|
132
|
-
an_instance_of(Gecode::Raw::IntVarArray), strength)
|
136
|
+
an_instance_of(Gecode::Raw::IntVarArray), strength, kind)
|
133
137
|
end
|
134
138
|
end
|
135
139
|
|
136
140
|
it 'should translate into a sortedness constraints' do
|
137
|
-
@expect_options.call(
|
141
|
+
@expect_options.call({})
|
138
142
|
@invoke_options.call({})
|
139
143
|
end
|
140
144
|
|
141
145
|
it 'should translate into a sortedness constraints, even without a target' do
|
142
|
-
@expect_options.call(
|
146
|
+
@expect_options.call({})
|
143
147
|
@vars.must_be.sorted(:order => @indices)
|
144
148
|
@model.solve!
|
145
149
|
end
|
@@ -171,5 +175,5 @@ describe Gecode::Constraints::IntEnum::Sort, ' (with :order)' do
|
|
171
175
|
end.should raise_error(Gecode::MissingConstraintError)
|
172
176
|
end
|
173
177
|
|
174
|
-
it_should_behave_like 'constraint
|
178
|
+
it_should_behave_like 'non-reifiable constraint'
|
175
179
|
end
|
data/specs/model.rb
CHANGED
@@ -13,8 +13,8 @@ describe Gecode::Model, ' (integer creation)' do
|
|
13
13
|
it 'should allow the creation of int variables without specified domain' do
|
14
14
|
var = @model.int_var
|
15
15
|
var.should be_range
|
16
|
-
var.min.should == Gecode::Raw::
|
17
|
-
var.max.should == Gecode::Raw::
|
16
|
+
var.min.should == Gecode::Raw::IntLimits::MIN
|
17
|
+
var.max.should == Gecode::Raw::IntLimits::MAX
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'should allow the creation of int variables with non-range domains' do
|
@@ -98,8 +98,8 @@ describe Gecode::Model, ' (set creation)' do
|
|
98
98
|
it 'should allow the creation of set variables without specified bounds' do
|
99
99
|
var = @model.set_var
|
100
100
|
var.lower_bound.size.should == 0
|
101
|
-
var.upper_bound.min.should == Gecode::Raw::
|
102
|
-
var.upper_bound.max.should == Gecode::Raw::
|
101
|
+
var.upper_bound.min.should == Gecode::Raw::SetLimits::MIN
|
102
|
+
var.upper_bound.max.should == Gecode::Raw::SetLimits::MAX
|
103
103
|
end
|
104
104
|
|
105
105
|
it 'should allow the creation of set variables with glb range and lub range' do
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Doing the full "release" task requires a number of gems:
|
2
|
+
|
3
|
+
# To run the Rake scripts.
|
4
|
+
rake
|
5
|
+
|
6
|
+
# To generate the website.
|
7
|
+
webgen
|
8
|
+
coderay
|
9
|
+
|
10
|
+
# To run the specs and produce a report for the website.
|
11
|
+
rspec
|
12
|
+
|
13
|
+
# To release files to RubyForge.
|
14
|
+
meta_project
|
15
|
+
rubyforge
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
To precompile the Windows gem you need to set up a cross-compilation
|
20
|
+
environment. See the following notes for instructions:
|
21
|
+
http://rubyforge.org/pipermail/gecoder-devel/2008-January/000039.html
|
data/tasks/distribution.rake
CHANGED
@@ -5,6 +5,8 @@ PKG_NAME_WITH_GECODE = 'gecoder-with-gecode'
|
|
5
5
|
PKG_VERSION = GecodeR::VERSION
|
6
6
|
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
7
7
|
PKG_FILE_NAME_WITH_GECODE = "#{PKG_NAME_WITH_GECODE}-#{PKG_VERSION}"
|
8
|
+
# The location where the precompiled DLL should be placed.
|
9
|
+
DLL_LOCATION = 'lib/gecode.dll'
|
8
10
|
|
9
11
|
desc 'Generate RDoc'
|
10
12
|
rd = Rake::RDocTask.new do |rdoc|
|
@@ -59,7 +61,7 @@ spec = Gem::Specification.new do |s|
|
|
59
61
|
].to_a
|
60
62
|
s.require_path = 'lib'
|
61
63
|
s.extensions << 'ext/extconf.rb'
|
62
|
-
s.requirements << 'Gecode 1.
|
64
|
+
s.requirements << 'Gecode 2.1.1'
|
63
65
|
|
64
66
|
s.has_rdoc = true
|
65
67
|
s.rdoc_options = rd.options
|
@@ -87,7 +89,8 @@ spec_windows_binary_with_gecode.platform = Gem::Platform::WIN32
|
|
87
89
|
# Create a clone of the gem spec that includes Gecode.
|
88
90
|
spec_with_gecode = spec.dup
|
89
91
|
spec_with_gecode.name = PKG_NAME_WITH_GECODE
|
90
|
-
spec_with_gecode.extensions =
|
92
|
+
spec_with_gecode.extensions =
|
93
|
+
spec_with_gecode.extensions.dup.unshift 'ext/gecode-2.1.1/configure'
|
91
94
|
spec_with_gecode.requirements = []
|
92
95
|
spec_with_gecode.files = spec.files.dup + FileList['ext/gecode-*/**/*'].to_a
|
93
96
|
|
@@ -112,12 +115,17 @@ file 'lib/gecode.dll' do
|
|
112
115
|
cd 'ext' do
|
113
116
|
sh 'ruby -Iwin32 extconf-win32.rb'
|
114
117
|
sh 'make'
|
115
|
-
mv 'gecode.so',
|
118
|
+
mv 'gecode.so', "../#{DLL_LOCATION}"
|
116
119
|
end
|
117
120
|
end
|
118
121
|
|
122
|
+
desc 'Removes generated distribution files'
|
123
|
+
task :clobber do
|
124
|
+
rm DLL_LOCATION if File.exists? DLL_LOCATION
|
125
|
+
end
|
126
|
+
|
119
127
|
desc 'Publish packages on RubyForge'
|
120
|
-
task :publish_packages => [:
|
128
|
+
task :publish_packages => [:publish_gecoder_packages,
|
121
129
|
:publish_gecoder_with_gecode_packages]
|
122
130
|
|
123
131
|
desc 'Publish Gecode/R packages on RubyForge'
|
@@ -153,4 +161,4 @@ task :publish_gecoder_with_gecode_packages => [:verify_user, :package] do
|
|
153
161
|
xf.files = release_files.to_a
|
154
162
|
xf.release_name = "Gecode/R with Gecode #{PKG_VERSION}"
|
155
163
|
end
|
156
|
-
end
|
164
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -38,11 +38,11 @@ static inline int32_t ruby2int(VALUE rval, int argn = -1) {
|
|
38
38
|
}
|
39
39
|
|
40
40
|
static inline VALUE cxx2ruby(int32_t val) {
|
41
|
-
return
|
41
|
+
return INT2NUM(val);
|
42
42
|
}
|
43
43
|
|
44
44
|
static inline VALUE cxx2ruby(uint32_t val) {
|
45
|
-
return
|
45
|
+
return INT2NUM(val);
|
46
46
|
}
|
47
47
|
|
48
48
|
static inline VALUE cxx2ruby(double val) {
|
@@ -38,10 +38,10 @@ module Rust
|
|
38
38
|
@prototype_template = "void set!attribute_bindname!(VALUE self, VALUE val);\nVALUE get!attribute_bindname!(VALUE self);\n"
|
39
39
|
@initialization_template = Templates["AttributeInitBinding"]
|
40
40
|
|
41
|
-
|
42
41
|
add_expansion 'parent_varname', "@options[:parent].varname"
|
43
42
|
add_expansion 'attribute_bindname', "@name"
|
44
|
-
add_expansion 'attribute_type', "@type"
|
43
|
+
add_expansion 'attribute_type', "@type.name"
|
44
|
+
add_expansion 'attribute_convert_name', "@type.valid_name"
|
45
45
|
add_expansion 'attribute_name', "@name"
|
46
46
|
end
|
47
47
|
|