Module: Dither
- Defined in:
- lib/dither/chinese_postman_problem.rb,
lib/dither.rb,
lib/dither/aetg.rb,
lib/dither/ipog.rb,
lib/dither/mipog.rb,
lib/dither/param.rb,
lib/dither/version.rb,
lib/dither/test_case.rb,
lib/dither/ipog_helper.rb,
lib/dither/aetg_pairwise.rb,
lib/dither/unbound_param.rb,
lib/dither/java_ext/dither.rb
Overview
Defined Under Namespace
Modules: Aetg, Cpp, IPOGHelper
Classes: Error, IPOG, MIPOG, Param, TestCase, UnboundParam
Constant Summary
collapse
- DEFUALT_OPTS =
{
:t => 2
}
- VERSION =
'0.1.1'
Class Method Summary
collapse
Class Method Details
.aetg(params, opts = {}) ⇒ Object
29
30
31
32
|
# File 'lib/dither.rb', line 29
def self.aetg(params, opts = {})
opts = DEFUALT_OPTS.dup.merge(opts)
Aetg::Pairwise.new(params, opts).run
end
|
.all_edges(raw_graph) ⇒ Object
217
218
219
|
# File 'lib/dither/chinese_postman_problem.rb', line 217
def self.all_edges(raw_graph)
Dither::Cpp::Graph.create(raw_graph).cpp
end
|
.all_pairs(params, t = 2, opts = {}) ⇒ Object
13
14
15
16
|
# File 'lib/dither.rb', line 13
def self.all_pairs(params, t = 2, opts = {})
opts[:t] = t
IPOG.new(params, opts).run
end
|
.ateg ⇒ Object
34
35
36
37
|
# File 'lib/dither.rb', line 34
def self.aetg(params, opts = {})
opts = DEFUALT_OPTS.dup.merge(opts)
Aetg::Pairwise.new(params, opts).run
end
|
.constraints_to_java(param_length, constraints) ⇒ Object
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/dither/java_ext/dither.rb', line 31
def self.constraints_to_java(param_length, constraints)
return [].to_java if constraints.nil?
result = []
constraints.each do |constraint|
new_constraint = Array.new(param_length)
constraint.each do |k, v|
new_constraint[k] = v
end
result << new_constraint
end
result.map { |a| a.to_java(java.lang.Integer) }.to_java
end
|
.ipog(params, opts = {}) ⇒ Object
18
19
20
21
|
# File 'lib/dither.rb', line 18
def self.ipog(params, opts = {})
opts = DEFUALT_OPTS.dup.merge(opts)
IPOG.new(params, opts).run
end
|
.mipog(params, t = 2, opts = {}) ⇒ Object
23
24
25
26
27
|
# File 'lib/dither.rb', line 23
def self.mipog(params, t = 2, opts = {})
raise Error, 'mipog does not support constraints' if opts.key?(:constraints)
opts[:t] = t
MIPOG.new(params, opts).run
end
|