Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.3
2.4.0
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GEM
mini_portile2 (2.1.0)
nokogiri (1.7.0.1)
mini_portile2 (~> 2.1.0)
power_assert (0.4.1)
power_assert (1.0.1)
rake (12.0.0)
test-unit (3.2.3)
power_assert
Expand All @@ -18,4 +18,4 @@ DEPENDENCIES
test-unit

BUNDLED WITH
1.13.6
1.14.3
14 changes: 13 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
machine:
environment:
LD_LIBRARY_PATH: /usr/local/lib
RAMS_TEST_CBC: true
RAMS_TEST_CLP: true
RAMS_TEST_GLPK: true
RAMS_TEST_SCIP: true

ruby:
version:
2.4.0

dependencies:
cache_directories:
- glpk-4.60
Expand All @@ -16,4 +28,4 @@ dependencies:

test:
post:
- LD_LIBRARY_PATH=/usr/local/lib bundle exec rake test
- bundle exec rake test
4 changes: 2 additions & 2 deletions lib/rams/numeric.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Fixnums can be added to expressions or variables or multiplied
# Integer can be added to expressions or variables or multiplied
# by them to create expressions:
#
# 4 - (3 * x)
# y / 2
class Fixnum
class Integer
alias old_add +
alias old_sub -
alias old_multiply *
Expand Down
4 changes: 3 additions & 1 deletion rams.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Gem::Specification.new do |spec|
spec.name = 'rams'
spec.version = '0.1.5'
spec.version = '0.1.6'
spec.authors = ["Ryan J. O'Neil"]
spec.email = ['ryanjoneil@gmail.com']
spec.summary = 'Ruby Algebraic Modeling System'
Expand All @@ -14,4 +14,6 @@ Gem::Specification.new do |spec|

spec.files = Dir['lib/**/*']
spec.require_paths = ['lib']

spec.required_ruby_version = '>= 2.4.0'
end
42 changes: 21 additions & 21 deletions tests/test_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,48 @@
# rubocop:disable ClassLength
class TestModel < Test::Unit::TestCase
def test_simple
run_test_simple :cbc
run_test_simple :clp
run_test_simple :cbc if ENV['RAMS_TEST_CBC']
run_test_simple :clp if ENV['RAMS_TEST_CLP']
run_test_simple :cplex if ENV['RAMS_TEST_CPLEX']
run_test_simple :glpk
run_test_simple(:scip, ['-c', 'set presolving maxrounds 0'])
run_test_simple :glpk if ENV['RAMS_TEST_GLPK']
run_test_simple(:scip, ['-c', 'set presolving maxrounds 0']) if ENV['RAMS_TEST_SCIP']
end

def test_binary
run_test_binary :cbc
run_test_binary :cbc if ENV['RAMS_TEST_CBC']
run_test_binary :cplex if ENV['RAMS_TEST_CPLEX']
run_test_binary :glpk
run_test_binary :scip
run_test_binary :glpk if ENV['RAMS_TEST_GLPK']
run_test_binary :scip if ENV['RAMS_TEST_SCIP']
end

def test_integer
run_test_integer :cbc
run_test_integer :cbc if ENV['RAMS_TEST_CBC']
run_test_integer :cplex if ENV['RAMS_TEST_CPLEX']
run_test_integer :glpk
run_test_integer :scip
run_test_integer :glpk if ENV['RAMS_TEST_GLPK']
run_test_integer :scip if ENV['RAMS_TEST_SCIP']
end

def test_infeasible
run_test_infeasible :cbc
run_test_infeasible :clp
run_test_infeasible :cbc if ENV['RAMS_TEST_CBC']
run_test_infeasible :clp if ENV['RAMS_TEST_CLP']
run_test_infeasible :cplex if ENV['RAMS_TEST_CPLEX']
run_test_infeasible :glpk
run_test_infeasible :scip
run_test_infeasible :glpk if ENV['RAMS_TEST_GLPK']
run_test_infeasible :scip if ENV['RAMS_TEST_SCIP']
end

def test_unbounded
run_test_unbounded :cbc
run_test_unbounded :clp
run_test_unbounded :cbc if ENV['RAMS_TEST_CBC']
run_test_unbounded :clp if ENV['RAMS_TEST_CLP']
run_test_unbounded :cplex if ENV['RAMS_TEST_CPLEX']
run_test_unbounded :glpk
run_test_unbounded :scip
run_test_unbounded :glpk if ENV['RAMS_TEST_GLPK']
run_test_unbounded :scip if ENV['RAMS_TEST_SCIP']
end

def test_implication
run_test_implication :cbc
run_test_implication :cbc if ENV['RAMS_TEST_CBC']
run_test_implication :cplex if ENV['RAMS_TEST_CPLEX']
run_test_implication :glpk
run_test_implication :scip
run_test_implication :glpk if ENV['RAMS_TEST_GLPK']
run_test_implication :scip if ENV['RAMS_TEST_SCIP']
end

# rubocop:disable MethodLength
Expand Down