Skip to content

Commit

Permalink
vartypes -> cats in solve
Browse files Browse the repository at this point in the history
  • Loading branch information
IainNZ committed Sep 4, 2015
1 parent 0c96525 commit a0f2d1e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/nlp.jl
Expand Up @@ -540,7 +540,7 @@ function _buildInternalModel_nlp(m::Model, traits)
MathProgBase.loadnonlinearproblem!(m.internalModel, m.numCols, numConstr, m.colLower, m.colUpper, [linrowlb;quadrowlb;nlrowlb], [linrowub;quadrowub;nlrowub], m.objSense, d)
if traits.int
if applicable(MathProgBase.setvartype!, m.internalModel, m.colCat)
MathProgBase.setvartype!(m.internalModel, vartypes_without_fixed(m))
MathProgBase.setvartype!(m.internalModel, cats_without_fixed(m))
else
error("Solver does not support discrete variables")
end
Expand Down
4 changes: 2 additions & 2 deletions src/solvers.jl
Expand Up @@ -261,7 +261,7 @@ function buildInternalModel(m::Model, traits=ProblemTraits(m);

# Update the type of each variable
if applicable(MathProgBase.setvartype!, m.internalModel, Symbol[])
colCats = vartypes_without_fixed(m)
colCats = cats_without_fixed(m)
MathProgBase.setvartype!(m.internalModel, colCats)
elseif traits.int
# Solver that do not implement anything other than continuous
Expand Down Expand Up @@ -468,7 +468,7 @@ function prepConstrMatrix(m::Model)
A = rowmat'
end

function vartypes_without_fixed(m::Model)
function cats_without_fixed(m::Model)
colCats = copy(m.colCat)
for i in 1:length(colCats)
if colCats[i] == :Fixed
Expand Down

0 comments on commit a0f2d1e

Please sign in to comment.