rulp 0.0.37 → 0.0.38

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rulp/rulp.rb +7 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24ea4ff75137f7dd26a615f67c102e28c6ae5edd
4
- data.tar.gz: 52a059be407b0fece8e54367dc7278334a1e1bed
3
+ metadata.gz: 4c078192763db654f9e49fa5c540bd80a4c005eb
4
+ data.tar.gz: 5295481820dcb872fc1f2da08e31b08bb09066bd
5
5
  SHA512:
6
- metadata.gz: f958a0b4fe424b9f3459a59c713d9a6bb40ed17546dcbcbd20e8f733bb0a39ef699c140fa65f104dd9196680e730a13ae8eb77ba6eea164f593d0b5544b67992
7
- data.tar.gz: d118c3f9269b20f49d2bf08b5bd8d32b2cde46485e0600160b750bd39ca89b141f7e7a9c7257ca7ed7a58829cc09375faf10344dfed22b94f9aabda6fc603335
6
+ metadata.gz: 548508e1000eda048dab20ad923af15c51d0a31f9e4a7e48154b7a34fb5e6ee12b3e5d108e32066906fca308e1fd35aff6763115867803dbf453e7e60f417f0c
7
+ data.tar.gz: 5c9d6584ae4e0a9a0f8b13c9a8372e2ee88db7b186645950edf0502e43ae0fd9247b83cac8956948e1814ab07a60bb308f4e8d936080839cd23738dbf1d51b40
data/lib/rulp/rulp.rb CHANGED
@@ -86,12 +86,16 @@ module Rulp
86
86
  attr_accessor :result, :trace, :lp_file
87
87
 
88
88
  def initialize(objective, objective_expression)
89
- @objective = objective
90
89
  @variables = Set.new
91
- @objective_expression = objective_expression.kind_of?(LV) ? 1 * objective_expression : objective_expression
92
- @variables.merge(@objective_expression.variables)
90
+ @objective = objective
93
91
  @lp_file = nil
94
92
  @constraints = []
93
+ self.objective = objective_expression
94
+ end
95
+
96
+ def objective=(objective_expression)
97
+ @objective_expression = objective_expression.kind_of?(LV) ? 1 * objective_expression : objective_expression
98
+ @variables.merge(@objective_expression.variables)
95
99
  end
96
100
 
97
101
  def [](*constraints)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rulp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.37
4
+ version: 0.0.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wouter Coppieters
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-27 00:00:00.000000000 Z
11
+ date: 2016-10-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A simple Ruby LP description DSL
14
14
  email: wc@pico.net.nz