highs 0.2.4 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76f4f89a97e042a3b1bed033953cedae075c205accdcc07e4c724fde10a0e9d0
4
- data.tar.gz: f98265f26103d67f238e0f59ec93ba9c85369526bf0690e27d823c77e0570384
3
+ metadata.gz: c3d0ceaf922a6504fef534e0f0c3dd6bf180821ca4087461a4c27197b5e4b508
4
+ data.tar.gz: 8fb06e82193f879b012f96ae53c748ec6c8d1dae22c39fa1af29091f9c2b2049
5
5
  SHA512:
6
- metadata.gz: d6172fc034deb3a2a8c402fd8c01159fc82a3451b07e2fbc1f357b2a5142d23390000077ae1df9ebcc0886cd7aea544fa975e4b4de41132c7419da9793a248ec
7
- data.tar.gz: d5bb3f1dff6a4bd054d6224f16da3d19681de1835db430acd57911f048d59545ea90fe383325bd50f2e4aaf1af42cb3a3d3d2f1651c3735a58ca4e72eb8133de
6
+ metadata.gz: 607c3cf811e9b09a62cb23a613a9d8838939f9149bc1ed37ef4014f589f63c38fb549c34c392aecb8544e7f138987aa4098c38f51af2ebfed7541bbe4d771bfb
7
+ data.tar.gz: d17a5822aa7ff198ec3ced50f0d9dac3e027377dd6200e2f8f1e8417ba5d6a778980ad4dc76f17c4fe499119e65f77df6eea8435594dfd2dfb7483ab769f8ce0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.5 (2025-05-04)
2
+
3
+ - Fixed memory leak
4
+
1
5
  ## 0.2.4 (2025-03-20)
2
6
 
3
7
  - Updated HiGHS to 1.10.0
data/lib/highs/array.rb CHANGED
@@ -6,7 +6,7 @@ module Highs
6
6
  @size = size
7
7
  @ptr =
8
8
  if value == NOT_SET
9
- Fiddle::Pointer.malloc(size * self.class::SIZE)
9
+ Fiddle::Pointer.malloc(size * self.class::SIZE, Fiddle::RUBY_FREE)
10
10
  else
11
11
  if value.size != size
12
12
  # TODO add variable name to message
data/lib/highs/methods.rb CHANGED
@@ -70,7 +70,7 @@ module Highs
70
70
 
71
71
  def read(filename)
72
72
  model = Model.new
73
- check_status FFI.Highs_readModel(model, filename)
73
+ check_status FFI.Highs_readModel(model, +filename)
74
74
  model
75
75
  end
76
76
 
data/lib/highs/model.rb CHANGED
@@ -4,7 +4,7 @@ module Highs
4
4
  @ptr = FFI.Highs_create
5
5
  @ptr.free = FFI["Highs_destroy"]
6
6
 
7
- check_status FFI.Highs_setBoolOptionValue(@ptr, "output_flag", 0)
7
+ check_status FFI.Highs_setBoolOptionValue(@ptr, +"output_flag", 0)
8
8
  end
9
9
 
10
10
  def solve(verbose: false, time_limit: nil)
@@ -38,7 +38,7 @@ module Highs
38
38
  end
39
39
 
40
40
  def write(filename)
41
- check_status FFI.Highs_writeModel(@ptr, filename)
41
+ check_status FFI.Highs_writeModel(@ptr, +filename)
42
42
  end
43
43
 
44
44
  def to_ptr
@@ -52,12 +52,12 @@ module Highs
52
52
  end
53
53
 
54
54
  def with_options(verbose:, time_limit:)
55
- check_status(FFI.Highs_setBoolOptionValue(@ptr, "output_flag", 1)) if verbose
56
- check_status(FFI.Highs_setDoubleOptionValue(@ptr, "time_limit", time_limit)) if time_limit
55
+ check_status(FFI.Highs_setBoolOptionValue(@ptr, +"output_flag", 1)) if verbose
56
+ check_status(FFI.Highs_setDoubleOptionValue(@ptr, +"time_limit", time_limit)) if time_limit
57
57
  yield
58
58
  ensure
59
- check_status(FFI.Highs_setBoolOptionValue(@ptr, "output_flag", 0)) if verbose
60
- check_status(FFI.Highs_setDoubleOptionValue(@ptr, "time_limit", Float::INFINITY)) if time_limit
59
+ check_status(FFI.Highs_setBoolOptionValue(@ptr, +"output_flag", 0)) if verbose
60
+ check_status(FFI.Highs_setDoubleOptionValue(@ptr, +"time_limit", Float::INFINITY)) if time_limit
61
61
  end
62
62
  end
63
63
  end
data/lib/highs/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Highs
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: highs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-20 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: fiddle
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  requirements: []
65
- rubygems_version: 3.6.2
65
+ rubygems_version: 3.6.7
66
66
  specification_version: 4
67
67
  summary: Linear optimization for Ruby
68
68
  test_files: []