cbc-wrapper 2.9.9.3 → 2.9.9.5
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.
- checksums.yaml +4 -4
- data/.gitignore +5 -0
- data/README.md +28 -9
- data/cbc-wrapper.gemspec +1 -1
- data/ext/cbc-wrapper/cbc.i +4 -4
- data/ext/cbc-wrapper/cbc_wrap.c +266 -148
- data/ext/cbc-wrapper/coin/Cbc_C_Interface.h +381 -0
- data/ext/cbc-wrapper/coin/Coin_C_defines.h +115 -0
- data/ext/cbc-wrapper/extconf.rb +20 -27
- data/lib/cbc-wrapper/version.rb +1 -1
- data/lib/cbc-wrapper.rb +1 -1
- metadata +10 -10
- data/ext/cbc-wrapper/install/.gitignore +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79f98579bdbf303fb8b3f8db626f8c1e0ae523ce35cdb78b68585e0d7a4295d6
|
4
|
+
data.tar.gz: 0bb70972a2a91a316752dde8375110196f7522b19b90336d2db201804095a0a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59b0e6f7d93e60f02462c1a6811c306d8ee0f117a483250d19c9a973aa6ad46689c5e834e8d8af487153e87464f51cb3f8d4990470f170fc38e2e0e7eac2c106
|
7
|
+
data.tar.gz: 4e44129dc6a061a070c13fab6b52d68cc19231f77bd79bfb67d11190fa984bf54095eae241fb4ebf793f90b896d20cd2f041a5489301af958eac51027f3fc4bb
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -5,6 +5,12 @@ It uses the version 2.9.9 of Cbc.
|
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
|
8
|
+
This gem requires you to have Cbc installed on your system first.
|
9
|
+
|
10
|
+
- On a mac, you can execute `brew install cbc`
|
11
|
+
- On Debian and Ubuntu, use `apt-get install coinor-libcbc-dev`
|
12
|
+
- On Archlinux, use `pacman -S coin-or-cbc`
|
13
|
+
|
8
14
|
Add this line to your application's Gemfile:
|
9
15
|
|
10
16
|
```ruby
|
@@ -19,15 +25,29 @@ Or install it yourself as:
|
|
19
25
|
|
20
26
|
$ gem install cbc-wrapper
|
21
27
|
|
22
|
-
|
23
|
-
|
28
|
+
WARNING: if you want the gem to download and compile the library sources when installing the gem,
|
29
|
+
you will need to use a lesser version of it (2.9.9.3).
|
30
|
+
|
31
|
+
### Heroku
|
32
|
+
|
33
|
+
On Heroku, you will need to tweak your installation a bit: you can install the cbc library with
|
34
|
+
the [Apt](https://github.com/heroku/heroku-buildpack-apt) buildpack with an Aptfile of:
|
35
|
+
|
36
|
+
```
|
37
|
+
coinor-libcbc-dev
|
38
|
+
```
|
39
|
+
|
40
|
+
You will need to set LD_LIBRARY_PATH so it can find LAPACK and BLAS (see this [issue](https://github.com/heroku/heroku-buildpack-apt/issues/35)).
|
24
41
|
|
25
|
-
|
42
|
+
```
|
43
|
+
heroku config:set LD_LIBRARY_PATH=/app/.apt/usr/lib/x86_64-linux-gnu/lapack:/app/.apt/usr/lib/x86_64-linux-gnu/blas
|
44
|
+
```
|
26
45
|
|
27
46
|
## Usage
|
28
47
|
|
29
48
|
All functions defined in Cbc_C_interface.h are wrapped. You can use any function named
|
30
|
-
`func_name` with
|
49
|
+
`func_name` with
|
50
|
+
|
31
51
|
```ruby
|
32
52
|
Cbc_wrapper.func_name
|
33
53
|
```
|
@@ -100,7 +120,7 @@ Below is the Cbc_C_interface.h file:
|
|
100
120
|
COINLIBAPI void COINLINKAGE
|
101
121
|
Cbc_writeMps(Cbc_Model * model, const char *filename)
|
102
122
|
;
|
103
|
-
/** Provide an initial feasible solution to accelerate branch-and-bound
|
123
|
+
/** Provide an initial feasible solution to accelerate branch-and-bound
|
104
124
|
Note that feasibility of the solution is *not* verified.
|
105
125
|
*/
|
106
126
|
COINLIBAPI void COINLINKAGE
|
@@ -111,7 +131,7 @@ Below is the Cbc_C_interface.h file:
|
|
111
131
|
Cbc_problemName(Cbc_Model * model, int maxNumberCharacters, char * array)
|
112
132
|
;
|
113
133
|
/** Sets problem name.
|
114
|
-
|
134
|
+
|
115
135
|
\p array must be a null-terminated string.
|
116
136
|
*/
|
117
137
|
COINLIBAPI int COINLINKAGE
|
@@ -240,13 +260,13 @@ Below is the Cbc_C_interface.h file:
|
|
240
260
|
/**@name Solver parameters */
|
241
261
|
/*@{*/
|
242
262
|
/** Set parameter "name" to value "value". Note that this
|
243
|
-
* translates directly to using "-name value" as a
|
263
|
+
* translates directly to using "-name value" as a
|
244
264
|
* command-line argument to Cbc.*/
|
245
265
|
COINLIBAPI void COINLINKAGE
|
246
266
|
Cbc_setParameter(Cbc_Model * model, const char * name, const char * value)
|
247
267
|
;
|
248
268
|
|
249
|
-
|
269
|
+
|
250
270
|
/*@}*/
|
251
271
|
/**@name Message handling. Call backs are handled by ONE function */
|
252
272
|
/*@{*/
|
@@ -394,4 +414,3 @@ Below is the Cbc_C_interface.h file:
|
|
394
414
|
## Contributing
|
395
415
|
|
396
416
|
Bug reports and pull requests are welcome on GitHub at https://github.com/gverger/cbc-wrapper.
|
397
|
-
|
data/cbc-wrapper.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.require_paths = ["lib", "ext"]
|
28
28
|
spec.extensions << "ext/cbc-wrapper/extconf.rb"
|
29
29
|
|
30
|
-
spec.add_development_dependency "bundler", "~>
|
30
|
+
spec.add_development_dependency "bundler", "~> 2.4"
|
31
31
|
spec.add_development_dependency "rake", "~> 10.0"
|
32
32
|
spec.add_development_dependency "rspec"
|
33
33
|
spec.add_development_dependency "rake-compiler"
|
data/ext/cbc-wrapper/cbc.i
CHANGED
@@ -4,12 +4,12 @@
|
|
4
4
|
%include "carrays.i"
|
5
5
|
|
6
6
|
%{
|
7
|
-
#include "Coin_C_defines.h"
|
8
|
-
#include "Cbc_C_Interface.h"
|
7
|
+
#include "coin/Coin_C_defines.h"
|
8
|
+
#include "coin/Cbc_C_Interface.h"
|
9
9
|
%}
|
10
10
|
|
11
11
|
%array_class(int, IntArray)
|
12
12
|
%array_class(double, DoubleArray)
|
13
13
|
|
14
|
-
%include "Coin_C_defines.h"
|
15
|
-
%include "Cbc_C_Interface.h"
|
14
|
+
%include "coin/Coin_C_defines.h"
|
15
|
+
%include "coin/Cbc_C_Interface.h"
|