-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functions for getting string array attributes (#88)
* Functions for getting string array attributes adds get_strattrarray and get_strattrarray! * Update grb_attrs.jl * Add files via upload * Update test_get_strarray.jl * Update runtests.jl
- Loading branch information
Showing
4 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Gurobi | ||
using Base.Test | ||
|
||
# enviroment and problem | ||
env = Gurobi.Env() | ||
m = Gurobi.Model(env, "test") | ||
|
||
# read mps problem in Gurobi | ||
read_model(m, "test_get_strarray.mps") | ||
|
||
# test functions | ||
@test Gurobi.get_strattrarray(m, "VarName", 1, Gurobi.num_vars(m)) == ["XONE","YTWO","ZTHREE"] | ||
@test Gurobi.get_strattrarray(m, "ConstrName", 1, Gurobi.num_constrs(m)) == ["LIM1","LIM2","MYEQN"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
*Source: http://lpsolve.sourceforge.net/5.5/mps-format.htm | ||
NAME TESTPROB | ||
ROWS | ||
N COST | ||
L LIM1 | ||
G LIM2 | ||
E MYEQN | ||
COLUMNS | ||
XONE COST 1 LIM1 1 | ||
XONE LIM2 1 | ||
YTWO COST 4 LIM1 1 | ||
YTWO MYEQN -1 | ||
ZTHREE COST 9 LIM2 1 | ||
ZTHREE MYEQN 1 | ||
RHS | ||
RHS1 LIM1 5 LIM2 10 | ||
RHS1 MYEQN 7 | ||
BOUNDS | ||
UP BND1 XONE 4 | ||
LO BND1 YTWO -1 | ||
UP BND1 YTWO 1 | ||
ENDATA |