cbc 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +4 -2
- data/lib/cbc/model.rb +1 -6
- data/lib/cbc/version.rb +1 -1
- data/lib/cbc.rb +9 -4
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db11406633025df703e0c5317e2d035008234c47dadd6aebfcfd3d76c04117e8
|
4
|
+
data.tar.gz: cb2f05ed70bbd91685fbb1317dffdf5dc0ea0e1d9b649113baf9ebaf459de1a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f53320ef57ddc9e67c2ac75a8f886d789106e7e5fa204a6d4201b501925aad6d8df9d7712a9402cab966584d7ea0ce49bfb050683e63930e29f17b8365b920d2
|
7
|
+
data.tar.gz: 1e0248fafc1510c916b15765abd2677efb63595ae3839bd095c2ab2abce3a603a61df8190d8b8f493588eccb166c098642949843088c5c4d4600ba854cbc85ba
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
## 0.2.0 (2024-10-22)
|
2
|
+
|
3
|
+
- Added support for `coinor-libcbc3.1` package
|
4
|
+
- Dropped support for Ruby < 3.1
|
5
|
+
|
6
|
+
## 0.1.2 (2023-06-07)
|
7
|
+
|
8
|
+
- Improved support for Mac ARM
|
9
|
+
- Fixed error with `dup` and `clone`
|
10
|
+
|
1
11
|
## 0.1.1 (2022-06-12)
|
2
12
|
|
3
13
|
- Fixed status
|
data/README.md
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
[Cbc](https://github.com/coin-or/Cbc) - the mixed-integer programming solver - for Ruby
|
4
4
|
|
5
|
-
[
|
5
|
+
Check out [Opt](https://github.com/ankane/opt) for a high-level interface
|
6
|
+
|
7
|
+
[![Build Status](https://github.com/ankane/cbc-ruby/actions/workflows/build.yml/badge.svg)](https://github.com/ankane/cbc-ruby/actions)
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
@@ -15,7 +17,7 @@ brew install cbc
|
|
15
17
|
And for Ubuntu, use:
|
16
18
|
|
17
19
|
```sh
|
18
|
-
sudo apt-get install coinor-libcbc3
|
20
|
+
sudo apt-get install coinor-libcbc3.1 # or coinor-libcbc3
|
19
21
|
```
|
20
22
|
|
21
23
|
Then add this line to your application’s Gemfile:
|
data/lib/cbc/model.rb
CHANGED
@@ -2,7 +2,7 @@ module Cbc
|
|
2
2
|
class Model
|
3
3
|
def initialize
|
4
4
|
@model = FFI.Cbc_newModel
|
5
|
-
|
5
|
+
@model.free = FFI["Cbc_deleteModel"]
|
6
6
|
|
7
7
|
@below210 = Gem::Version.new(Cbc.lib_version) < Gem::Version.new("2.10.0")
|
8
8
|
FFI.Cbc_setLogLevel(model, 0) unless @below210
|
@@ -96,11 +96,6 @@ module Cbc
|
|
96
96
|
}
|
97
97
|
end
|
98
98
|
|
99
|
-
def self.finalize(model)
|
100
|
-
# must use proc instead of stabby lambda
|
101
|
-
proc { FFI.Cbc_deleteModel(model) }
|
102
|
-
end
|
103
|
-
|
104
99
|
private
|
105
100
|
|
106
101
|
def model
|
data/lib/cbc/version.rb
CHANGED
data/lib/cbc.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
require "fiddle/import"
|
3
3
|
|
4
4
|
# modules
|
5
|
-
|
6
|
-
|
5
|
+
require_relative "cbc/model"
|
6
|
+
require_relative "cbc/version"
|
7
7
|
|
8
8
|
module Cbc
|
9
9
|
class Error < StandardError; end
|
@@ -16,11 +16,16 @@ module Cbc
|
|
16
16
|
# TODO test
|
17
17
|
["CbcSolver.dll"]
|
18
18
|
elsif RbConfig::CONFIG["host_os"] =~ /darwin/i
|
19
|
-
["
|
19
|
+
if RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i
|
20
|
+
["libCbcSolver.dylib", "/opt/homebrew/lib/libCbcSolver.dylib"]
|
21
|
+
else
|
22
|
+
["libCbcSolver.dylib"]
|
23
|
+
end
|
20
24
|
else
|
21
25
|
# coinor-libcbc-dev has libCbcSolver.so
|
26
|
+
# coinor-libcbc3.1 has libCbcSolver.so.3.1
|
22
27
|
# coinor-libcbc3 has libCbcSolver.so.3
|
23
|
-
["libCbcSolver.so", "libCbcSolver.so.3"]
|
28
|
+
["libCbcSolver.so", "libCbcSolver.so.3.1", "libCbcSolver.so.3"]
|
24
29
|
end
|
25
30
|
self.ffi_lib = lib_name
|
26
31
|
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cbc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
11
|
+
date: 2024-10-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: fiddle
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
description:
|
14
28
|
email: andrew@ankane.org
|
15
29
|
executables: []
|
@@ -35,14 +49,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
35
49
|
requirements:
|
36
50
|
- - ">="
|
37
51
|
- !ruby/object:Gem::Version
|
38
|
-
version: '
|
52
|
+
version: '3.1'
|
39
53
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
40
54
|
requirements:
|
41
55
|
- - ">="
|
42
56
|
- !ruby/object:Gem::Version
|
43
57
|
version: '0'
|
44
58
|
requirements: []
|
45
|
-
rubygems_version: 3.
|
59
|
+
rubygems_version: 3.5.16
|
46
60
|
signing_key:
|
47
61
|
specification_version: 4
|
48
62
|
summary: Mixed-integer programming for Ruby
|