gecoder-with-gecode 0.7.1-mswin32 → 0.8.0-mswin32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. data/CHANGES +7 -0
  2. data/README +10 -1
  3. data/lib/gecode.dll +0 -0
  4. data/lib/gecoder/bindings/bindings.rb +407 -731
  5. data/lib/gecoder/interface/binding_changes.rb +1 -1
  6. data/lib/gecoder/interface/branch.rb +25 -25
  7. data/lib/gecoder/interface/constraints.rb +47 -4
  8. data/lib/gecoder/interface/constraints/bool/boolean.rb +18 -16
  9. data/lib/gecoder/interface/constraints/bool_enum/boolean.rb +13 -11
  10. data/lib/gecoder/interface/constraints/int/arithmetic.rb +5 -4
  11. data/lib/gecoder/interface/constraints/int/domain.rb +8 -9
  12. data/lib/gecoder/interface/constraints/int/linear.rb +10 -8
  13. data/lib/gecoder/interface/constraints/int_enum/arithmetic.rb +4 -4
  14. data/lib/gecoder/interface/constraints/int_enum/channel.rb +2 -2
  15. data/lib/gecoder/interface/constraints/int_enum/count.rb +4 -5
  16. data/lib/gecoder/interface/constraints/int_enum/distinct.rb +7 -2
  17. data/lib/gecoder/interface/constraints/int_enum/element.rb +2 -2
  18. data/lib/gecoder/interface/constraints/int_enum/equality.rb +6 -3
  19. data/lib/gecoder/interface/constraints/int_enum/sort.rb +17 -5
  20. data/lib/gecoder/interface/constraints/set_enum/distinct.rb +0 -36
  21. data/lib/gecoder/interface/constraints/set_var_constraints.rb +5 -0
  22. data/lib/gecoder/interface/model.rb +3 -3
  23. data/lib/gecoder/interface/search.rb +5 -4
  24. data/lib/gecoder/version.rb +1 -1
  25. data/specs/branch.rb +27 -27
  26. data/specs/constraints/arithmetic.rb +48 -30
  27. data/specs/constraints/bool_enum.rb +39 -19
  28. data/specs/constraints/boolean.rb +10 -10
  29. data/specs/constraints/cardinality.rb +12 -9
  30. data/specs/constraints/channel.rb +6 -6
  31. data/specs/constraints/connection.rb +22 -26
  32. data/specs/constraints/constraint_helper.rb +125 -41
  33. data/specs/constraints/count.rb +22 -15
  34. data/specs/constraints/distinct.rb +10 -64
  35. data/specs/constraints/element.rb +14 -12
  36. data/specs/constraints/equality.rb +4 -4
  37. data/specs/constraints/int_domain.rb +8 -7
  38. data/specs/constraints/int_relation.rb +12 -8
  39. data/specs/constraints/linear.rb +4 -4
  40. data/specs/constraints/reification_sugar.rb +22 -4
  41. data/specs/constraints/selection.rb +2 -2
  42. data/specs/constraints/set_domain.rb +7 -3
  43. data/specs/constraints/set_operation.rb +2 -2
  44. data/specs/constraints/set_relation.rb +2 -6
  45. data/specs/constraints/sort.rb +20 -16
  46. data/specs/model.rb +4 -4
  47. data/tasks/dependencies.txt +21 -0
  48. data/tasks/distribution.rake +13 -5
  49. data/vendor/gecode/win32/lib/libgecodeint.dll +0 -0
  50. data/vendor/gecode/win32/lib/libgecodekernel.dll +0 -0
  51. data/vendor/gecode/win32/lib/libgecodeminimodel.dll +0 -0
  52. data/vendor/gecode/win32/lib/libgecodesearch.dll +0 -0
  53. data/vendor/gecode/win32/lib/libgecodeset.dll +0 -0
  54. data/vendor/gecode/win32/lib/libgecodesupport.dll +0 -0
  55. data/vendor/rust/include/rust_checks.hh +2 -1
  56. data/vendor/rust/include/rust_conversions.hh +2 -2
  57. data/vendor/rust/rust/attribute.rb +2 -2
  58. data/vendor/rust/rust/class.rb +2 -2
  59. data/vendor/rust/rust/cxxclass.rb +0 -2
  60. data/vendor/rust/rust/function.rb +2 -2
  61. data/vendor/rust/rust/templates/AttributeDefinition.rusttpl +1 -1
  62. data/vendor/rust/rust/templates/StandaloneClassDeclarations.rusttpl +1 -1
  63. data/vendor/rust/rust/templates/VariableFunctionCall.rusttpl +1 -1
  64. data/vendor/rust/rust/type.rb +1 -1
  65. metadata +4 -3
  66. data/tasks/building.howto +0 -65
@@ -41,7 +41,7 @@ module Rust
41
41
  # and a few other needed information.
42
42
  #
43
43
  # Don't call this function directly, use Namespace.add_cxx_class
44
- def initialize(name, namespace, bindname = name.split("::").last ) # :notnew:
44
+ def initialize(name, namespace, bindname = name.gsub(/::([^<>]+)$/,'\1') ) # :notnew:
45
45
  super()
46
46
 
47
47
  @name = name
@@ -220,7 +220,7 @@ module Rust
220
220
  super
221
221
 
222
222
  @varname =
223
- "f#{@parent.namespace.name.gsub("::","_")}_#{@parent.name}_#{@name}"
223
+ "f#{@parent.namespace.name.gsub("::","_")}_#{@parent.varname}_#{@name}"
224
224
 
225
225
  @definition_template = Templates["CxxMethodStub"]
226
226
  @initialization_template = Templates["MethodInitBinding"]
@@ -44,8 +44,6 @@ module Rust
44
44
 
45
45
  @definition_template = Templates["CxxClassDefinitions"]
46
46
 
47
- @varname = "#{complete_name.gsub("::", "_")}"
48
-
49
47
  if @parent
50
48
  @ptrmap = @parent.ptrmap
51
49
  @function_free = @parent.function_free
@@ -117,7 +117,7 @@ module Rust
117
117
  @parent = params[:parent]
118
118
  @optional_count = 0
119
119
 
120
- @varname = "f#{@parent.varname}#{@name}"
120
+ @varname = "f#{@parent.varname}#{@name.gsub('::', '_').gsub(/[<>]/, '')}"
121
121
 
122
122
  @aliases = Set.new
123
123
  @variable = false # Variable arguments function
@@ -139,7 +139,7 @@ module Rust
139
139
  add_expansion 'function_parameters', 'ruby_parameters'
140
140
  add_expansion 'function_call', 'stub'
141
141
  add_expansion 'function_varname', 'varname'
142
- add_expansion 'function_cname', '@name'
142
+ add_expansion 'function_cname', 'varname'
143
143
  add_expansion 'function_paramcount', 'paramcount'
144
144
  add_expansion 'function_bindname', '@bindname'
145
145
  add_expansion 'parent_varname', '@parent.varname'
@@ -5,7 +5,7 @@ VALUE set!parent_varname!!attribute_bindname!(VALUE self, VALUE val) {
5
5
  !c_class_name!* tmp = ruby2!class_varcname!Ptr(self);
6
6
  if ( ! tmp ) return Qnil;
7
7
 
8
- tmp->!attribute_name! = ruby2!attribute_type!(val);
8
+ tmp->!attribute_name! = ruby2!attribute_convert_name!(val);
9
9
  return Qnil;
10
10
  }
11
11
 
@@ -4,4 +4,4 @@ typedef std::map<VALUE, !c_class_name!*> T!class_ptrmap!;
4
4
  extern T!class_ptrmap! !class_ptrmap!;
5
5
  static void !class_varname!_free(void *p);
6
6
  static void !class_varname!_mark(void *p);
7
- static void !class_varname!_free_map_entry(void *p);
7
+ static void !class_varname!_free_map_entry(void *p);
@@ -9,6 +9,6 @@
9
9
 
10
10
  if ( !ok )
11
11
  {
12
- rb_raise(rb_eArgError, "Mantatory parameters missing");
12
+ rb_raise(rb_eArgError, "Mandatory parameters missing");
13
13
  return Qnil;
14
14
  }
@@ -41,7 +41,7 @@ module Rust
41
41
 
42
42
  end
43
43
 
44
- @valid_name = @valid_name.gsub("::", "_").gsub(/&|\s/, "")
44
+ @valid_name = @valid_name.gsub("::", "_").gsub(/[&\s<>]/, "")
45
45
  end
46
46
 
47
47
  def pointer?
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: gecoder-with-gecode
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.7.1
7
- date: 2008-01-24 00:00:00 +01:00
6
+ version: 0.8.0
7
+ date: 2008-04-10 00:00:00 +02:00
8
8
  summary: Ruby interface to Gecode, an environment for constraint programming.
9
9
  require_paths:
10
10
  - lib
@@ -153,7 +153,7 @@ files:
153
153
  - tasks/svn.rake
154
154
  - tasks/rcov.rake
155
155
  - tasks/specs.rake
156
- - tasks/building.howto
156
+ - tasks/dependencies.txt
157
157
  - specs/constraints
158
158
  - specs/constraints/boolean.rb
159
159
  - specs/constraints/bool_enum.rb
@@ -193,6 +193,7 @@ files:
193
193
  - vendor/gecode/win32/lib/libgecodeminimodel.dll
194
194
  - vendor/gecode/win32/lib/libgecodesearch.dll
195
195
  - vendor/gecode/win32/lib/libgecodeset.dll
196
+ - vendor/gecode/win32/lib/libgecodesupport.dll
196
197
  - lib/gecode.dll
197
198
  test_files:
198
199
  - specs/constraints/boolean.rb
data/tasks/building.howto DELETED
@@ -1,65 +0,0 @@
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
- Crosscompiling the win32 binaries under Linux requires the following.
18
-
19
- http://www.libsdl.org/extras/win32/cross/README.txt
20
- http://www.mingw.org/
21
- http://www.profv.de/mingw_cross_env/
22
- http://www.mingw.org/MinGWiki/index.php/build%20a%20Win32%20x-compiler%20for%20Linux
23
- http://www.mingw.org/MinGWiki/index.php/BuildMingwCross
24
-
25
- Used the patch in the end of
26
- http://www.mingw.org/MinGWiki/index.php/build%20a%20Win32%20x-compiler%20for%20Linux
27
- but with
28
- BINUTILS_ARCHIVE="binutils-2.18.50-20071123-src.tar.gz"
29
-
30
- Generate rbconfig.rb by following:
31
- http://eigenclass.org/hiki.rb?cross+compiling+rcovrt
32
-
33
- In ext do:
34
- ruby -I win32 extconf.rb
35
- make
36
-
37
- # ruby -Iwin32 -Iwin32/gecode-1.3.1/include/ -Iwin32/gecode-1.3.1/lib/ -I~/cross-compile/ruby-mingw32/lib/ruby/1.8/i386-mingw32/ extconf-win32.rb
38
-
39
-
40
- get mingw32 via modified install script (need at least gcc4.2 due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27650)
41
- add bin to bath, make i386-* symbolic links: ruby -e "Dir['*'].each{ |x| %x{ln -s -T #{x} i386-#{x}} }"
42
- compile Ruby with cross-compile script
43
- comment out the read, write and select macros in ruby-mingw32/lib/ruby/1.8/i386-mingw32/win32/win32.h
44
- edit rbconfig.rb to use mingw32-g++ instead of mingw32-gcc in "LDSHARED".
45
- copy the produced rbconfig.rb file to ext/win32
46
- compile Gecode with the cross-compile script
47
- move dlls to ext/, move includes to ext/win32
48
- install pexports (included in mingw-utils)
49
- create definitions from MSVC dlls: ruby -e "Dir['*.dll'].each{ |x| %x{pexports #{x} > #{x.sub('dll', 'def')}} }"
50
- ruby -e "Dir['*.def'].each{ |x| %x{mingw32-dlltool -U -d #{x} > lib#{x.downcase.chomp('def')}a} }"
51
- ruby -Iwin32 extconf-win32.rb
52
- make
53
-
54
- # Building Gecode and Gecode/R dlls using mingw:
55
- get mingw32 via modified install script (need at least gcc4.2 due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27650)
56
- add bin to bath, make i386-* symbolic links: ruby -e "Dir['*'].each{ |x| %x{ln -s -T #{x} i386-#{x}} }"
57
- compile Ruby with cross-compile script
58
- comment out the read, write and select macros in ruby-mingw32/lib/ruby/1.8/i386-mingw32/win32/win32.h
59
- edit rbconfig.rb to use mingw32-g++ instead of mingw32-gcc in "LDSHARED".
60
- copy the produced rbconfig.rb file to ext/win32
61
- compile Gecode with the cross-compile script
62
- move dlls to ext/, move includes to ext/win32
63
- ruby -Iwin32 extconf-win32.rb
64
- make
65
- move gecode.dll to lib/, put the Gecode dlls somewhere in the path