cbc 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +2 -0
- data/lib/cbc/model.rb +1 -6
- data/lib/cbc/version.rb +1 -1
- data/lib/cbc.rb +7 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 872906265947008e72d46ca695d37f3787b58207e985e22e0446c1ecea0e7696
|
4
|
+
data.tar.gz: 0bc422b8cc9b5d7aff800f6210799f4003509c62d5d3833a0c5eee3fbc5b4c62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9df3966a5841c3cb280a40153f8c3e97d6b60e52702850b9f5a1f2193759fd17f7f6040830b4f30828686a4b9354f164b79db247102d1c433d80e9a5e2f16e36
|
7
|
+
data.tar.gz: 7937bccb59ba45630c137ec8a415e7e8f15255db4a4ff860bd89629a91682c66f0d338788a1f943684ed16e8617bfc2b9ca8942cd853800feebf45b7353ba431
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
[Cbc](https://github.com/coin-or/Cbc) - the mixed-integer programming solver - for Ruby
|
4
4
|
|
5
|
+
Check out [Opt](https://github.com/ankane/opt) for a high-level interface
|
6
|
+
|
5
7
|
[![Build Status](https://github.com/ankane/cbc-ruby/workflows/build/badge.svg?branch=master)](https://github.com/ankane/cbc-ruby/actions)
|
6
8
|
|
7
9
|
## Installation
|
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,7 +16,11 @@ 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
|
22
26
|
# coinor-libcbc3 has libCbcSolver.so.3
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cbc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: andrew@ankane.org
|
@@ -42,7 +42,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '0'
|
44
44
|
requirements: []
|
45
|
-
rubygems_version: 3.
|
45
|
+
rubygems_version: 3.4.10
|
46
46
|
signing_key:
|
47
47
|
specification_version: 4
|
48
48
|
summary: Mixed-integer programming for Ruby
|