Skip to content

Commit

Permalink
'solution_round' for if-then #200
Browse files Browse the repository at this point in the history
'option solution_round 6;' rounds solution values to 6 post-comma digits, helping to correctly evaluate if-then
  • Loading branch information
glebbelov committed Apr 28, 2023
1 parent 5ecade4 commit 307075e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions solvers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ function(add_ampl_solver name)
set_property(TARGET ${module}-library PROPERTY
IMPORTED_IMPLIB ${l})
endif()
target_include_directories(${module}-library INTERFACE ${${module_upper}_INCLUDE_DIRS})
target_include_directories(${module}-library
INTERFACE ${${module_upper}_INCLUDE_DIRS})
endforeach()
endif()
endif ()
Expand All @@ -103,7 +104,7 @@ function(add_ampl_solver name)

if (TARGET ${module}-library)
get_target_property(TRG_PROP_IMPRT_LOC ${module}-library IMPORTED_LOCATION)
if (NOT libraries)#OR TRG_PROP_IMPRT_LOC)
if (NOT libraries)#OR TRG_PROP_IMPRT_LOC) does not work when >1 solver libs
set(libraries ${module}-library)
endif()
endif ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,27 @@
"name" : "x-multmip3 [count, if]",
"files": ["x-multmip3.mod", "multmip3.dat"],
"tags" : ["logical"],
"options": { "solution_round": "6" },
"comment_options": "For solution_round, see #200",
"objective" : 235625
},
{
"name" : "x-multmip3 [count, if] cmpEps=0.01",
"files": ["x-multmip3.mod", "multmip3.dat"],
"tags" : ["logical"],
"options": { "ANYSOLVER_options": "cvt:mip:eps=1e-2" },
"options": {
"solution_round": "6",
"ANYSOLVER_options": "cvt:mip:eps=1e-2"
},
"comment_options": "For solution_round, see #200",
"objective" : 235625
},
{
"name" : "x-multmip1 [if, >]",
"files": ["x-multmip1.mod", "multmip1.dat"],
"tags" : ["logical"],
"options": { "solution_round": "6" },
"comment_options": "For solution_round, see #200",
"objective" : 218125
},
{
Expand Down

0 comments on commit 307075e

Please sign in to comment.