Browse Source

Merge branch 'future' into monolithic-dft

Former-commit-id: 7b7c99d7a6
main
sjunges 9 years ago
parent
commit
eeaff790a4
  1. 8
      CMakeLists.txt
  2. 13
      resources/3rdparty/CMakeLists.txt
  3. 281
      resources/3rdparty/glpk-4.53/CMakeLists.txt
  4. 27
      resources/3rdparty/glpk-4.53/config.h.cmake.in
  5. BIN
      resources/3rdparty/glpk-4.53/doc/notes/scaling.pdf
  6. BIN
      resources/3rdparty/glpk-4.53/doc/notes/updating.pdf
  7. 47
      resources/3rdparty/glpk-4.53/resources/FindMySQL.cmake
  8. 60
      resources/3rdparty/glpk-4.53/resources/FindODBC.cmake
  9. 576
      resources/3rdparty/glpk-4.53/src/bfd.c
  10. 1097
      resources/3rdparty/glpk-4.53/src/glplpf.c
  11. 216
      resources/3rdparty/glpk-4.53/src/glplpf.h
  12. 2971
      resources/3rdparty/glpk-4.53/src/glpspx01.c
  13. 3118
      resources/3rdparty/glpk-4.53/src/glpspx02.c
  14. 667
      resources/3rdparty/glpk-4.53/src/glptsp.c
  15. 0
      resources/3rdparty/glpk-4.57/AUTHORS
  16. 0
      resources/3rdparty/glpk-4.57/COPYING
  17. 185
      resources/3rdparty/glpk-4.57/ChangeLog
  18. 0
      resources/3rdparty/glpk-4.57/INSTALL
  19. 0
      resources/3rdparty/glpk-4.57/Makefile.am
  20. 0
      resources/3rdparty/glpk-4.57/Makefile.in
  21. 100
      resources/3rdparty/glpk-4.57/NEWS
  22. 8
      resources/3rdparty/glpk-4.57/README
  23. 19
      resources/3rdparty/glpk-4.57/THANKS
  24. 0
      resources/3rdparty/glpk-4.57/aclocal.m4
  25. 0
      resources/3rdparty/glpk-4.57/config.guess
  26. 0
      resources/3rdparty/glpk-4.57/config.h.in
  27. 0
      resources/3rdparty/glpk-4.57/config.sub
  28. 21
      resources/3rdparty/glpk-4.57/configure
  29. 3
      resources/3rdparty/glpk-4.57/configure.ac
  30. 0
      resources/3rdparty/glpk-4.57/depcomp
  31. 0
      resources/3rdparty/glpk-4.57/doc/cnfsat.pdf
  32. 0
      resources/3rdparty/glpk-4.57/doc/cnfsat.tex
  33. BIN
      resources/3rdparty/glpk-4.57/doc/glpk.pdf
  34. 17
      resources/3rdparty/glpk-4.57/doc/glpk.tex
  35. 0
      resources/3rdparty/glpk-4.57/doc/glpk01.tex
  36. 66
      resources/3rdparty/glpk-4.57/doc/glpk02.tex
  37. 0
      resources/3rdparty/glpk-4.57/doc/glpk03.tex
  38. 78
      resources/3rdparty/glpk-4.57/doc/glpk04.tex
  39. 0
      resources/3rdparty/glpk-4.57/doc/glpk05.tex
  40. 83
      resources/3rdparty/glpk-4.57/doc/glpk06.tex
  41. 0
      resources/3rdparty/glpk-4.57/doc/glpk07.tex
  42. 0
      resources/3rdparty/glpk-4.57/doc/glpk08.tex
  43. 0
      resources/3rdparty/glpk-4.57/doc/glpk09.tex
  44. 11
      resources/3rdparty/glpk-4.57/doc/glpk10.tex
  45. 0
      resources/3rdparty/glpk-4.57/doc/glpk11.tex
  46. 0
      resources/3rdparty/glpk-4.57/doc/glpk12.tex
  47. BIN
      resources/3rdparty/glpk-4.57/doc/gmpl.pdf
  48. 28
      resources/3rdparty/glpk-4.57/doc/gmpl.tex
  49. BIN
      resources/3rdparty/glpk-4.57/doc/gmpl_es.pdf
  50. 3233
      resources/3rdparty/glpk-4.57/doc/gmpl_es.tex
  51. 0
      resources/3rdparty/glpk-4.57/doc/graphs.pdf
  52. 0
      resources/3rdparty/glpk-4.57/doc/graphs.tex
  53. 0
      resources/3rdparty/glpk-4.57/doc/miplib2.txt
  54. 0
      resources/3rdparty/glpk-4.57/doc/miplib3.txt
  55. 0
      resources/3rdparty/glpk-4.57/doc/netlib.txt
  56. 0
      resources/3rdparty/glpk-4.57/doc/notes/dfeas.pdf
  57. 0
      resources/3rdparty/glpk-4.57/doc/notes/gomory.pdf
  58. 0
      resources/3rdparty/glpk-4.57/doc/notes/keller.pdf
  59. BIN
      resources/3rdparty/glpk-4.57/doc/notes/scf.pdf
  60. BIN
      resources/3rdparty/glpk-4.57/doc/notes/simplex1.pdf
  61. BIN
      resources/3rdparty/glpk-4.57/doc/notes/simplex2.pdf
  62. 10
      resources/3rdparty/glpk-4.57/examples/INDEX
  63. 0
      resources/3rdparty/glpk-4.57/examples/Makefile.am
  64. 0
      resources/3rdparty/glpk-4.57/examples/Makefile.in
  65. 282
      resources/3rdparty/glpk-4.57/examples/alloy.mps
  66. 0
      resources/3rdparty/glpk-4.57/examples/assign.mod
  67. 0
      resources/3rdparty/glpk-4.57/examples/bpp.mod
  68. 0
      resources/3rdparty/glpk-4.57/examples/cal.mod
  69. 0
      resources/3rdparty/glpk-4.57/examples/cf12a.mod
  70. 0
      resources/3rdparty/glpk-4.57/examples/cf12b.mod
  71. 0
      resources/3rdparty/glpk-4.57/examples/cflsq.mod
  72. 0
      resources/3rdparty/glpk-4.57/examples/color.mod
  73. 0
      resources/3rdparty/glpk-4.57/examples/cplex/README
  74. 0
      resources/3rdparty/glpk-4.57/examples/cplex/concorde.txt
  75. 0
      resources/3rdparty/glpk-4.57/examples/cplex/cplex.c
  76. 0
      resources/3rdparty/glpk-4.57/examples/cplex/cplex.h
  77. 0
      resources/3rdparty/glpk-4.57/examples/cpp.mod
  78. 0
      resources/3rdparty/glpk-4.57/examples/crypto.mod
  79. 0
      resources/3rdparty/glpk-4.57/examples/csv/distances.csv
  80. 0
      resources/3rdparty/glpk-4.57/examples/csv/markets.csv
  81. 0
      resources/3rdparty/glpk-4.57/examples/csv/parameters.csv
  82. 0
      resources/3rdparty/glpk-4.57/examples/csv/plants.csv
  83. 0
      resources/3rdparty/glpk-4.57/examples/csv/transp_csv.mod
  84. 0
      resources/3rdparty/glpk-4.57/examples/dbf/ForestMgt_Model_I_GIS_dbf.mod
  85. 0
      resources/3rdparty/glpk-4.57/examples/dbf/Forest_Cost.dbf
  86. 0
      resources/3rdparty/glpk-4.57/examples/dbf/NetRev_Table.dbf
  87. 0
      resources/3rdparty/glpk-4.57/examples/dbf/README
  88. 0
      resources/3rdparty/glpk-4.57/examples/dbf/TCost_Table.dbf
  89. 0
      resources/3rdparty/glpk-4.57/examples/dbf/Yield_Table_Vol.dbf
  90. 0
      resources/3rdparty/glpk-4.57/examples/dbf/cultural_pres.dbf
  91. 0
      resources/3rdparty/glpk-4.57/examples/dbf/mgt_year.dbf
  92. 0
      resources/3rdparty/glpk-4.57/examples/dbf/stands.dbf
  93. 0
      resources/3rdparty/glpk-4.57/examples/dbf/standtype.dbf
  94. 0
      resources/3rdparty/glpk-4.57/examples/dea.mod
  95. 0
      resources/3rdparty/glpk-4.57/examples/diet.mod
  96. 0
      resources/3rdparty/glpk-4.57/examples/dist.mod
  97. 0
      resources/3rdparty/glpk-4.57/examples/egypt.mod
  98. 0
      resources/3rdparty/glpk-4.57/examples/fctp.mod
  99. 0
      resources/3rdparty/glpk-4.57/examples/food.mod
  100. 0
      resources/3rdparty/glpk-4.57/examples/food2.mod

8
CMakeLists.txt

@ -239,9 +239,11 @@ endif(STORM_HAVE_Z3)
set(STORM_HAVE_GLPK 1)
message (STATUS "StoRM - Linking with glpk")
add_subdirectory("${PROJECT_SOURCE_DIR}/resources/3rdparty/glpk-4.53")
include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/glpk-4.53/src")
list(APPEND STORM_LINK_LIBRARIES "glpk")
set(GLPK_LIBRARIES ${CMAKE_BINARY_DIR}/resources/3rdparty/glpk-4.57/lib/libglpk.a)
set(GLPK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/resources/3rdparty/glpk-4.57/include)
include_directories(${GLPK_INCLUDE_DIR})
list(APPEND STORM_LINK_LIBRARIES ${GLPK_LIBRARIES})

13
resources/3rdparty/CMakeLists.txt

@ -6,4 +6,15 @@ ExternalProject_Add(
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/xercesc-3.1.2
BUILD_COMMAND make
BUILD_IN_SOURCE 0
)
)
ExternalProject_Add(
glpk
DOWNLOAD_COMMAND ""
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glpk-4.57
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/glpk-4.57
CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR}/glpk-4.57/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/glpk-4.57
BUILD_COMMAND make "CFLAGS=-O2 -w"
INSTALL_COMMAND make install
BUILD_IN_SOURCE 0
)

281
resources/3rdparty/glpk-4.53/CMakeLists.txt

@ -1,281 +0,0 @@
cmake_minimum_required (VERSION 2.8.6)
# Set project name
project (glpk CXX C)
# Add the resources/cmake folder to Module Search Path for FindMySQL.cmake
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/resources/")
# Add base folder for better inclusion paths
include_directories("${PROJECT_SOURCE_DIR}")
include_directories("${PROJECT_SOURCE_DIR}/src")
include_directories("${PROJECT_SOURCE_DIR}/src/amd")
include_directories("${PROJECT_SOURCE_DIR}/src/bflib")
include_directories("${PROJECT_SOURCE_DIR}/src/cglib")
include_directories("${PROJECT_SOURCE_DIR}/src/colamd")
include_directories("${PROJECT_SOURCE_DIR}/src/env")
include_directories("${PROJECT_SOURCE_DIR}/src/minisat")
include_directories("${PROJECT_SOURCE_DIR}/src/misc")
include_directories("${PROJECT_SOURCE_DIR}/src/proxy")
include_directories("${PROJECT_SOURCE_DIR}/src/zlib")
#############################################################
##
## CMake options of GLPK
##
#############################################################
option(WITH_GLPK_EXAMPLES "Also build examples and standalone executables" OFF)
option(WITH_GMP "Use GNU MO bignum library" OFF)
option(ENABLE_DL "Enable shared library support" OFF)
option(ENABLE_ODBC "Enable MathProg ODBC support" OFF)
option(ENABLE_MYSQL "Enable MathProg MySQL support" OFF)
option(DEBUG "Sets whether the DEBUG mode is used" OFF)
set(ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "Additional directories added to the include directories.")
set(ADDITIONAL_LINK_DIRS "" CACHE STRING "Additional directories added to the link directories.")
MARK_AS_ADVANCED(WITH_GLPK_EXAMPLES WITH_GMP ENABLE_DL ENABLE_ODBC ENABLE_MYSQL)
# If the DEBUG option was turned on, we will target a debug version and a release version otherwise
if (DEBUG)
set (CMAKE_BUILD_TYPE "DEBUG")
else()
set (CMAKE_BUILD_TYPE "RELEASE")
endif()
message(STATUS "GLPK - Building ${CMAKE_BUILD_TYPE} version.")
message(STATUS "GLPK - CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
message(STATUS "GLPK - CMAKE_BUILD_TYPE (ENV): $ENV{CMAKE_BUILD_TYPE}")
#############################################################
##
## Compiler specific settings and definitions
##
#############################################################
if(CMAKE_COMPILER_IS_GNUCC)
message(STATUS "GLPK - Using Compiler Configuration: GCC")
# Set standard flags for GCC
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-return-type -Wno-parentheses -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-value -Wno-unused-function -Wno-address -Wno-unused-label")
add_definitions(-DHAVE_CONFIG_H=1)
elseif(MSVC)
message(STATUS "GLPK - Using Compiler Configuration: MSVC")
add_definitions(/D_SCL_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS)
add_definitions(/D_VARIADIC_MAX=10)
add_definitions(/DNOMINMAX)
add_definitions(/DHAVE_CONFIG_H=1)
else(CLANG)
message(STATUS "GLPK - Using Compiler Configuration: Clang (LLVM)")
# As CLANG is not set as a variable, we need to set it in case we have not matched another compiler.
set (CLANG ON)
# Set standard flags for clang
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -funroll-loops -O3")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-return-type -Wno-return-type-c-linkage -Wno-unused-label -Wno-unused-value -Wno-unused-function -Wno-unused-variable -Wno-logical-op-parentheses -Wno-macro-redefined -Wno-uninitialized -Wno-sometimes-uninitialized -Wno-self-assign")
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
add_definitions(-DHAVE_CONFIG_H=1)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -version-info=37:0:1 -export-symbols-regex='^glp_*'")
endif()
#############################################################
##
## CMake-generated Config File for GLPK
##
#############################################################
include(CheckIncludeFiles)
include(CheckFunctionExists)
CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H)
CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
CHECK_INCLUDE_FILES(ltdl.h HAVE_LTDL)
CHECK_INCLUDE_FILES(dlfcn.h HAVE_DLFCN)
if(WITH_GMP)
message(STATUS "GLPK - Building with GMP Support")
CHECK_INCLUDE_FILE(gmp.h HAVE_GMP_H)
if (NOT HAVE_GMP_H)
message(SEND_ERROR "Could not find gmp.h!")
endif()
set(GLPK_HAVE_GMP "define")
else()
set(GLPK_HAVE_GMP "undef")
endif()
if (UNIX AND NOT APPLE)
set(LIBIODBC "libiodbc.so")
set(LIBODBC "libodbc.so")
set(LIBMYSQL "libmysqlclient.so")
elseif(UNIX AND APPLE)
set(LIBIODBC "libiodbc.dylib")
set(LIBODBC "libodbc.dylib")
set(LIBMYSQL "libmysqlclient.dylib")
elseif(MSVC)
set(LIBIODBC "odbc32.lib")
set(LIBODBC "odbc32.lib")
set(LIBMYSQL "mysqlclient.lib")
endif()
if(ENABLE_ODBC)
message(STATUS "GLPK - Building with ODBC Support")
find_package(ODBC REQUIRED)
if (NOT ENABLE_DL)
message(SEND_ERROR "ENABLE_ODBC required ENABLE_DL")
endif()
include_directories(ODBC_INCLUDE_DIRECTORIES)
set(GLPK_HAVE_ODBC "define")
set(GLPK_ODBC_DLNAME "${ODBC_LIBRARIES}")
else()
set(GLPK_HAVE_ODBC "undef")
set(GLPK_ODBC_DLNAME "")
endif()
if(ENABLE_MYSQL)
message(STATUS "GLPK - Building with MySQL Support")
find_package(MySQL REQUIRED)
if (NOT ENABLE_DL)
message(SEND_ERROR "ENABLE_MYSQL required ENABLE_DL")
endif()
include_directories(MYSQL_INCLUDE_DIR)
set(GLPK_HAVE_MYSQL "define")
set(GLPK_MYSQL_DLNAME "${MYSQL_LIBRARIES}")
else()
set(GLPK_HAVE_MYSQL "undef")
set(GLPK_MYSQL_DLNAME "")
endif()
# Convert to CMake Variables to be used in the Config File
if(HAVE_SYS_TIME_H)
set(GLPK_HAVE_SYS_TIME_H "define")
else()
set (GLPK_HAVE_SYS_TIME_H "undef")
endif()
if(HAVE_GETTIMEOFDAY)
set(GLPK_HAVE_GETTIMEOFDAY "define")
else()
set (GLPK_HAVE_GETTIMEOFDAY "undef")
endif()
if(HAVE_LTDL)
set(GLPK_HAVE_LTDL "define")
else()
set (GLPK_HAVE_LTDL "undef")
endif()
if(HAVE_DLFCN)
set(GLPK_HAVE_DLFCN "define")
else()
set (GLPK_HAVE_DLFCN "undef")
endif()
# Configure a header file to pass some of the CMake settings to the source code
configure_file (
"${PROJECT_SOURCE_DIR}/config.h.cmake.in"
"${PROJECT_BINARY_DIR}/include/config.h"
)
# Add the binary dir include directory for config.h
include_directories("${PROJECT_BINARY_DIR}/include")
#############################################################
##
## Source file aggregation and clustering
##
#############################################################
file(GLOB_RECURSE GLPK_LIB_HEADERS ${PROJECT_SOURCE_DIR}/src/*.h)
file(GLOB_RECURSE GLPK_LIB_SOURCES ${PROJECT_SOURCE_DIR}/src/*.c)
file(GLOB_RECURSE GLPK_LIB_DEF ${PROJECT_SOURCE_DIR}/w64/*.def)
set(GLPK_EXAMPLE_GLPSOL_SOURCES ${PROJECT_SOURCE_DIR}/examples/glpsol.c)
set(GLPK_EXAMPLE_IPTSAMP_SOURCES ${PROJECT_SOURCE_DIR}/examples/iptsamp.c)
set(GLPK_EXAMPLE_MPLSAMP1_SOURCES ${PROJECT_SOURCE_DIR}/examples/mplsamp1.c)
set(GLPK_EXAMPLE_MPLSAMP2_SOURCES ${PROJECT_SOURCE_DIR}/examples/mplsamp2.c)
set(GLPK_EXAMPLE_SAMPLE_SOURCES ${PROJECT_SOURCE_DIR}/examples/sample.c)
set(GLPK_EXAMPLE_SPXSAMP1_SOURCES ${PROJECT_SOURCE_DIR}/examples/spxsamp1.c)
set(GLPK_EXAMPLE_SPXSAMP2_SOURCES ${PROJECT_SOURCE_DIR}/examples/spxsamp2.c)
set(GLPK_EXAMPLE_NETGEN_SOURCES ${PROJECT_SOURCE_DIR}/examples/netgen.c)
# Additional include files like the storm-config.h
file(GLOB_RECURSE GLPK_BUILD_HEADERS ${PROJECT_BINARY_DIR}/include/*.h)
# Add custom additional include or link directories
if (ADDITIONAL_INCLUDE_DIRS)
message(STATUS "GLPK - Using additional include directories ${ADDITIONAL_INCLUDE_DIRS}")
include_directories(${ADDITIONAL_INCLUDE_DIRS})
endif(ADDITIONAL_INCLUDE_DIRS)
if (ADDITIONAL_LINK_DIRS)
message(STATUS "GLPK - Using additional link directories ${ADDITIONAL_LINK_DIRS}")
link_directories(${ADDITIONAL_LINK_DIRS})
endif(ADDITIONAL_LINK_DIRS)
###############################################################################
## #
## Executable Creation #
## #
## All link_directories() calls MUST be made before this point #
## #
###############################################################################
if(WITH_GLPK_EXAMPLES)
add_executable(glpsol ${GLPK_EXAMPLE_GLPSOL_SOURCES})
add_executable(iptsamp ${GLPK_EXAMPLE_IPTSAMP_SOURCES})
add_executable(mplsamp1 ${GLPK_EXAMPLE_MPLSAMP1_SOURCES})
add_executable(mplsamp2 ${GLPK_EXAMPLE_MPLSAMP2_SOURCES})
add_executable(spxsamp1 ${GLPK_EXAMPLE_SPXSAMP1_SOURCES})
add_executable(spxsamp2 ${GLPK_EXAMPLE_SPXSAMP2_SOURCES})
add_executable(netgen ${GLPK_EXAMPLE_NETGEN_SOURCES})
add_executable(sample ${GLPK_EXAMPLE_SAMPLE_SOURCES})
endif()
if(ENABLE_DL)
set(GLPK_BUILD_TYPE SHARED)
else()
set(GLPK_BUILD_TYPE STATIC)
endif()
if (NOT MSVC)
set(GLPK_LIB_DEF "")
endif()
add_library(glpk ${GLPK_BUILD_TYPE} ${GLPK_LIB_SOURCES} ${GLPK_LIB_HEADERS} ${GLPK_LIB_DEF})
IF(UNIX)
target_link_libraries(glpk m)
ENDIF(UNIX)
if(HAVE_LTDL)
target_link_libraries(glpk ltdl)
endif(HAVE_LTDL)
if(HAVE_DLFCN)
target_link_libraries(glpk dl)
endif(HAVE_DLFCN)
if(WITH_GLPK_EXAMPLES)
# Dependency for the Executable
add_dependencies(glpsol glpk)
add_dependencies(iptsamp glpk)
add_dependencies(mplsamp1 glpk)
add_dependencies(mplsamp2 glpk)
add_dependencies(spxsamp1 glpk)
add_dependencies(spxsamp2 glpk)
add_dependencies(netgen glpk)
add_dependencies(sample glpk)
target_link_libraries(glpsol glpk)
target_link_libraries(iptsamp glpk)
target_link_libraries(mplsamp1 glpk)
target_link_libraries(mplsamp2 glpk)
target_link_libraries(spxsamp1 glpk)
target_link_libraries(spxsamp2 glpk)
target_link_libraries(netgen glpk)
target_link_libraries(sample glpk)
endif()
#############################################################
##
## ODBC
##
#############################################################
if(ODBC_FOUND)
target_link_libraries(glpk ${ODBC_LIBRARIES})
endif()
#############################################################
##
## MySQL
##
#############################################################
if(MYSQL_FOUND)
target_link_libraries(glpk ${MYSQL_LIBRARIES})
endif()

27
resources/3rdparty/glpk-4.53/config.h.cmake.in

@ -1,27 +0,0 @@
/* config.h.in (GLPK configuration template file) */
#@GLPK_HAVE_SYS_TIME_H@ HAVE_SYS_TIME_H
/* defined if the <sys/time.h> header can be used */
#@GLPK_HAVE_GETTIMEOFDAY@ HAVE_GETTIMEOFDAY
/* defined if the gettimeofday function can be used */
#@GLPK_HAVE_GMP@ HAVE_GMP
/* defined if the GNU MP bignum library is available */
/* requires <gmp.h> and -lgmp */
#@GLPK_HAVE_LTDL@ HAVE_LTDL
/* defined if the GNU Libtool shared library support is enabled */
/* requires <ltdl.h> and -lltdl */
#@GLPK_HAVE_DLFCN@ HAVE_DLFCN
/* defined if the POSIX shared library support is enabled */
/* requires <dlfcn.h> */
#@GLPK_HAVE_ODBC@ ODBC_DLNAME @GLPK_ODBC_DLNAME@
/* ODBC shared library name if this feature is enabled */
#@GLPK_HAVE_MYSQL@ MYSQL_DLNAME @GLPK_MYSQL_DLNAME@
/* MySQL shared library name if this feature is enabled */
/* eof */

BIN
resources/3rdparty/glpk-4.53/doc/notes/scaling.pdf

BIN
resources/3rdparty/glpk-4.53/doc/notes/updating.pdf

47
resources/3rdparty/glpk-4.53/resources/FindMySQL.cmake

@ -1,47 +0,0 @@
# - Find mysqlclient
# Find the native MySQL includes and library
#
# MYSQL_INCLUDE_DIR - where to find mysql.h, etc.
# MYSQL_LIBRARIES - List of libraries when using MySQL.
# MYSQL_FOUND - True if MySQL found.
IF (MYSQL_INCLUDE_DIR)
# Already in cache, be silent
SET(MYSQL_FIND_QUIETLY TRUE)
ENDIF (MYSQL_INCLUDE_DIR)
FIND_PATH(MYSQL_INCLUDE_DIR mysql.h
/usr/local/include/mysql
/usr/include/mysql
)
SET(MYSQL_NAMES mysqlclient mysqlclient_r)
FIND_LIBRARY(MYSQL_LIBRARY
NAMES ${MYSQL_NAMES}
PATHS /usr/lib /usr/local/lib
PATH_SUFFIXES mysql
)
IF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
SET(MYSQL_FOUND TRUE)
SET( MYSQL_LIBRARIES ${MYSQL_LIBRARY} )
ELSE (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
SET(MYSQL_FOUND FALSE)
SET( MYSQL_LIBRARIES )
ENDIF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
IF (MYSQL_FOUND)
IF (NOT MYSQL_FIND_QUIETLY)
MESSAGE(STATUS "Found MySQL: ${MYSQL_LIBRARY}")
ENDIF (NOT MYSQL_FIND_QUIETLY)
ELSE (MYSQL_FOUND)
IF (MYSQL_FIND_REQUIRED)
MESSAGE(STATUS "Looked for MySQL libraries named ${MYSQL_NAMES}.")
MESSAGE(FATAL_ERROR "Could NOT find MySQL library")
ENDIF (MYSQL_FIND_REQUIRED)
ENDIF (MYSQL_FOUND)
MARK_AS_ADVANCED(
MYSQL_LIBRARY
MYSQL_INCLUDE_DIR
)

60
resources/3rdparty/glpk-4.53/resources/FindODBC.cmake

@ -1,60 +0,0 @@
#
# Find the ODBC driver manager includes and library.
#
# ODBC is an open standard for connecting to different databases in a
# semi-vendor-independent fashion. First you install the ODBC driver
# manager. Then you need a driver for each separate database you want
# to connect to (unless a generic one works). VTK includes neither
# the driver manager nor the vendor-specific drivers: you have to find
# those yourself.
#
# This module defines
# ODBC_INCLUDE_DIRECTORIES, where to find sql.h
# ODBC_LIBRARIES, the libraries to link against to use ODBC
# ODBC_FOUND. If false, you cannot build anything that requires MySQL.
find_path(ODBC_INCLUDE_DIRECTORIES
NAMES sql.h
HINTS
/usr/include
/usr/include/odbc
/usr/local/include
/usr/local/include/odbc
/usr/local/odbc/include
"C:/Program Files/ODBC/include"
"C:/Program Files/Microsoft SDKs/Windows/v7.0/include"
"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/include"
"C:/Program Files/Microsoft SDKs/Windows/v6.0a/include"
"C:/ODBC/include"
DOC "Specify the directory containing sql.h."
)
find_library(ODBC_LIBRARIES
NAMES iodbc odbc odbcinst odbc32
HINTS
/usr/lib
/usr/lib/odbc
/usr/local/lib
/usr/local/lib/odbc
/usr/local/odbc/lib
"C:/Program Files/ODBC/lib"
"C:/ODBC/lib/debug"
"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib"
"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib"
DOC "Specify the ODBC driver manager library here."
)
# MinGW find usually fails
if(MINGW)
set(ODBC_INCLUDE_DIRECTORIES ".")
set(ODBC_LIBRARIES odbc32)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ODBC
DEFAULT_MSG
ODBC_INCLUDE_DIRECTORIES
ODBC_LIBRARIES
)
mark_as_advanced(ODBC_FOUND ODBC_LIBRARIES ODBC_INCLUDE_DIRECTORIES)

576
resources/3rdparty/glpk-4.53/src/bfd.c

@ -1,576 +0,0 @@
/* bfd.c (LP basis factorization driver) */
/***********************************************************************
* This code is part of GLPK (GNU Linear Programming Kit).
*
* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
* 2009, 2010, 2011, 2013 Andrew Makhorin, Department for Applied
* Informatics, Moscow Aviation Institute, Moscow, Russia. All rights
* reserved. E-mail: <mao@gnu.org>.
*
* GLPK is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GLPK is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GLPK. If not, see <http://www.gnu.org/licenses/>.
***********************************************************************/
#include "env.h"
#if 0 /* 27/IV-2013 */
#include "glpfhv.h"
#else
#include "fhvint.h"
#endif
#include "glplpf.h"
#include "prob.h"
/* CAUTION: DO NOT CHANGE THE LIMIT BELOW */
#define M_MAX 100000000 /* = 100*10^6 */
/* maximal order of the basis matrix */
struct BFD
{ /* LP basis factorization */
int valid;
/* factorization is valid only if this flag is set */
int type;
/* factorization type:
GLP_BF_FT - LUF + Forrest-Tomlin
GLP_BF_BG - LUF + Schur compl. + Bartels-Golub
GLP_BF_GR - LUF + Schur compl. + Givens rotation */
#if 0 /* 27/IV-2013 */
FHV *fhv;
/* LP basis factorization (GLP_BF_FT) */
#else
FHVINT *fi;
/* interface to FHV-factorization (GLP_BF_FT) */
#endif
LPF *lpf;
/* LP basis factorization (GLP_BF_BG, GLP_BF_GR) */
int lu_size; /* luf.sv_size */
double piv_tol; /* luf.piv_tol */
int piv_lim; /* luf.piv_lim */
int suhl; /* luf.suhl */
double eps_tol; /* luf.eps_tol */
double max_gro; /* luf.max_gro */
int nfs_max; /* fhv.hh_max */
double upd_tol; /* fhv.upd_tol */
int nrs_max; /* lpf.n_max */
int rs_size; /* lpf.v_size */
/* internal control parameters */
int upd_lim;
/* the factorization update limit */
int upd_cnt;
/* the factorization update count */
};
/***********************************************************************
* NAME
*
* bfd_create_it - create LP basis factorization
*
* SYNOPSIS
*
* #include "glpbfd.h"
* BFD *bfd_create_it(void);
*
* DESCRIPTION
*
* The routine bfd_create_it creates a program object, which represents
* a factorization of LP basis.
*
* RETURNS
*
* The routine bfd_create_it returns a pointer to the object created. */
BFD *bfd_create_it(void)
{ BFD *bfd;
bfd = xmalloc(sizeof(BFD));
bfd->valid = 0;
bfd->type = GLP_BF_FT;
#if 0 /* 27/IV-2013 */
bfd->fhv = NULL;
#else
bfd->fi = NULL;
#endif
bfd->lpf = NULL;
bfd->lu_size = 0;
bfd->piv_tol = 0.10;
bfd->piv_lim = 4;
bfd->suhl = 1;
bfd->eps_tol = 1e-15;
bfd->max_gro = 1e+10;
bfd->nfs_max = 100;
bfd->upd_tol = 1e-6;
bfd->nrs_max = 100;
bfd->rs_size = 1000;
bfd->upd_lim = -1;
bfd->upd_cnt = 0;
return bfd;
}
/**********************************************************************/
void bfd_set_parm(BFD *bfd, const void *_parm)
{ /* change LP basis factorization control parameters */
const glp_bfcp *parm = _parm;
xassert(bfd != NULL);
bfd->type = parm->type;
bfd->lu_size = parm->lu_size;
bfd->piv_tol = parm->piv_tol;
bfd->piv_lim = parm->piv_lim;
bfd->suhl = parm->suhl;
bfd->eps_tol = parm->eps_tol;
bfd->max_gro = parm->max_gro;
bfd->nfs_max = parm->nfs_max;
bfd->upd_tol = parm->upd_tol;
bfd->nrs_max = parm->nrs_max;
bfd->rs_size = parm->rs_size;
return;
}
/***********************************************************************
* NAME
*
* bfd_factorize - compute LP basis factorization
*
* SYNOPSIS
*
* #include "glpbfd.h"
* int bfd_factorize(BFD *bfd, int m, int bh[], int (*col)(void *info,
* int j, int ind[], double val[]), void *info);
*
* DESCRIPTION
*
* The routine bfd_factorize computes the factorization of the basis
* matrix B specified by the routine col.
*
* The parameter bfd specified the basis factorization data structure
* created with the routine bfd_create_it.
*
* The parameter m specifies the order of B, m > 0.
*
* The array bh specifies the basis header: bh[j], 1 <= j <= m, is the
* number of j-th column of B in some original matrix. The array bh is
* optional and can be specified as NULL.
*
* The formal routine col specifies the matrix B to be factorized. To
* obtain j-th column of A the routine bfd_factorize calls the routine
* col with the parameter j (1 <= j <= n). In response the routine col
* should store row indices and numerical values of non-zero elements
* of j-th column of B to locations ind[1,...,len] and val[1,...,len],
* respectively, where len is the number of non-zeros in j-th column
* returned on exit. Neither zero nor duplicate elements are allowed.
*
* The parameter info is a transit pointer passed to the routine col.
*
* RETURNS
*
* 0 The factorization has been successfully computed.
*
* BFD_ESING
* The specified matrix is singular within the working precision.
*
* BFD_ECOND
* The specified matrix is ill-conditioned.
*
* For more details see comments to the routine luf_factorize. */
int bfd_factorize(BFD *bfd, int m, const int bh[], int (*col)
(void *info, int j, int ind[], double val[]), void *info)
#if 0 /* 06/VI-2013 */
{ LUF *luf;
#else
{
#endif
int nov, ret;
xassert(bfd != NULL);
xassert(1 <= m && m <= M_MAX);
/* invalidate the factorization */
bfd->valid = 0;
/* create the factorization, if necessary */
nov = 0;
switch (bfd->type)
{ case GLP_BF_FT:
if (bfd->lpf != NULL)
lpf_delete_it(bfd->lpf), bfd->lpf = NULL;
#if 0 /* 27/IV-2013 */
if (bfd->fhv == NULL)
bfd->fhv = fhv_create_it(), nov = 1;
#else
if (bfd->fi == NULL)
bfd->fi = fhvint_create(), nov = 1;
#endif
break;
case GLP_BF_BG:
case GLP_BF_GR:
#if 0 /* 27/IV-2013 */
if (bfd->fhv != NULL)
fhv_delete_it(bfd->fhv), bfd->fhv = NULL;
#else
if (bfd->fi != NULL)
fhvint_delete(bfd->fi), bfd->fi = NULL;
#endif
if (bfd->lpf == NULL)
bfd->lpf = lpf_create_it(), nov = 1;
break;
default:
xassert(bfd != bfd);
}
#if 0 /* 06/VI-2013 */
/* set control parameters specific to LUF */
#if 0 /* 27/IV-2013 */
if (bfd->fhv != NULL)
luf = bfd->fhv->luf;
#else
if (bfd->fi != NULL)
goto skip;
#endif
else if (bfd->lpf != NULL)
luf = bfd->lpf->luf;
else
xassert(bfd != bfd);
if (nov) luf->new_sva = bfd->lu_size;
luf->piv_tol = bfd->piv_tol;
luf->piv_lim = bfd->piv_lim;
luf->suhl = bfd->suhl;
luf->eps_tol = bfd->eps_tol;
luf->max_gro = bfd->max_gro;
#endif
#if 0 /* 27/IV-2013 */
/* set control parameters specific to FHV */
if (bfd->fhv != NULL)
{ if (nov) bfd->fhv->hh_max = bfd->nfs_max;
bfd->fhv->upd_tol = bfd->upd_tol;
}
#endif
/* set control parameters specific to LPF */
if (bfd->lpf != NULL)
{ if (nov) bfd->lpf->n_max = bfd->nrs_max;
if (nov) bfd->lpf->v_size = bfd->rs_size;
}
#if 0 /* 27/IV-2013 */
/* try to factorize the basis matrix */
if (bfd->fhv != NULL)
{ switch (fhv_factorize(bfd->fhv, m, col, info))
{ case 0:
break;
case FHV_ESING:
ret = BFD_ESING;
goto done;
case FHV_ECOND:
ret = BFD_ECOND;
goto done;
default:
xassert(bfd != bfd);
}
}
#else
skip: /* try to factorize the basis matrix */
if (bfd->fi != NULL)
{ /* FIXME */
if (fhvint_factorize(bfd->fi, m, col, info) != 0)
{ ret = BFD_ESING;
goto done;
}
/* printf("*** FACTORIZED; m = %d ***\n", m); */
}
#endif
else if (bfd->lpf != NULL)
{ switch (lpf_factorize(bfd->lpf, m, bh, col, info))
{ case 0:
/* set the Schur complement update type */
switch (bfd->type)
{ case GLP_BF_BG:
/* Bartels-Golub update */
#if 0 /* 11/VIII-2013 */
bfd->lpf->scf->t_opt = SCF_TBG;
#else
bfd->lpf->t_opt = SCF_TBG;
#endif
break;
case GLP_BF_GR:
/* Givens rotations update */
#if 0 /* 11/VIII-2013 */
bfd->lpf->scf->t_opt = SCF_TGR;
#else
bfd->lpf->t_opt = SCF_TGR;
#endif
break;
default:
xassert(bfd != bfd);
}
break;
case LPF_ESING:
ret = BFD_ESING;
goto done;
case LPF_ECOND:
ret = BFD_ECOND;
goto done;
default:
xassert(bfd != bfd);
}
}
else
xassert(bfd != bfd);
/* the basis matrix has been successfully factorized */
bfd->valid = 1;
bfd->upd_cnt = 0;
ret = 0;
done: /* return to the calling program */
return ret;
}
/***********************************************************************
* NAME
*
* bfd_ftran - perform forward transformation (solve system B*x = b)
*
* SYNOPSIS
*
* #include "glpbfd.h"
* void bfd_ftran(BFD *bfd, double x[]);
*
* DESCRIPTION
*
* The routine bfd_ftran performs forward transformation, i.e. solves
* the system B*x = b, where B is the basis matrix, x is the vector of
* unknowns to be computed, b is the vector of right-hand sides.
*
* On entry elements of the vector b should be stored in dense format
* in locations x[1], ..., x[m], where m is the number of rows. On exit
* the routine stores elements of the vector x in the same locations. */
void bfd_ftran(BFD *bfd, double x[])
{ xassert(bfd != NULL);
xassert(bfd->valid);
#if 0 /* 27/IV-2013 */
if (bfd->fhv != NULL)
fhv_ftran(bfd->fhv, x);
#else
if (bfd->fi != NULL)
fhvint_ftran(bfd->fi, x);
#endif
else if (bfd->lpf != NULL)
lpf_ftran(bfd->lpf, x);
else
xassert(bfd != bfd);
return;
}
/***********************************************************************
* NAME
*
* bfd_btran - perform backward transformation (solve system B'*x = b)
*
* SYNOPSIS
*
* #include "glpbfd.h"
* void bfd_btran(BFD *bfd, double x[]);
*
* DESCRIPTION
*
* The routine bfd_btran performs backward transformation, i.e. solves
* the system B'*x = b, where B' is a matrix transposed to the basis
* matrix B, x is the vector of unknowns to be computed, b is the vector
* of right-hand sides.
*
* On entry elements of the vector b should be stored in dense format
* in locations x[1], ..., x[m], where m is the number of rows. On exit
* the routine stores elements of the vector x in the same locations. */
void bfd_btran(BFD *bfd, double x[])
{ xassert(bfd != NULL);
xassert(bfd->valid);
#if 0 /* 27/IV-2013 */
if (bfd->fhv != NULL)
fhv_btran(bfd->fhv, x);
#else
if (bfd->fi != NULL)
fhvint_btran(bfd->fi, x);
#endif
else if (bfd->lpf != NULL)
lpf_btran(bfd->lpf, x);
else
xassert(bfd != bfd);
return;
}
/***********************************************************************
* NAME
*
* bfd_update_it - update LP basis factorization
*
* SYNOPSIS
*
* #include "glpbfd.h"
* int bfd_update_it(BFD *bfd, int j, int bh, int len, const int ind[],
* const double val[]);
*
* DESCRIPTION
*
* The routine bfd_update_it updates the factorization of the basis
* matrix B after replacing its j-th column by a new vector.
*
* The parameter j specifies the number of column of B, which has been
* replaced, 1 <= j <= m, where m is the order of B.
*
* The parameter bh specifies the basis header entry for the new column
* of B, which is the number of the new column in some original matrix.
* This parameter is optional and can be specified as 0.
*
* Row indices and numerical values of non-zero elements of the new
* column of B should be placed in locations ind[1], ..., ind[len] and
* val[1], ..., val[len], resp., where len is the number of non-zeros
* in the column. Neither zero nor duplicate elements are allowed.
*
* RETURNS
*
* 0 The factorization has been successfully updated.
*
* BFD_ESING
* New basis matrix is singular within the working precision.
*
* BFD_ECHECK
* The factorization is inaccurate.
*
* BFD_ELIMIT
* Factorization update limit has been reached.
*
* BFD_EROOM
* Overflow of the sparse vector area.
*
* In case of non-zero return code the factorization becomes invalid.
* It should not be used until it has been recomputed with the routine
* bfd_factorize. */
int bfd_update_it(BFD *bfd, int j, int bh, int len, const int ind[],
const double val[])
{ int ret;
xassert(bfd != NULL);
xassert(bfd->valid);
/* try to update the factorization */
#if 0 /* 27/IV-2013 */
if (bfd->fhv != NULL)
{ switch (fhv_update_it(bfd->fhv, j, len, ind, val))
{ case 0:
break;
case FHV_ESING:
bfd->valid = 0;
ret = BFD_ESING;
goto done;
case FHV_ECHECK:
bfd->valid = 0;
ret = BFD_ECHECK;
goto done;
case FHV_ELIMIT:
bfd->valid = 0;
ret = BFD_ELIMIT;
goto done;
case FHV_EROOM:
bfd->valid = 0;
ret = BFD_EROOM;
goto done;
default:
xassert(bfd != bfd);
}
}
#else
if (bfd->fi != NULL)
{ /* see fhv_ft_update for return codes */
switch (fhvint_update(bfd->fi, j, len, ind, val))
{ case 0:
break;
case 1:
bfd->valid = 0;
ret = BFD_ESING;
goto done;
case 2:
case 3:
case 5:
bfd->valid = 0;
ret = BFD_ECHECK;
goto done;
case 4:
bfd->valid = 0;
ret = BFD_ELIMIT;
goto done;
default:
xassert(bfd != bfd);
}
}
#endif
else if (bfd->lpf != NULL)
{ switch (lpf_update_it(bfd->lpf, j, bh, len, ind, val))
{ case 0:
break;
case LPF_ESING:
bfd->valid = 0;
ret = BFD_ESING;
goto done;
case LPF_ELIMIT:
bfd->valid = 0;
ret = BFD_ELIMIT;
goto done;
default:
xassert(bfd != bfd);
}
}
else
xassert(bfd != bfd);
/* the factorization has been successfully updated */
/* increase the update count */
bfd->upd_cnt++;
ret = 0;
done: /* return to the calling program */
return ret;
}
/**********************************************************************/
int bfd_get_count(BFD *bfd)
{ /* determine factorization update count */
xassert(bfd != NULL);
xassert(bfd->valid);
return bfd->upd_cnt;
}
/***********************************************************************
* NAME
*
* bfd_delete_it - delete LP basis factorization
*
* SYNOPSIS
*
* #include "glpbfd.h"
* void bfd_delete_it(BFD *bfd);
*
* DESCRIPTION
*
* The routine bfd_delete_it deletes LP basis factorization specified
* by the parameter fhv and frees all memory allocated to this program
* object. */
void bfd_delete_it(BFD *bfd)
{ xassert(bfd != NULL);
#if 0 /* 27/IV-2013 */
if (bfd->fhv != NULL)
fhv_delete_it(bfd->fhv);
#else
if (bfd->fi != NULL)
fhvint_delete(bfd->fi);
#endif
if (bfd->lpf != NULL)
lpf_delete_it(bfd->lpf);
xfree(bfd);
return;
}
/* eof */

1097
resources/3rdparty/glpk-4.53/src/glplpf.c
File diff suppressed because it is too large
View File

216
resources/3rdparty/glpk-4.53/src/glplpf.h

@ -1,216 +0,0 @@
/* glplpf.h (LP basis factorization, Schur complement version) */
/***********************************************************************
* This code is part of GLPK (GNU Linear Programming Kit).
*
* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
* 2009, 2010, 2011, 2013 Andrew Makhorin, Department for Applied
* Informatics, Moscow Aviation Institute, Moscow, Russia. All rights
* reserved. E-mail: <mao@gnu.org>.
*
* GLPK is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GLPK is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GLPK. If not, see <http://www.gnu.org/licenses/>.
***********************************************************************/
#ifndef GLPLPF_H
#define GLPLPF_H
#if 0 /* 11/VIII-2013 */
#include "glpscf.h"
#else
#include "ifu.h"
#endif
#if 0 /* 06/VI-2013 */
#include "glpluf.h"
#else
#include "lufint.h"
#endif
/***********************************************************************
* The structure LPF defines the factorization of the basis mxm matrix
* B, where m is the number of rows in corresponding problem instance.
*
* This factorization is the following septet:
*
* [B] = (L0, U0, R, S, C, P, Q), (1)
*
* and is based on the following main equality:
*
* ( B F^) ( B0 F ) ( L0 0 ) ( U0 R )
* ( ) = P ( ) Q = P ( ) ( ) Q, (2)
* ( G^ H^) ( G H ) ( S I ) ( 0 C )
*
* where:
*
* B is the current basis matrix (not stored);
*
* F^, G^, H^ are some additional matrices (not stored);
*
* B0 is some initial basis matrix (not stored);
*
* F, G, H are some additional matrices (not stored);
*
* P, Q are permutation matrices (stored in both row- and column-like
* formats);
*
* L0, U0 are some matrices that defines a factorization of the initial
* basis matrix B0 = L0 * U0 (stored in an invertable form);
*
* R is a matrix defined from L0 * R = F, so R = inv(L0) * F (stored in
* a column-wise sparse format);
*
* S is a matrix defined from S * U0 = G, so S = G * inv(U0) (stored in
* a row-wise sparse format);
*
* C is the Schur complement for matrix (B0 F G H). It is defined from
* S * R + C = H, so C = H - S * R = H - G * inv(U0) * inv(L0) * F =
* = H - G * inv(B0) * F. Matrix C is stored in an invertable form.
*
* REFERENCES
*
* 1. M.A.Saunders, "LUSOL: A basis package for constrained optimiza-
* tion," SCCM, Stanford University, 2006.
*
* 2. M.A.Saunders, "Notes 5: Basis Updates," CME 318, Stanford Univer-
* sity, Spring 2006.
*
* 3. M.A.Saunders, "Notes 6: LUSOL---a Basis Factorization Package,"
* ibid. */
typedef struct LPF LPF;
struct LPF
{ /* LP basis factorization */
int valid;
/* the factorization is valid only if this flag is set */
/*--------------------------------------------------------------*/
/* initial basis matrix B0 */
int m0_max;
/* maximal value of m0 (increased automatically, if necessary) */
int m0;
/* the order of B0 */
#if 0 /* 06/VI-2013 */
LUF *luf;
#else
LUFINT *lufint;
#endif
/* LU-factorization of B0 */
/*--------------------------------------------------------------*/
/* current basis matrix B */
int m;
/* the order of B */
double *B; /* double B[1+m*m]; */
/* B in dense format stored by rows and used only for debugging;
normally this array is not allocated */
/*--------------------------------------------------------------*/
/* augmented matrix (B0 F G H) of the order m0+n */
int n_max;
/* maximal number of additional rows and columns */
int n;
/* current number of additional rows and columns */
/*--------------------------------------------------------------*/
/* m0xn matrix R in column-wise format */
int *R_ptr; /* int R_ptr[1+n_max]; */
/* R_ptr[j], 1 <= j <= n, is a pointer to j-th column */
int *R_len; /* int R_len[1+n_max]; */
/* R_len[j], 1 <= j <= n, is the length of j-th column */
/*--------------------------------------------------------------*/
/* nxm0 matrix S in row-wise format */
int *S_ptr; /* int S_ptr[1+n_max]; */
/* S_ptr[i], 1 <= i <= n, is a pointer to i-th row */
int *S_len; /* int S_len[1+n_max]; */
/* S_len[i], 1 <= i <= n, is the length of i-th row */
/*--------------------------------------------------------------*/
/* Schur complement C of the order n */
#if 0 /* 11/VIII-2013 */
SCF *scf; /* SCF scf[1:n_max]; */
/* factorization of the Schur complement */
#else
IFU ifu;
/* IFU-factorization of the Schur complement */
int t_opt;
/* type of transformation used to restore triangular structure of
matrix U: */
#define SCF_TBG 1 /* Bartels-Golub elimination */
#define SCF_TGR 2 /* Givens plane rotations */
#endif
/*--------------------------------------------------------------*/
/* matrix P of the order m0+n */
int *P_row; /* int P_row[1+m0_max+n_max]; */
/* P_row[i] = j means that P[i,j] = 1 */
int *P_col; /* int P_col[1+m0_max+n_max]; */
/* P_col[j] = i means that P[i,j] = 1 */
/*--------------------------------------------------------------*/
/* matrix Q of the order m0+n */
int *Q_row; /* int Q_row[1+m0_max+n_max]; */
/* Q_row[i] = j means that Q[i,j] = 1 */
int *Q_col; /* int Q_col[1+m0_max+n_max]; */
/* Q_col[j] = i means that Q[i,j] = 1 */
/*--------------------------------------------------------------*/
/* Sparse Vector Area (SVA) is a set of locations intended to
store sparse vectors which represent columns of matrix R and
rows of matrix S; each location is a doublet (ind, val), where
ind is an index, val is a numerical value of a sparse vector
element; in the whole each sparse vector is a set of adjacent
locations defined by a pointer to its first element and its
length, i.e. the number of its elements */
int v_size;
/* the SVA size, in locations; locations are numbered by integers
1, 2, ..., v_size, and location 0 is not used */
int v_ptr;
/* pointer to the first available location */
int *v_ind; /* int v_ind[1+v_size]; */
/* v_ind[k], 1 <= k <= v_size, is the index field of location k */
double *v_val; /* double v_val[1+v_size]; */
/* v_val[k], 1 <= k <= v_size, is the value field of location k */
/*--------------------------------------------------------------*/
double *work1; /* double work1[1+m0+n_max]; */
/* working array */
double *work2; /* double work2[1+m0+n_max]; */
/* working array */
};
/* return codes: */
#define LPF_ESING 1 /* singular matrix */
#define LPF_ECOND 2 /* ill-conditioned matrix */
#define LPF_ELIMIT 3 /* update limit reached */
#define lpf_create_it _glp_lpf_create_it
LPF *lpf_create_it(void);
/* create LP basis factorization */
#define lpf_factorize _glp_lpf_factorize
int lpf_factorize(LPF *lpf, int m, const int bh[], int (*col)
(void *info, int j, int ind[], double val[]), void *info);
/* compute LP basis factorization */
#define lpf_ftran _glp_lpf_ftran
void lpf_ftran(LPF *lpf, double x[]);
/* perform forward transformation (solve system B*x = b) */
#define lpf_btran _glp_lpf_btran
void lpf_btran(LPF *lpf, double x[]);
/* perform backward transformation (solve system B'*x = b) */
#define lpf_update_it _glp_lpf_update_it
int lpf_update_it(LPF *lpf, int j, int bh, int len, const int ind[],
const double val[]);
/* update LP basis factorization */
#define lpf_delete_it _glp_lpf_delete_it
void lpf_delete_it(LPF *lpf);
/* delete LP basis factorization */
#endif
/* eof */

2971
resources/3rdparty/glpk-4.53/src/glpspx01.c
File diff suppressed because it is too large
View File

3118
resources/3rdparty/glpk-4.53/src/glpspx02.c
File diff suppressed because it is too large
View File

667
resources/3rdparty/glpk-4.53/src/glptsp.c

@ -1,667 +0,0 @@
/* glptsp.c */
/***********************************************************************
* This code is part of GLPK (GNU Linear Programming Kit).
*
* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
* 2009, 2010, 2011, 2013 Andrew Makhorin, Department for Applied
* Informatics, Moscow Aviation Institute, Moscow, Russia. All rights
* reserved. E-mail: <mao@gnu.org>.
*
* GLPK is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GLPK is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GLPK. If not, see <http://www.gnu.org/licenses/>.
***********************************************************************/
#include "env.h"
#include "glptsp.h"
#include "misc.h"
#define xfault xerror
/*----------------------------------------------------------------------
-- tsp_read_data - read TSP instance data.
--
-- *Synopsis*
--
-- #include "glptsp.h"
-- TSP *tsp_read_data(char *fname);
--
-- *Description*
--
-- The routine tsp_read_data reads a TSP (or related problem) instance
-- data from the text file, whose name is the character string fname.
--
-- For detailed description of the format recognized by the routine see
-- the report: G.Reinelt, TSPLIB 95.
--
-- *Returns*
--
-- If no error occurred, the routine tsp_read_data returns a pointer to
-- the TSP instance data block, which contains loaded data. In the case
-- of error the routine prints an error message and returns NULL. */
struct dsa
{ /* dynamic storage area used by the routine tsp_read_data */
char *fname;
/* name of the input text file */
FILE *fp;
/* stream assigned to the input text file */
int seqn;
/* line sequential number */
int c;
/* current character */
char token[255+1];
/* current token */
};
static int get_char(struct dsa *dsa)
{ dsa->c = fgetc(dsa->fp);
if (ferror(dsa->fp))
{ xprintf("%s:%d: read error - %s\n",
dsa->fname, dsa->seqn, strerror(errno));
return 1;
}
if (feof(dsa->fp))
dsa->c = EOF;
else if (dsa->c == '\n')
dsa->seqn++;
else if (isspace(dsa->c))
dsa->c = ' ';
else if (iscntrl(dsa->c))
{ xprintf("%s:%d: invalid control character 0x%02X\n",
dsa->fname, dsa->seqn, dsa->c);
return 1;
}
return 0;
}
static int skip_spaces(struct dsa *dsa, int across)
{ while (dsa->c == ' ' || (across && dsa->c == '\n'))
if (get_char(dsa)) return 1;
return 0;
}
static int scan_keyword(struct dsa *dsa)
{ int len = 0;
if (skip_spaces(dsa, 0)) return 1;
dsa->token[0] = '\0';
while (isalnum(dsa->c) || dsa->c == '_')
{ if (len == 31)
{ xprintf("%s:%d: keyword `%s...' too long\n", dsa->fname,
dsa->seqn, dsa->token);
return 1;
}
dsa->token[len++] = (char)dsa->c, dsa->token[len] = '\0';
if (get_char(dsa)) return 1;
}
if (len == 0)
{ xprintf("%s:%d: missing keyword\n", dsa->fname, dsa->seqn);
return 1;
}
return 0;
}
static int check_colon(struct dsa *dsa)
{ if (skip_spaces(dsa, 0)) return 1;
if (dsa->c != ':')
{ xprintf("%s:%d: missing colon after `%s'\n", dsa->fname,
dsa->seqn, dsa->token);
return 1;
}
if (get_char(dsa)) return 1;
return 0;
}
static int scan_token(struct dsa *dsa, int across)
{ int len = 0;
if (skip_spaces(dsa, across)) return 1;
dsa->token[0] = '\0';
while (!(dsa->c == EOF || dsa->c == '\n' || dsa->c == ' '))
{ if (len == 255)
{ dsa->token[31] = '\0';
xprintf("%s:%d: token `%s...' too long\n", dsa->fname,
dsa->seqn, dsa->token);
return 1;
}
dsa->token[len++] = (char)dsa->c, dsa->token[len] = '\0';
if (get_char(dsa)) return 1;
}
return 0;
}
static int check_newline(struct dsa *dsa)
{ if (skip_spaces(dsa, 0)) return 1;
if (!(dsa->c == EOF || dsa->c == '\n'))
{ xprintf("%s:%d: extra symbols detected\n", dsa->fname,
dsa->seqn);
return 1;
}
if (get_char(dsa)) return 1;
return 0;
}
static int scan_comment(struct dsa *dsa)
{ int len = 0;
if (skip_spaces(dsa, 0)) return 1;
dsa->token[0] = '\0';
while (!(dsa->c == EOF || dsa->c == '\n'))
{ if (len == 255)
{ xprintf("%s:%d: comment too long\n", dsa->fname, dsa->seqn)
;
return 1;
}
dsa->token[len++] = (char)dsa->c, dsa->token[len] = '\0';
if (get_char(dsa)) return 1;
}
return 0;
}
static int scan_integer(struct dsa *dsa, int across, int *val)
{ if (scan_token(dsa, across)) return 1;
if (strlen(dsa->token) == 0)
{ xprintf("%s:%d: missing integer\n", dsa->fname, dsa->seqn);
return 1;
}
if (str2int(dsa->token, val))
{ xprintf("%s:%d: integer `%s' invalid\n", dsa->fname, dsa->seqn
, dsa->token);
return 1;
}
return 0;
}
static int scan_number(struct dsa *dsa, int across, double *val)
{ if (scan_token(dsa, across)) return 1;
if (strlen(dsa->token) == 0)
{ xprintf("%s:%d: missing number\n", dsa->fname, dsa->seqn);
return 1;
}
if (str2num(dsa->token, val))
{ xprintf("%s:%d: number `%s' invalid\n", dsa->fname, dsa->seqn,
dsa->token);
return 1;
}
return 0;
}
TSP *tsp_read_data(char *fname)
{ struct dsa _dsa, *dsa = &_dsa;
TSP *tsp = NULL;
dsa->fname = fname;
xprintf("tsp_read_data: reading TSP data from `%s'...\n",
dsa->fname);
dsa->fp = fopen(dsa->fname, "r");
if (dsa->fp == NULL)
{ xprintf("tsp_read_data: unable to open `%s' - %s\n",
dsa->fname, strerror(errno));
goto fail;
}
tsp = xmalloc(sizeof(TSP));
tsp->name = NULL;
tsp->type = TSP_UNDEF;
tsp->comment = NULL;
tsp->dimension = 0;
tsp->edge_weight_type = TSP_UNDEF;
tsp->edge_weight_format = TSP_UNDEF;
tsp->display_data_type = TSP_UNDEF;
tsp->node_x_coord = NULL;
tsp->node_y_coord = NULL;
tsp->dply_x_coord = NULL;
tsp->dply_y_coord = NULL;
tsp->tour = NULL;
tsp->edge_weight = NULL;
dsa->seqn = 1;
if (get_char(dsa)) goto fail;
loop: if (scan_keyword(dsa)) goto fail;
if (strcmp(dsa->token, "NAME") == 0)
{ if (tsp->name != NULL)
{ xprintf("%s:%d: NAME entry multiply defined\n", dsa->fname,
dsa->seqn);
goto fail;
}
if (check_colon(dsa)) goto fail;
if (scan_token(dsa, 0)) goto fail;
if (strlen(dsa->token) == 0)
{ xprintf("%s:%d: NAME entry incomplete\n", dsa->fname,
dsa->seqn);
goto fail;
}
tsp->name = xmalloc(strlen(dsa->token) + 1);
strcpy(tsp->name, dsa->token);
xprintf("tsp_read_data: NAME: %s\n", tsp->name);
if (check_newline(dsa)) goto fail;
}
else if (strcmp(dsa->token, "TYPE") == 0)
{ if (tsp->type != TSP_UNDEF)
{ xprintf("%s:%d: TYPE entry multiply defined\n", dsa->fname,
dsa->seqn);
goto fail;
}
if (check_colon(dsa)) goto fail;
if (scan_keyword(dsa)) goto fail;
if (strcmp(dsa->token, "TSP") == 0)
tsp->type = TSP_TSP;
else if (strcmp(dsa->token, "ATSP") == 0)
tsp->type = TSP_ATSP;
else if (strcmp(dsa->token, "TOUR") == 0)
tsp->type = TSP_TOUR;
else
{ xprintf("%s:%d: data type `%s' not recognized\n",
dsa->fname, dsa->seqn, dsa->token);
goto fail;
}
xprintf("tsp_read_data: TYPE: %s\n", dsa->token);
if (check_newline(dsa)) goto fail;
}
else if (strcmp(dsa->token, "COMMENT") == 0)
{ if (tsp->comment != NULL)
{ xprintf("%s:%d: COMMENT entry multiply defined\n",
dsa->fname, dsa->seqn);
goto fail;
}
if (check_colon(dsa)) goto fail;
if (scan_comment(dsa)) goto fail;
tsp->comment = xmalloc(strlen(dsa->token) + 1);
strcpy(tsp->comment, dsa->token);
xprintf("tsp_read_data: COMMENT: %s\n", tsp->comment);
if (check_newline(dsa)) goto fail;
}
else if (strcmp(dsa->token, "DIMENSION") == 0)
{ if (tsp->dimension != 0)
{ xprintf("%s:%d: DIMENSION entry multiply defined\n",
dsa->fname, dsa->seqn);
goto fail;
}
if (check_colon(dsa)) goto fail;
if (scan_integer(dsa, 0, &tsp->dimension)) goto fail;
if (tsp->dimension < 1)
{ xprintf("%s:%d: invalid dimension\n", dsa->fname,
dsa->seqn);
goto fail;
}
xprintf("tsp_read_data: DIMENSION: %d\n", tsp->dimension);
if (check_newline(dsa)) goto fail;
}
else if (strcmp(dsa->token, "EDGE_WEIGHT_TYPE") == 0)
{ if (tsp->edge_weight_type != TSP_UNDEF)
{ xprintf("%s:%d: EDGE_WEIGHT_TYPE entry multiply defined\n",
dsa->fname, dsa->seqn);
goto fail;
}
if (check_colon(dsa)) goto fail;
if (scan_keyword(dsa)) goto fail;
if (strcmp(dsa->token, "GEO") == 0)
tsp->edge_weight_type = TSP_GEO;
else if (strcmp(dsa->token, "EUC_2D") == 0)
tsp->edge_weight_type = TSP_EUC_2D;
else if (strcmp(dsa->token, "ATT") == 0)
tsp->edge_weight_type = TSP_ATT;
else if (strcmp(dsa->token, "EXPLICIT") == 0)
tsp->edge_weight_type = TSP_EXPLICIT;
else if (strcmp(dsa->token, "CEIL_2D") == 0)
tsp->edge_weight_type = TSP_CEIL_2D;
else
{ xprintf("%s:%d: edge weight type `%s' not recognized\n",
dsa->fname, dsa->seqn, dsa->token);
goto fail;
}
xprintf("tsp_read_data: EDGE_WEIGHT_TYPE: %s\n", dsa->token);
if (check_newline(dsa)) goto fail;
}
else if (strcmp(dsa->token, "EDGE_WEIGHT_FORMAT") == 0)
{ if (tsp->edge_weight_format != TSP_UNDEF)
{ xprintf(
"%s:%d: EDGE_WEIGHT_FORMAT entry multiply defined\n",
dsa->fname, dsa->seqn);
goto fail;
}
if (check_colon(dsa)) goto fail;
if (scan_keyword(dsa)) goto fail;
if (strcmp(dsa->token, "UPPER_ROW") == 0)
tsp->edge_weight_format = TSP_UPPER_ROW;
else if (strcmp(dsa->token, "FULL_MATRIX") == 0)
tsp->edge_weight_format = TSP_FULL_MATRIX;
else if (strcmp(dsa->token, "FUNCTION") == 0)
tsp->edge_weight_format = TSP_FUNCTION;
else if (strcmp(dsa->token, "LOWER_DIAG_ROW") == 0)
tsp->edge_weight_format = TSP_LOWER_DIAG_ROW;
else
{ xprintf("%s:%d: edge weight format `%s' not recognized\n",
dsa->fname, dsa->seqn, dsa->token);
goto fail;
}
xprintf("tsp_read_data: EDGE_WEIGHT_FORMAT: %s\n", dsa->token);
if (check_newline(dsa)) goto fail;
}
else if (strcmp(dsa->token, "DISPLAY_DATA_TYPE") == 0)
{ if (tsp->display_data_type != TSP_UNDEF)
{ xprintf("%s:%d: DISPLAY_DATA_TYPE entry multiply defined\n",
dsa->fname, dsa->seqn);
goto fail;
}
if (check_colon(dsa)) goto fail;
if (scan_keyword(dsa)) goto fail;
if (strcmp(dsa->token, "COORD_DISPLAY") == 0)
tsp->display_data_type = TSP_COORD_DISPLAY;
else if (strcmp(dsa->token, "TWOD_DISPLAY") == 0)
tsp->display_data_type = TSP_TWOD_DISPLAY;
else
{ xprintf("%s:%d: display data type `%s' not recognized\n",
dsa->fname, dsa->seqn, dsa->token);
goto fail;
}
xprintf("tsp_read_data: DISPLAY_DATA_TYPE: %s\n", dsa->token);
if (check_newline(dsa)) goto fail;
}
else if (strcmp(dsa->token, "NODE_COORD_SECTION") == 0)
{ int n = tsp->dimension, k, node;
if (n == 0)
{ xprintf("%s:%d: DIMENSION entry not specified\n",
dsa->fname, dsa->seqn);
goto fail;
}
if (tsp->node_x_coord != NULL)
{ xprintf("%s:%d: NODE_COORD_SECTION multiply specified\n",
dsa->fname, dsa->seqn);
goto fail;
}
if (check_newline(dsa)) goto fail;
tsp->node_x_coord = xcalloc(1+n, sizeof(double));
tsp->node_y_coord = xcalloc(1+n, sizeof(double));
for (node = 1; node <= n; node++)
tsp->node_x_coord[node] = tsp->node_y_coord[node] = DBL_MAX;
for (k = 1; k <= n; k++)
{ if (scan_integer(dsa, 0, &node)) goto fail;
if (!(1 <= node && node <= n))
{ xprintf("%s:%d: invalid node number %d\n", dsa->fname,
dsa->seqn, node);
goto fail;
}
if (tsp->node_x_coord[node] != DBL_MAX)
{ xprintf("%s:%d: node number %d multiply specified\n",
dsa->fname, dsa->seqn, node);
goto fail;
}
if (scan_number(dsa, 0, &tsp->node_x_coord[node]))
goto fail;
if (scan_number(dsa, 0, &tsp->node_y_coord[node]))
goto fail;
if (check_newline(dsa)) goto fail;
}
}
else if (strcmp(dsa->token, "DISPLAY_DATA_SECTION") == 0)
{ int n = tsp->dimension, k, node;
if (n == 0)
{ xprintf("%s:%d: DIMENSION entry not specified\n",
dsa->fname, dsa->seqn);
goto fail;
}
if (tsp->dply_x_coord != NULL)
{ xprintf("%s:%d: DISPLAY_DATA_SECTION multiply specified\n",
dsa->fname, dsa->seqn);
goto fail;
}
if (check_newline(dsa)) goto fail;
tsp->dply_x_coord = xcalloc(1+n, sizeof(double));
tsp->dply_y_coord = xcalloc(1+n, sizeof(double));
for (node = 1; node <= n; node++)
tsp->dply_x_coord[node] = tsp->dply_y_coord[node] = DBL_MAX;
for (k = 1; k <= n; k++)
{ if (scan_integer(dsa, 0, &node)) goto fail;
if (!(1 <= node && node <= n))
{ xprintf("%s:%d: invalid node number %d\n", dsa->fname,
dsa->seqn, node);
goto fail;
}
if (tsp->dply_x_coord[node] != DBL_MAX)
{ xprintf("%s:%d: node number %d multiply specified\n",
dsa->fname, dsa->seqn, node);
goto fail;
}
if (scan_number(dsa, 0, &tsp->dply_x_coord[node]))
goto fail;
if (scan_number(dsa, 0, &tsp->dply_y_coord[node]))
goto fail;
if (check_newline(dsa)) goto fail;
}
}
else if (strcmp(dsa->token, "TOUR_SECTION") == 0)
{ int n = tsp->dimension, k, node;
if (n == 0)
{ xprintf("%s:%d: DIMENSION entry not specified\n",
dsa->fname, dsa->seqn);
goto fail;
}
if (tsp->tour != NULL)
{ xprintf("%s:%d: TOUR_SECTION multiply specified\n",
dsa->fname, dsa->seqn);
goto fail;
}
if (check_newline(dsa)) goto fail;
tsp->tour = xcalloc(1+n, sizeof(int));
for (k = 1; k <= n; k++)
{ if (scan_integer(dsa, 1, &node)) goto fail;
if (!(1 <= node && node <= n))
{ xprintf("%s:%d: invalid node number %d\n", dsa->fname,
dsa->seqn, node);
goto fail;
}
tsp->tour[k] = node;
}
if (scan_integer(dsa, 1, &node)) goto fail;
if (node != -1)
{ xprintf("%s:%d: extra node(s) detected\n", dsa->fname,
dsa->seqn);
goto fail;
}
if (check_newline(dsa)) goto fail;
}
else if (strcmp(dsa->token, "EDGE_WEIGHT_SECTION") == 0)
{ int n = tsp->dimension, i, j, temp;
if (n == 0)
{ xprintf("%s:%d: DIMENSION entry not specified\n",
dsa->fname, dsa->seqn);
goto fail;
}
if (tsp->edge_weight_format == TSP_UNDEF)
{ xprintf("%s:%d: EDGE_WEIGHT_FORMAT entry not specified\n",
dsa->fname, dsa->seqn);
goto fail;
}
if (tsp->edge_weight != NULL)
{ xprintf("%s:%d: EDGE_WEIGHT_SECTION multiply specified\n",
dsa->fname, dsa->seqn);
goto fail;
}
if (check_newline(dsa)) goto fail;
tsp->edge_weight = xcalloc(1+n*n, sizeof(int));
switch (tsp->edge_weight_format)
{ case TSP_FULL_MATRIX:
for (i = 1; i <= n; i++)
{ for (j = 1; j <= n; j++)
{ if (scan_integer(dsa, 1, &temp)) goto fail;
tsp->edge_weight[(i - 1) * n + j] = temp;
}
}
break;
case TSP_UPPER_ROW:
for (i = 1; i <= n; i++)
{ tsp->edge_weight[(i - 1) * n + i] = 0;
for (j = i + 1; j <= n; j++)
{ if (scan_integer(dsa, 1, &temp)) goto fail;
tsp->edge_weight[(i - 1) * n + j] = temp;
tsp->edge_weight[(j - 1) * n + i] = temp;
}
}
break;
case TSP_LOWER_DIAG_ROW:
for (i = 1; i <= n; i++)
{ for (j = 1; j <= i; j++)
{ if (scan_integer(dsa, 1, &temp)) goto fail;
tsp->edge_weight[(i - 1) * n + j] = temp;
tsp->edge_weight[(j - 1) * n + i] = temp;
}
}
break;
default:
goto fail;
}
if (check_newline(dsa)) goto fail;
}
else if (strcmp(dsa->token, "EOF") == 0)
{ if (check_newline(dsa)) goto fail;
goto done;
}
else
{ xprintf("%s:%d: keyword `%s' not recognized\n", dsa->fname,
dsa->seqn, dsa->token);
goto fail;
}
goto loop;
done: xprintf("tsp_read_data: %d lines were read\n", dsa->seqn-1);
fclose(dsa->fp);
return tsp;
fail: if (tsp != NULL)
{ if (tsp->name != NULL) xfree(tsp->name);
if (tsp->comment != NULL) xfree(tsp->comment);
if (tsp->node_x_coord != NULL) xfree(tsp->node_x_coord);
if (tsp->node_y_coord != NULL) xfree(tsp->node_y_coord);
if (tsp->dply_x_coord != NULL) xfree(tsp->dply_x_coord);
if (tsp->dply_y_coord != NULL) xfree(tsp->dply_y_coord);
if (tsp->tour != NULL) xfree(tsp->tour);
if (tsp->edge_weight != NULL) xfree(tsp->edge_weight);
xfree(tsp);
}
if (dsa->fp != NULL) fclose(dsa->fp);
return NULL;
}
/*----------------------------------------------------------------------
-- tsp_free_data - free TSP instance data.
--
-- *Synopsis*
--
-- #include "glptsp.h"
-- void tsp_free_data(TSP *tsp);
--
-- *Description*
--
-- The routine tsp_free_data frees all the memory allocated to the TSP
-- instance data block, which the parameter tsp points to. */
void tsp_free_data(TSP *tsp)
{ if (tsp->name != NULL) xfree(tsp->name);
if (tsp->comment != NULL) xfree(tsp->comment);
if (tsp->node_x_coord != NULL) xfree(tsp->node_x_coord);
if (tsp->node_y_coord != NULL) xfree(tsp->node_y_coord);
if (tsp->dply_x_coord != NULL) xfree(tsp->dply_x_coord);
if (tsp->dply_y_coord != NULL) xfree(tsp->dply_y_coord);
if (tsp->tour != NULL) xfree(tsp->tour);
if (tsp->edge_weight != NULL) xfree(tsp->edge_weight);
xfree(tsp);
return;
}
/*----------------------------------------------------------------------
-- tsp_distance - compute distance between two nodes.
--
-- *Synopsis*
--
-- #include "glptsp.h"
-- int tsp_distance(TSP *tsp, int i, int j);
--
-- *Description*
--
-- The routine tsp_distance computes the distance between i-th and j-th
-- nodes for the TSP instance, which tsp points to.
--
-- *Returns*
--
-- The routine tsp_distance returns the computed distance. */
#define nint(x) ((int)((x) + 0.5))
static double rad(double x)
{ /* convert input coordinate to longitude/latitude, in radians */
double pi = 3.141592, deg, min;
deg = (int)x;
min = x - deg;
return pi * (deg + 5.0 * min / 3.0) / 180.0;
}
int tsp_distance(TSP *tsp, int i, int j)
{ int n = tsp->dimension, dij;
if (!(tsp->type == TSP_TSP || tsp->type == TSP_ATSP))
xfault("tsp_distance: invalid TSP instance\n");
if (!(1 <= i && i <= n && 1 <= j && j <= n))
xfault("tsp_distance: node number out of range\n");
switch (tsp->edge_weight_type)
{ case TSP_UNDEF:
xfault("tsp_distance: edge weight type not specified\n");
case TSP_EXPLICIT:
if (tsp->edge_weight == NULL)
xfault("tsp_distance: edge weights not specified\n");
dij = tsp->edge_weight[(i - 1) * n + j];
break;
case TSP_EUC_2D:
if (tsp->node_x_coord == NULL || tsp->node_y_coord == NULL)
xfault("tsp_distance: node coordinates not specified\n");
{ double xd, yd;
xd = tsp->node_x_coord[i] - tsp->node_x_coord[j];
yd = tsp->node_y_coord[i] - tsp->node_y_coord[j];
dij = nint(sqrt(xd * xd + yd * yd));
}
break;
case TSP_CEIL_2D:
if (tsp->node_x_coord == NULL || tsp->node_y_coord == NULL)
xfault("tsp_distance: node coordinates not specified\n");
{ double xd, yd;
xd = tsp->node_x_coord[i] - tsp->node_x_coord[j];
yd = tsp->node_y_coord[i] - tsp->node_y_coord[j];
dij = (int)ceil(sqrt(xd * xd + yd * yd));
}
break;
case TSP_GEO:
if (tsp->node_x_coord == NULL || tsp->node_y_coord == NULL)
xfault("tsp_distance: node coordinates not specified\n");
{ double rrr = 6378.388;
double latitude_i = rad(tsp->node_x_coord[i]);
double latitude_j = rad(tsp->node_x_coord[j]);
double longitude_i = rad(tsp->node_y_coord[i]);
double longitude_j = rad(tsp->node_y_coord[j]);
double q1 = cos(longitude_i - longitude_j);
double q2 = cos(latitude_i - latitude_j);
double q3 = cos(latitude_i + latitude_j);
dij = (int)(rrr * acos(0.5 * ((1.0 + q1) * q2 -
(1.0 - q1) *q3)) + 1.0);
}
break;
case TSP_ATT:
if (tsp->node_x_coord == NULL || tsp->node_y_coord == NULL)
xfault("tsp_distance: node coordinates not specified\n");
{ int tij;
double xd, yd, rij;
xd = tsp->node_x_coord[i] - tsp->node_x_coord[j];
yd = tsp->node_y_coord[i] - tsp->node_y_coord[j];
rij = sqrt((xd * xd + yd * yd) / 10.0);
tij = nint(rij);
if (tij < rij) dij = tij + 1; else dij = tij;
}
break;
default:
xassert(tsp->edge_weight_type != tsp->edge_weight_type);
}
return dij;
}
/* eof */

0
resources/3rdparty/glpk-4.53/AUTHORS → resources/3rdparty/glpk-4.57/AUTHORS

0
resources/3rdparty/glpk-4.53/COPYING → resources/3rdparty/glpk-4.57/COPYING

185
resources/3rdparty/glpk-4.53/ChangeLog → resources/3rdparty/glpk-4.57/ChangeLog

@ -1,3 +1,188 @@
Sun Nov 08 12:00:00 2015 Andrew Makhorin <mao@gnu.org>
* GLPK 4.57 (38:0:2) has been released.
* src/simplex/spy*.*
New, more efficient implementation of the dual simplex method
was included in the package.
* src/simplex/spxprim.c
Incorrect directive #ifdef USE_AT was changed to #if USE_AT.
* src/simplex/simplex.h
New header for simplex-based drivers was added.
* src/glpspx02.c
Old implementation of the dual simplex method was removed from
the package.
* src/glpspx.h
Old header for simplex-based drivers was removed.
* src/glpapi06.c
Call to spx_dual was changed to spy_dual.
tol_piv = 1e-10 in glp_init_smcp was changed to 1e-9 (this new
tolerance seems to be more adequate for new implementations of
the primal and dual simplex methods).
* src/glpk.h, src/glpapi09.c, src/glpios03.c
Option iocp.sr_heur to enable/disable simple rounding heuristic
was added. Thanks to Chris Matrakidis <cmatraki@gmail.com> for
suggestion.
* src/env/env.h src/env/error.c
API routine glp_at_error was added and documented. Thanks to
Jeroen Demeyer <jdemeyer@cage.ugent.be> for suggestion.
* src/glpapi19.c
Translation of MiniSat solver (src/minisat) from C++ to C is
made by a non-skilled programmer who converts pointers to ints
and vice versa, so MiniSat works on 32-bit platforms only.
Fixing this portability issue would require rewriting the code,
so currently to prevent crashing the API routine glp_minisat1
was changed just to report failure if 64-bit version of GLPK is
used. Thanks to Heinrich Schuchardt <xypron.glpk@gmx.de> for
bug report.
* doc/glpk.tex, doc/gmpl.tex
Some material was added according to changes in GLPK API.
Also some minor typos were corrected. Thanks to Anton Voropaev
<anton.n.voropaev@gmail.com> for typo report.
* w32/makefiles, w64/makefiles
Option /Zi was added to pass to MSVC compiler.
examples/tsp/*.*
An example application program TSPSOL was added. This program
is intended to solve the Symmetric Traveling Salesman Problem.
For more details see examples/tsp/README.
Thu Oct 01 12:00:00 2015 Andrew Makhorin <mao@gnu.org>
* GLPK 4.56 (37:3:1) has been released.
* src/simplex/*.c, *.h
New, more efficient and robust implementation of the primal
simplex method was included in the package.
* src/glpspx01.c
Old implementation of the primal simplex method was removed
from the package.
* src/bflib/sgf.c
A bug was fixed in routine sgf_reduce_nuc. (The bug appeared if
the basis matrix was structurally singular.) Thanks to Martin
Jacob <mj@bahntechnik.de> for bug report.
* w32/*.*, w64/*.*
Scripts to build GLPK with Microsoft Visual Studio 2015 were
added. Thanks to Xypron <xypron.glpk@gmx.de> for contribution
and testing.
Fri Aug 22 12:00:00 2014 Andrew Makhorin <mao@gnu.org>
* GLPK 4.55 (37:2:1) has been released.
* src/bflib/luf.c, src/bflib/luf.h
Two routines luf_vt_solve1 and luf_estimate_norm were added to
estimate 1-norm of matrix inverse.
* src/bflib/btf.c, src/bflib/btf.h
Two routines btf_at_solve1 and btf_estimate_norm were added to
estimate 1-norm of block triangular matrix inverse.
* src/bflib/fhvint.c, src/bflib/fhvint.h
The routine fhvint_estimate was added to estimate 1-norm of the
basis matrix inverse (FHV-factorization).
* src/bflib/scfint.c, src/bflib/scfint.h
The routine scfint_estimate was added to estimate 1-norm of the
basis matrix inverse (Schur-complement-based factorization).
* src/bfd.c, src/bfd.c
The routine bfd_condest was added to estimate the condition of
the basis matrix.
* src/bflib/scfint.h
The prefix '_glp' was added to keep the namespace clean.
* src/env/stream.c
Two open modes "a" and "ab" were added. Thanks to Pedro P. Wong
<d00604@taipower.com.tw> for bug report.
* src/glpapi21.c (glpsol)
Minor bug was fixed (command-line options --btf, --cbg, --cgr
didn't work properly).
* src/bflib/sgf.c
A serious bug was fixed in a basis factorization routine used
on the dense phase. (The bug might appear only if the number of
rows exceeded sqrt(2**31) ~= 46,340 and caused access violtaion
exception because of integer overflow.) Thanks to Mark Meketon
<Marc.Meketon@oliverwyman.com> for bug report.
* doc/glpk.tex
Two API routines glp_alloc and glp_realloc were documented.
Thanks to Brian Gladman <brg@gladman.plus.com> for suggestion.
* doc/gmpl_es.tex, doc/gmpl_es.pdf
Translation of the document "Modeling Language GNU MathProg"
to Spanish was included (in LaTeX and pdf formats). Thanks to
Pablo Yapura <ypf@agro.unlp.edu.ar> for contribution.
Fri Mar 28 12:00:00 2014 Andrew Makhorin <mao@gnu.org>
* GLPK 4.54 (37:1:1) has been released.
* src/bflib/fhvint.h, fhvint.c
Some technical changes were made.
* src/bflib/btf.h, btf.c, btfint.h, btfint.c
The module BTF was added to the package. It implements sparse
block triangular factorization of a square non-singular matrix
and is based on LU-factorization (see the LUF module).
* src/bflib/scf.h, scf.c, scfint.h, scfint.c
The module SCF was added to the package. It implements sparse
factorization of a square non-singular matrix based on Schur
complement and LU-factorization (plain or block triangular; see
the LUF and BTF modules).
* src/bfd.c
LP basis factorization driver was changed to use most recent
versions of the FHV and SCF modules.
* src/glplpf.h, glplpf.c
Old version of the Schur-complement-based factorization module
was removed from the package.
* src/glpk.h
New flags GLP_BF_LUF, GLP_BF_BTF were added for glp_bfcp.
* src/glpapi12.c
The API routines glp_get_bfcp, glp_set_bfcp were replaced due
to new version of the BFD module.
* src/glpapi21.c
New command-line options --luf, --btf, --ft, --cbg, and --cgr
were added for the glpsol solver.
* src/*
According to a new version of the GNU Coding Standards in all
messages a grave accent character (`) was replaced by a single
apostrophe character (').
* src/glpapi09.c mip status bug was fixed. Thanks to Remy Roy
<remyroyster@gmail.com> for bug report.
* doc/glpk.tex
Some comments about invalidating the basis factorization were
added. Thanks to Xypron <xypron.glpk@gmx.de> for suggestion.
* configure.ac
"iodbc-config --cflags" was added to detect iodbc flags. Thanks
to Sebastien Villemot <sebastien@debian.org> for patch.
Thu Feb 13 12:00:00 2014 Andrew Makhorin <mao@gnu.org>
* GLPK 4.53 (37:0:1) has been released.

0
resources/3rdparty/glpk-4.53/INSTALL → resources/3rdparty/glpk-4.57/INSTALL

0
resources/3rdparty/glpk-4.53/Makefile.am → resources/3rdparty/glpk-4.57/Makefile.am

0
resources/3rdparty/glpk-4.53/Makefile.in → resources/3rdparty/glpk-4.57/Makefile.in

100
resources/3rdparty/glpk-4.53/NEWS → resources/3rdparty/glpk-4.57/NEWS

@ -1,3 +1,103 @@
GLPK 4.57 (release date: Nov 08, 2015)
A new, more efficient implementation of the dual simplex method
was included in the package. This new implementation replaces
the old one, which was removed.
Option sr_heur was added to struct glp_iocp to enable/disable
the simple rounding heuristic used by the MIP solver. Thanks to
Chris Matrakidis <cmatraki@gmail.com> for suggestion.
New API routine glp_at_error was added and documented. Thanks
to Jeroen Demeyer <jdemeyer@cage.ugent.be> for suggestion.
Some minor typos were corrected in the GLPK documentation.
Thanks to Anton Voropaev <anton.n.voropaev@gmail.com> for typo
report.
An example application program TSPSOL was added. It uses the
GLPK MIP optimizer to solve the Symmetric Traveling Salesman
Problem and illustrates "lazy" constraints generation. For more
details please see glpk/examples/tsp/README.
GLPK 4.56 (release date: Oct 01, 2015)
A new, more efficient and more robust implementation of the
primal simplex method was included in the package. This new
implementation replaces the old one, which was removed.
A bug was fixed in a basis factorization routine. (The bug
appeared if the basis matrix was structurally singular having
duplicate row and/or column singletons.) Thanks to Martin Jacob
<mj@bahntechnik.de> for bug report.
Scripts to build GLPK with Microsoft Visual Studio 2015 were
added. Thanks to Xypron <xypron.glpk@gmx.de> for contribution
and testing.
GLPK 4.55 (release date: Aug 22, 2014)
Some internal (non-API) routines to estimate the condition of
the basis matrix were added. These routines are mainly intended
to be used by the simplex-based solvers.
Two open modes "a" and "ab" were added to GLPK I/O routines.
Thanks to Pedro P. Wong <d00604@taipower.com.tw> for bug report.
Minor bug was fixed in the solver glpsol (command-line options
--btf, --cbg, and --cgr didn't work properly).
A serious bug was fixed in a basis factorization routine used
on the dense phase. (The bug might appear only if the number of
rows exceeded sqrt(2**31) ~= 46,340 and caused access violation
exception because of integer overflow.) Thanks to Mark Meketon
<Marc.Meketon@oliverwyman.com> for bug report.
Two API routines glp_alloc and glp_realloc were documented.
Thanks to Brian Gladman <brg@gladman.plus.com> for suggestion.
Translation of the document "Modeling Language GNU MathProg"
to Spanish was included (in LaTeX and pdf formats). Thanks to
Pablo Yapura <ypf@agro.unlp.edu.ar> for contribution.
GLPK 4.54 (release date: Mar 28, 2014)
Block-triangular LU-factorization was implemented to be used
on computing an initial factorization of the basis matrix.
A new version of the Schur-complement-based factorization
module was included in the package. Now it can be used along
with plain as well as with block-triangular LU-factorization.
Currently the following flags can be used to specify the type
of the basis matrix factorization (glp_bfcp.type):
GLP_BF_LUF + GLP_BF_FT LUF, Forrest-Tomlin update (default)
GLP_BF_LUF + GLP_BF_BG LUF, Schur complement, Bartels-Golub
update
GLP_BF_LUF + GLP_BF_GR LUF, Schur complement, Givens rotation
update
GLP_BF_BTF + GLP_BF_BG BTF, Schur complement, Bartels-Golub
update
GLP_BF_BTF + GLP_BF_GR BTF, Schur complement, Givens rotation
update
In case of GLP_BF_FT the update is applied to matrix U, while
in cases of GLP_BF_BG and GLP_BF_GR the update is applied to
the Schur complement.
Corresponding new options --luf and --btf were added to glpsol.
For more details please see a new edition of the GLPK reference
manual included in the distribution.
A minor bug (in reporting the mip solution status) was fixed.
Thanks to Remy Roy <remyroyster@gmail.com> for bug report.
A call to "iodbc-config --cflags" was added in configure.ac
to correctly detect iodbc flags. Thanks to Sebastien Villemot
<sebastien@debian.org> for patch.
GLPK 4.53 (release date: Feb 13, 2014)
The API routine glp_read_mps was changed to remove free rows.

8
resources/3rdparty/glpk-4.53/README → resources/3rdparty/glpk-4.57/README

@ -1,11 +1,11 @@
Olga K. gewidmet
GLPK (GNU Linear Programming Kit) Version 4.53
GLPK (GNU Linear Programming Kit) Version 4.57
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
2009, 2010, 2011, 2013, 2014 Andrew Makhorin, Department for Applied
Informatics, Moscow Aviation Institute, Moscow, Russia. All rights
reserved. E-mail: <mao@gnu.org>.
2009, 2010, 2011, 2013, 2014, 2015 Andrew Makhorin, Department for
Applied Informatics, Moscow Aviation Institute, Moscow, Russia. All
rights reserved. E-mail: <mao@gnu.org>.
GLPK is part of the GNU Project released under the aegis of GNU.

19
resources/3rdparty/glpk-4.53/THANKS → resources/3rdparty/glpk-4.57/THANKS

@ -11,6 +11,8 @@ Andrew Hood <ajhood@fl.net.au> for bug report.
Anne-Laurence Putz <anne-laurence.putz@eurodecision.com> for bug
report.
Anton Voropaev <anton.n.voropaev@gmail.com> for bug and typo report.
Axel Simon <Axel.Simon@ens.fr> for bug report.
Bernhard Schmidt <schmidt@math.uni-augsburg.de> for bug report.
@ -23,6 +25,8 @@ for bounds sensitivity analysis.
Brady Hunsaker <hunsaker@engr.pitt.edu> for some suggestions concerning
MIP routines.
Brian Gladman <brg@gladman.plus.com> for suggestion.
Cameron Kellough <Cameron.Kellough@sri.com> for bug report.
Carlo Baldassi <carlobaldassi@gmail.com> for bug report.
@ -31,6 +35,8 @@ Cedric[FR] <fox2113@wanadoo.fr> for bug report.
Charles Brixko <charles.brixko@voo.be> for bug report.
Chris Matrakidis <cmatraki@gmail.com> for suggestion.
Chris Rosebrugh <cpr@pobox.com> for contribution of a new version of
GLPK JNI (Java Native Interface).
@ -82,6 +88,8 @@ Jan Engelhardt <jengelh@inai.de> for some suggestions.
Jeffrey Kantor <Kantor.1@nd.edu> for reporting typos in the MathProg
language reference.
Jeroen Demeyer <jdemeyer@cage.ugent.be> for suggestion.
Jiri Spitz <jiri.spitz@telecom.cz> for bug report.
Joey Rios <joeylrios@hotmail.com> for some suggestions.
@ -105,8 +113,12 @@ Marco Atzeri <marco.atzeri@gmail.com> for bug report.
Marco Atzeri <marco_atzeri@yahoo.it> for bug report.
Mark Meketon <Marc.Meketon@oliverwyman.com> for bug report.
Markus Pilz <pilz@cs.uni-bonn.de> for bug report.
Martin Jacob <mj@bahntechnik.de> for bug report.
Minh Ha Duong <haduong@centre-cired.fr> for fixing doc typos.
Morten Welinder <terra@diku.dk> for bug report.
@ -140,6 +152,11 @@ Olivier <odwl@skynet.be> for bug report.
Oscar Gustafsson <oscarg@isy.liu.se> for contribution of a routine to
write data in OPB (pseudo boolean) format.
Pablo Yapura <ypf@agro.unlp.edu.ar> for translation the document
"Modeling Language GNU MathProg" to Spanish.
Pedro P. Wong <d00604@taipower.com.tw> for bug report.
Peter T. Breuer <ptb@inv.it.uc3m.es> for bug report.
Peter A. Huegler <phuegler@bsco.com> for bug report.
@ -156,6 +173,8 @@ shared library support under GNU/Linux.
Raniere Gaia Costa da Silva for bug report.
Remy Roy <remyroyster@gmail.com> for bug report.
Robbie Morrison <robbie@actrix.co.nz> for correcting the glpk manual.
Robert Wood <rgwood01@cox.net> for example model in MathProg.

0
resources/3rdparty/glpk-4.53/aclocal.m4 → resources/3rdparty/glpk-4.57/aclocal.m4

0
resources/3rdparty/glpk-4.53/config.guess → resources/3rdparty/glpk-4.57/config.guess

0
resources/3rdparty/glpk-4.53/config.h.in → resources/3rdparty/glpk-4.57/config.h.in

0
resources/3rdparty/glpk-4.53/config.sub → resources/3rdparty/glpk-4.57/config.sub

21
resources/3rdparty/glpk-4.53/configure → resources/3rdparty/glpk-4.57/configure

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for GLPK 4.53.
# Generated by GNU Autoconf 2.69 for GLPK 4.57.
#
# Report bugs to <bug-glpk@gnu.org>.
#
@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='GLPK'
PACKAGE_TARNAME='glpk'
PACKAGE_VERSION='4.53'
PACKAGE_STRING='GLPK 4.53'
PACKAGE_VERSION='4.57'
PACKAGE_STRING='GLPK 4.57'
PACKAGE_BUGREPORT='bug-glpk@gnu.org'
PACKAGE_URL=''
@ -1309,7 +1309,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures GLPK 4.53 to adapt to many kinds of systems.
\`configure' configures GLPK 4.57 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1379,7 +1379,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of GLPK 4.53:";;
short | recursive ) echo "Configuration of GLPK 4.57:";;
esac
cat <<\_ACEOF
@ -1486,7 +1486,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
GLPK configure 4.53
GLPK configure 4.57
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1855,7 +1855,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by GLPK $as_me 4.53, which was
It was created by GLPK $as_me 4.57, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -2684,7 +2684,7 @@ fi
# Define the identity of the package.
PACKAGE='glpk'
VERSION='4.53'
VERSION='4.57'
cat >>confdefs.h <<_ACEOF
@ -11429,6 +11429,7 @@ if test "$enable_odbc" = "yes"; then
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
CFLAGS="$(iodbc-config --cflags) $CFLAGS"
cat >>confdefs.h <<_ACEOF
#define ODBC_DLNAME "$LIBIODBC"
@ -12001,7 +12002,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by GLPK $as_me 4.53, which was
This file was extended by GLPK $as_me 4.57, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -12067,7 +12068,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
GLPK config.status 4.53
GLPK config.status 4.57
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

3
resources/3rdparty/glpk-4.53/configure.ac → resources/3rdparty/glpk-4.57/configure.ac

@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script
AC_INIT([GLPK], [4.53], [bug-glpk@gnu.org])
AC_INIT([GLPK], [4.57], [bug-glpk@gnu.org])
AC_CONFIG_SRCDIR([src/glpk.h])
@ -117,6 +117,7 @@ if test "$enable_odbc" = "yes"; then
AC_MSG_ERROR([--enable-odbc requires --enable-dl])
fi
AC_MSG_RESULT([yes])
CFLAGS="$(iodbc-config --cflags) $CFLAGS"
AC_DEFINE_UNQUOTED([ODBC_DLNAME], ["$LIBIODBC"], [N/A])
elif test "$enable_odbc" = "unix"; then
if test "$enable_dl" = "no"; then

0
resources/3rdparty/glpk-4.53/depcomp → resources/3rdparty/glpk-4.57/depcomp

0
resources/3rdparty/glpk-4.53/doc/cnfsat.pdf → resources/3rdparty/glpk-4.57/doc/cnfsat.pdf

0
resources/3rdparty/glpk-4.53/doc/cnfsat.tex → resources/3rdparty/glpk-4.57/doc/cnfsat.tex

BIN
resources/3rdparty/glpk-4.53/doc/glpk.pdf → resources/3rdparty/glpk-4.57/doc/glpk.pdf

17
resources/3rdparty/glpk-4.53/doc/glpk.tex → resources/3rdparty/glpk-4.57/doc/glpk.tex

@ -4,9 +4,9 @@
% This code is part of GLPK (GNU Linear Programming Kit).
%
% Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
% 2009, 2010, 2011, 2013 Andrew Makhorin, Department for Applied
% Informatics, Moscow Aviation Institute, Moscow, Russia. All rights
% reserved. E-mail: <mao@gnu.org>.
% 2009, 2010, 2011, 2013, 2014, 2015 Andrew Makhorin, Department for
% Applied Informatics, Moscow Aviation Institute, Moscow, Russia. All
% rights reserved. E-mail: <mao@gnu.org>.
%
% GLPK is free software: you can redistribute it and/or modify it
% under the terms of the GNU General Public License as published by
@ -49,6 +49,7 @@ urlcolor=blue]{hyperref}
\def\para#1{\noindent{\bf#1}}
\def\synopsis{\para{Synopsis}}
\def\description{\para{Description}}
\def\note{\para{Note}}
\def\returns{\para{Returns}}
\renewcommand\contentsname{\sf\bfseries Contents}
@ -83,12 +84,12 @@ urlcolor=blue]{hyperref}
\vspace{0.5in}
\begin{LARGE}
\sf for GLPK Version 4.52
\sf for GLPK Version 4.57
\end{LARGE}
\vspace{0.5in}
\begin{Large}
\sf (DRAFT, July 2013)
\sf (DRAFT, November 2015)
\end{Large}
\end{center}
@ -104,9 +105,9 @@ GNU.
\noindent
Copyright \copyright{} 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009, 2010, 2011, 2013 Andrew Makhorin, Department for Applied
Informatics, Moscow Aviation Institute, Moscow, Russia. All rights
reserved.
2008, 2009, 2010, 2011, 2013, 2014, 2015 Andrew Makhorin, Department
for Applied Informatics, Moscow Aviation Institute, Moscow, Russia. All
rights reserved.
\noindent
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA

0
resources/3rdparty/glpk-4.53/doc/glpk01.tex → resources/3rdparty/glpk-4.57/doc/glpk01.tex

66
resources/3rdparty/glpk-4.53/doc/glpk02.tex → resources/3rdparty/glpk-4.57/doc/glpk02.tex

@ -352,6 +352,11 @@ the row list, so the ordinal numbers of existing rows are not changed.
Being added each new row is initially free (unbounded) and has empty
list of the constraint coefficients.
Each new row becomes a non-active (non-binding) constraint, i.e. the
corresponding auxiliary variable is marked as basic.
If the basis factorization exists, adding row(s) invalidates it.
\returns
The routine \verb|glp_add_rows| returns the ordinal number of the first
@ -375,6 +380,11 @@ columns are not changed.
Being added each new column is initially fixed at zero and has empty
list of the constraint coefficients.
Each new column is marked as non-basic, i.e. zero value of the
corresponding structural variable becomes an active (binding) bound.
If the basis factorization exists, it remains valid.
\returns
The routine \verb|glp_add_cols| returns the ordinal number of the first
@ -503,6 +513,8 @@ while the parameter \verb|ub| is ignored.
Being added to the problem object each column is initially fixed at
zero, i.e. its type is \verb|GLP_FX| and both bounds are 0.
\newpage
\subsection{glp\_set\_obj\_coef --- set (change) objective coefficient
or constant term}
@ -521,8 +533,6 @@ the objective coefficient is specified by the parameter \verb|coef|.
If the parameter \verb|j| is 0, the routine sets (changes) the constant
term (``shift'') of the objective function.
\newpage
\subsection{glp\_set\_mat\_row --- set (replace) row of the constraint
matrix}
@ -550,6 +560,11 @@ but they are not stored in the constraint matrix.
If the parameter \verb|len| is 0, the parameters \verb|ind| and/or
\verb|val| can be specified as \verb|NULL|.
\note
If the basis factorization exists and changing the row changes
coefficients at basic column(s), the factorization is invalidated.
\subsection{glp\_set\_mat\_col --- set (replace) column of the
constr\-aint matrix}
@ -577,6 +592,11 @@ they are not stored in the constraint matrix.
If the parameter \verb|len| is 0, the parameters \verb|ind| and/or
\verb|val| can be specified as \verb|NULL|.
\note
If the basis factorization exists, changing the column corresponding
to a basic structural variable invalidates it.
\subsection{glp\_load\_matrix --- load (replace) the whole constraint
matrix}
@ -606,6 +626,10 @@ however, they are not stored in the constraint matrix.
If the parameter \verb|ne| is 0, the parameters \verb|ia|, \verb|ja|,
and/or \verb|ar| can be specified as \verb|NULL|.
\note
If the basis factorization exists, this operation invalidates it.
\subsection{glp\_check\_dup --- check for duplicate elements in sparse
matrix}
@ -683,6 +707,11 @@ be five rows $a$, $b$, $c$, $d$, $e$ with ordinal numbers 1, 2, 3, 4,
5, and let rows $b$ and $d$ have been deleted. Then after deletion the
remaining rows $a$, $c$, $e$ are assigned new oridinal numbers 1, 2, 3.
If the basis factorization exists, deleting active (binding) rows,
i.e. whose auxiliary variables are marked as non-basic, invalidates it.
\newpage
\subsection{glp\_del\_cols --- delete columns from problem object}
\synopsis
@ -707,6 +736,9 @@ ordinal numbers 1, 2, 3, 4, 5, 6, and let columns $p$, $q$, $s$ have
been deleted. Then after deletion the remaining columns $r$, $t$, $u$
are assigned new ordinal numbers 1, 2, 3.
If the basis factorization exists, deleting basic columns invalidates
it.
\subsection{glp\_copy\_prob --- copy problem object content}
\synopsis
@ -724,8 +756,6 @@ The parameter \verb|names| is a flag. If it is \verb|GLP_ON|,
the routine also copies all symbolic names; otherwise, if it is
\verb|GLP_OFF|, no symbolic names are copied.
\newpage
\subsection{glp\_erase\_prob --- erase problem object content}
\synopsis
@ -742,6 +772,8 @@ problem object would be deleted with the routine \verb|glp_delete_prob|
and then created anew with the routine \verb|glp_create_prob|, with the
only exception that the pointer to the problem object remains valid.
\newpage
\subsection{glp\_delete\_prob --- delete problem object}
\synopsis
@ -1674,8 +1706,8 @@ infeasible or non-optimal, the presolver should be disabled.
\para{Terminal output}
Solving large problem instances may take a long time, so the solver
reports some information about the current basic solution, which is sent
to the terminal. This information has the following format:
reports some information about the current basic solution, which is
sent to the terminal. This information has the following format:
\begin{verbatim}
nnn: obj = xxx infeas = yyy (ddd)
@ -1683,8 +1715,8 @@ to the terminal. This information has the following format:
\noindent
where: `\verb|nnn|' is the iteration number, `\verb|xxx|' is the
current value of the objective function (it is is unscaled and has
correct sign); `\verb|yyy|' is the current sum of primal or dual
current value of the objective function (it is unscaled and has correct
sign); `\verb|yyy|' is the current sum of primal or dual
infeasibilities (it is scaled and therefore may be used only for visual
estimating), `\verb|ddd|' is the current number of fixed basic
variables.
@ -1773,7 +1805,7 @@ purpose.)
\bigskip
{\tt double tol\_piv} (default: {\tt 1e-10})
{\tt double tol\_piv} (default: {\tt 1e-9})
Tolerance used to choose eligble pivotal elements of the simplex table.
(Do not change this parameter without detailed understanding its
@ -2950,6 +2982,16 @@ Preprocessing technique option:
\bigskip\vspace*{-2pt}
{\tt int sr\_heur} (default: {\tt GLP\_ON})
Simple rounding heuristic option:
\verb|GLP_ON | --- enable applying the simple rounding heuristic;
\verb|GLP_OFF| --- disable applying the simple rounding heuristic.
\newpage
{\tt int fp\_heur} (default: {\tt GLP\_OFF})
Feasibility pump heuristic option:
@ -2958,7 +3000,7 @@ Feasibility pump heuristic option:
\verb|GLP_OFF| --- disable applying the feasibility pump heuristic.
\newpage
\bigskip
{\tt int ps\_heur} (default: {\tt GLP\_OFF})
@ -3019,7 +3061,7 @@ Clique cut option:
\verb|GLP_OFF| --- disable generating clique cuts.
\bigskip
\newpage
{\tt double tol\_int} (default: {\tt 1e-5})
@ -3027,7 +3069,7 @@ Absolute tolerance used to check if optimal solution to the current LP
relaxation is integer feasible. (Do not change this parameter without
detailed understanding its purpose.)
\newpage
\bigskip
{\tt double tol\_obj} (default: {\tt 1e-7})

0
resources/3rdparty/glpk-4.53/doc/glpk03.tex → resources/3rdparty/glpk-4.57/doc/glpk03.tex

78
resources/3rdparty/glpk-4.53/doc/glpk04.tex → resources/3rdparty/glpk-4.57/doc/glpk04.tex

@ -568,28 +568,36 @@ names of corresponding members in the structure \verb|glp_bfcp|.
\medskip
{\tt int type} (default: {\tt GLP\_BF\_FT})
{\tt int type} (default: {\tt GLP\_BF\_LUF + GLP\_BF\_FT})
Basis factorization type:
\verb|GLP_BF_FT|---$LU$ + Forrest--Tomlin update;
\verb~GLP_BF_LUF + GLP_BF_FT~ --- $LUF$, Forrest--Tomlin update;
\verb|GLP_BF_BG|---$LU$ + Schur complement + Bartels--Golub update;
\verb~GLP_BF_LUF + GLP_BF_BG~ --- $LUF$, Schur complement,
Bartels--Golub update;
\verb|GLP_BF_GR|---$LU$ + Schur complement + Givens rotation update.
\verb~GLP_BF_LUF + GLP_BF_GR~ --- $LUF$, Schur complement,
Givens rotation update;
\verb~GLP_BF_BTF + GLP_BF_BG~ --- $BTF$, Schur complement,
Bartels--Golub update;
\verb~GLP_BF_BTF + GLP_BF_GR~ --- $BTF$, Schur complement,
Givens rotation update.
In case of \verb|GLP_BF_FT| the update is applied to matrix $U$, while
in cases of \verb|GLP_BF_BG| and \verb|GLP_BF_GR| the update is applied
to the Schur complement.
\medskip
{\tt int lu\_size} (default: {\tt 0})
The initial size of the Sparse Vector Area, in non-zeros, used on
computing $LU$-factorization of the basis matrix for the first time.
If this parameter is set to 0, the initial SVA size is determined
automatically.
%\medskip
%
%{\tt int lu\_size} (default: {\tt 0})
%
%The initial size of the Sparse Vector Area, in non-zeros, used on
%computing $LU$-factorization of the basis matrix for the first time.
%If this parameter is set to 0, the initial SVA size is determined
%automatically.
\medskip
@ -635,17 +643,17 @@ $LU$-factorization of the basis matrix. If an element of the active
submatrix of factor $U$ is less than \verb|eps_tol| in the magnitude,
it is replaced by exact zero.
\medskip
{\tt double max\_gro} (default: {\tt 1e+10})
Maximal growth of elements of factor $U$, \verb|max_gro| $\geq$ 1,
allowable on computing $LU$-factorization of the basis matrix. If on
some elimination step the ratio $u_{big}/b_{max}$ (where $u_{big}$ is
the largest magnitude of elements of factor $U$ appeared in its active
submatrix during all the factorization process, $b_{max}$ is the
largest magnitude of elements of the basis matrix to be factorized),
the basis matrix is considered as ill-conditioned.
%\medskip
%
%{\tt double max\_gro} (default: {\tt 1e+10})
%
%Maximal growth of elements of factor $U$, \verb|max_gro| $\geq$ 1,
%allowable on computing $LU$-factorization of the basis matrix. If on
%some elimination step the ratio $u_{big}/b_{max}$ (where $u_{big}$ is
%the largest magnitude of elements of factor $U$ appeared in its active
%submatrix during all the factorization process, $b_{max}$ is the
%largest magnitude of elements of the basis matrix to be factorized),
%the basis matrix is considered as ill-conditioned.
\medskip
@ -683,17 +691,15 @@ allocate working arrays. As a rule, each update adds one new row and
column (however, some updates may need no addition), so this parameter
limits the number of updates between refactorizations.
\medskip
{\tt int rs\_size} (default: {\tt 0})
The initial size of the Sparse Vector Area, in non-zeros, used to
store non-zero elements of additional rows and columns introduced on
updating $LU$-factorization of the basis matrix with the Schur
complement technique. If this parameter is set to 0, the initial SVA
size is determined automatically.
\newpage
%\medskip
%
%{\tt int rs\_size} (default: {\tt 0})
%
%The initial size of the Sparse Vector Area, in non-zeros, used to
%store non-zero elements of additional rows and columns introduced on
%updating $LU$-factorization of the basis matrix with the Schur
%complement technique. If this parameter is set to 0, the initial SVA
%size is determined automatically.
\subsection{glp\_get\_bhead --- retrieve the basis header information}
@ -765,8 +771,6 @@ $1\leq i\leq m$, in the current basis associated with the specified
problem object, where $m$ is the number of rows. However, if $i$-th
auxiliary variable is non-basic, the routine returns zero.
\newpage
\para{Comments}
The routine \verb|glp_get_row_bind| is an inversion of the routine
@ -836,8 +840,6 @@ to the basis matrix $B$ associated with the specified problem object,
$x$ is the vector of unknowns to be computed, $b$ is the vector of
right-hand sides.
\newpage
On entry to the routine elements of the vector $b$ should be stored in
locations \verb|x[1]|, \dots, \verb|x[m]|, where $m$ is the number of
rows. On exit the routine stores elements of the vector $x$ in the same

0
resources/3rdparty/glpk-4.53/doc/glpk05.tex → resources/3rdparty/glpk-4.57/doc/glpk05.tex

83
resources/3rdparty/glpk-4.53/doc/glpk06.tex → resources/3rdparty/glpk-4.57/doc/glpk06.tex

@ -253,6 +253,29 @@ program.
\newpage
\subsection{glp\_at\_error --- check for error state}
\synopsis
\begin{verbatim}
int glp_at_error(void);
\end{verbatim}
\description
The routine \verb|glp_at_error| checks if the GLPK environment is at
error state, i.~e.~if the call to the routine is (indirectly) made from
the \verb|glp_error| routine via an user-defined hook routine.
This routine can be used, for example, by a custom output handler
(installed with the routine \verb|glp_term_hook|) to determine whether
or not the message to be displayed is an error message.
\returns
If the GLPK environment is at error state, the routine returns
non-zero, otherwise zero.
\subsection{glp\_assert --- check logical condition}
\synopsis
@ -303,68 +326,67 @@ terminated. To prevent abnormal termnation the hook routine may perform
a global jump using the standard function \verb|longjmp|, in which case
the application program {\it must} call the routine \verb|glp_free_env|.
\subsection{glp\_malloc --- allocate memory block}
\subsection{glp\_alloc --- allocate memory block}
\synopsis
\begin{verbatim}
void *glp_malloc(int size);
void *glp_alloc(int n, int size);
\end{verbatim}
\description
The routine \verb|glp_malloc| dynamically allocates a memory block of
\verb|size| bytes long. Note that:
The routine \verb|glp_alloc| dynamically allocates a memory block of
\verb|n|$\times$\verb|size| bytes long. Note that:
1) the parameter \verb|size| must be positive;
1) the parameters \verb|n| and \verb|size| must be positive;
2) being allocated the memory block contains arbitrary data, that is,
it is {\it not} initialized by binary zeros;
2) having been allocated the memory block contains arbitrary data, that
is, it is {\it not} initialized by binary zeros;
3) if the block cannot be allocated due to insufficient memory, the
routine prints an error message and abnormally terminates the program.
This routine is a replacement of the standard C function \verb|malloc|
and used by all GLPK routines for dynamic memory allocation. The
application program may use \verb|glp_malloc| for the same purpose.
and used by GLPK routines for dynamic memory allocation. The
application program may use \verb|glp_alloc| for the same purpose.
\returns
The routine \verb|glp_malloc| returns a pointer to the memory block
The routine \verb|glp_alloc| returns a pointer to the memory block
allocated. To free this block the routine \verb|glp_free| (not the
standard C function \verb|free|!) must be used.
standard C function \verb|free|!) should be used.
\subsection{glp\_calloc --- allocate memory block}
\subsection{glp\_realloc --- reallocate memory block}
\synopsis
\begin{verbatim}
void *glp_calloc(int n, int size);
void *glp_realloc(void *ptr, int n, int size);
\end{verbatim}
\description
The routine \verb|glp_calloc| dynamically allocates a memory block of
\verb|n|$\times$\verb|size| bytes long. Note that:
The routine \verb|glp_realloc| dynamically reallocates a memory block
pointed to by \verb|ptr|, which was previously allocated by the routine
\verb|glp_alloc| or reallocated by this routine. Note that the pointer
\verb|ptr| must be valid and must not be \verb|NULL|. The new size of
the memory block is \verb|n|$\times$\verb|size| bytes long. Note that:
1) both parameters \verb|n| and \verb|size| must be positive;
2) being allocated the memory block contains arbitrary data, that is,
it is {\it not} initialized by binary zeros;
3) if the block cannot be allocated due to insufficient memory, the
2) if the block cannot be reallocated due to insufficient memory, the
routine prints an error message and abnormally terminates the program.
This routine is a replacement of the standard C function \verb|calloc|
(with exception that the block is not cleaned) and used by all GLPK
routines for dynamic memory allocation. The application program may use
\verb|glp_calloc| for the same purpose.
This routine is a replacement of the standard C function \verb|realloc|
and used by GLPK routines for dynamic memory allocation. The
application program may use \verb|glp_realloc| for the same purpose.
\returns
The routine \verb|glp_calloc| returns a pointer to the memory block
allocated. To free this block the routine \verb|glp_free| (not the
standard C function \verb|free|!) must be used.
The routine \verb|glp_realloc| returns a pointer to the memory block
reallocated. To free this block the routine \verb|glp_free| (not the
standard C function \verb|free|!) should be used.
\subsection{glp\_free --- free memory block}
@ -378,15 +400,14 @@ standard C function \verb|free|!) must be used.
The routine \verb|glp_free| deallocates a memory block pointed to by
\verb|ptr|, which was previously allocated by the routine
\verb|glp_malloc| or \verb|glp_calloc|. Note that the pointer
\verb|ptr| must be valid and must not be \verb|NULL|.
\verb|glp_malloc| or reallocated by the routine \verb|glp_realloc|.
Note that the pointer \verb|ptr| must be valid and must not be
\verb|NULL|.
This routine is a replacement of the standard C function \verb|free|
and used by all GLPK routines for dynamic memory allocation. The
and used by GLPK routines for dynamic memory allocation. The
application program may use \verb|glp_free| for the same purpose.
\newpage
\subsection{glp\_mem\_usage --- get memory usage information}
\synopsis

0
resources/3rdparty/glpk-4.53/doc/glpk07.tex → resources/3rdparty/glpk-4.57/doc/glpk07.tex

0
resources/3rdparty/glpk-4.53/doc/glpk08.tex → resources/3rdparty/glpk-4.57/doc/glpk08.tex

0
resources/3rdparty/glpk-4.53/doc/glpk09.tex → resources/3rdparty/glpk-4.57/doc/glpk09.tex

11
resources/3rdparty/glpk-4.53/doc/glpk10.tex → resources/3rdparty/glpk-4.57/doc/glpk10.tex

@ -70,12 +70,11 @@ the problem, and write its solution to an output text file.
\para{LP basis factorization options}
\begin{verbatim}
--luf LU + Forrest-Tomlin update
(faster, less stable; default)
--cbg LU + Schur complement + Bartels-Golub update
(slower, more stable)
--cgr LU + Schur complement + Givens rotation update
(slower, more stable)
--luf plain LU factorization (default)
--btf block triangular LU factorization
--ft Forrest-Tomlin update (requires --luf; default)
--cbg Schur complement + Bartels-Golub update
--cgr Schur complement + Givens rotation update
\end{verbatim}
\para{Options specific to the simplex solver}

0
resources/3rdparty/glpk-4.53/doc/glpk11.tex → resources/3rdparty/glpk-4.57/doc/glpk11.tex

0
resources/3rdparty/glpk-4.53/doc/glpk12.tex → resources/3rdparty/glpk-4.57/doc/glpk12.tex

BIN
resources/3rdparty/glpk-4.53/doc/gmpl.pdf → resources/3rdparty/glpk-4.57/doc/gmpl.pdf

28
resources/3rdparty/glpk-4.53/doc/gmpl.tex → resources/3rdparty/glpk-4.57/doc/gmpl.tex

@ -4,9 +4,9 @@
% This code is part of GLPK (GNU Linear Programming Kit).
%
% Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
% 2009, 2010, 2011, 2013 Andrew Makhorin, Department for Applied
% Informatics, Moscow Aviation Institute, Moscow, Russia. All rights
% reserved. E-mail: <mao@gnu.org>.
% 2009, 2010, 2011, 2013, 2014, 2015 Andrew Makhorin, Department for
% Applied Informatics, Moscow Aviation Institute, Moscow, Russia. All
% rights reserved. E-mail: <mao@gnu.org>.
%
% GLPK is free software: you can redistribute it and/or modify it
% under the terms of the GNU General Public License as published by
@ -71,12 +71,12 @@ urlcolor=blue]{hyperref}
\vspace{0.5in}
\begin{LARGE}
\sf for GLPK Version 4.50
\sf for GLPK Version 4.57
\end{LARGE}
\vspace{0.5in}
\begin{Large}
\sf (DRAFT, May 2013)
\sf (DRAFT, October 2015)
\end{Large}
\end{center}
@ -93,9 +93,9 @@ GNU.
\noindent
Copyright \copyright{} 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009, 2010, 2011, 2013 Andrew Makhorin, Department for Applied
Informatics, Moscow Aviation Institute, Moscow, Russia. All rights
reserved.
2008, 2009, 2010, 2011, 2013, 2014, 2015 Andrew Makhorin, Department
for Applied Informatics, Moscow Aviation Institute, Moscow, Russia. All
rights reserved.
\noindent
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
@ -1519,7 +1519,7 @@ expressions (see Subsection \ref{hierarchy}, page \pageref{hierarchy}).
\section{Linear expressions}
An {\it linear expression} is a rule for computing so called
A {\it linear expression} is a rule for computing so called
a {\it linear form} or simply a {\it formula}, which is a linear (or
affine) function of elemental variables.
@ -2059,7 +2059,7 @@ the constraint. (Commae following expressions may be omitted.)
s.t. r: x + y + z, >= 0, <= 1;
limit{t in 1..T}: sum{j in prd} make[j,t] <= max_prd;
subject to balance{i in raw, t in 1..T}:
store[i,t+1] - store[i,t] - sum{j in prd} units[i,j] * make[j,t];
store[i,t+1] = store[i,t] - sum{j in prd} units[i,j] * make[j,t];
subject to rlim 'regular-time limit' {t in time}:
sum{p in prd} pt[p] * rprd[p,t] <= 1.3 * dpp[t] * crews[t];
\end{verbatim}
@ -2283,8 +2283,8 @@ evaluated and displayed for every $n$-tuple in the domain set. In the
latter case items may include dummy indices introduced in corresponding
indexing expression.
An item to be displayed can be a model object (set, parameter, v
ariable, constraint, objective) or an expression.
An item to be displayed can be a model object (set, parameter,
variable, constraint, objective) or an expression.
If the item is a computable object (i.e. a set or parameter provided
with the assign attribute), the object is evaluated over the entire
@ -2774,7 +2774,7 @@ colon following the keyword {\tt(tr)} may be omitted.)
set month := Jan Feb Mar Apr May Jun;
set month "Jan", "Feb", "Mar", "Apr", "May", "Jun";
set A[3,Mar] := (1,2) (2,3) (4,2) (3,1) (2,2) (4,4) (3,4);
set A[3,'Mar'] := 1 2 2 3 4 2 3 1 2 2 4 4 2 4;
set A[3,'Mar'] := 1 2 2 3 4 2 3 1 2 2 4 4 3 4;
set A[3,'Mar'] : 1 2 3 4 :=
1 - + - -
2 - + + -
@ -3167,7 +3167,7 @@ following it.
2. Symbolic name $s$ may be omitted along with the colon following it.
3. All comae are optional and may be omitted.
3. All commae are optional and may be omitted.
The data block in the tabbing format shown above is exactly equivalent
to the following data blocks:

BIN
resources/3rdparty/glpk-4.57/doc/gmpl_es.pdf

3233
resources/3rdparty/glpk-4.57/doc/gmpl_es.tex
File diff suppressed because it is too large
View File

0
resources/3rdparty/glpk-4.53/doc/graphs.pdf → resources/3rdparty/glpk-4.57/doc/graphs.pdf

0
resources/3rdparty/glpk-4.53/doc/graphs.tex → resources/3rdparty/glpk-4.57/doc/graphs.tex

0
resources/3rdparty/glpk-4.53/doc/miplib2.txt → resources/3rdparty/glpk-4.57/doc/miplib2.txt

0
resources/3rdparty/glpk-4.53/doc/miplib3.txt → resources/3rdparty/glpk-4.57/doc/miplib3.txt

0
resources/3rdparty/glpk-4.53/doc/netlib.txt → resources/3rdparty/glpk-4.57/doc/netlib.txt

0
resources/3rdparty/glpk-4.53/doc/notes/dfeas.pdf → resources/3rdparty/glpk-4.57/doc/notes/dfeas.pdf

0
resources/3rdparty/glpk-4.53/doc/notes/gomory.pdf → resources/3rdparty/glpk-4.57/doc/notes/gomory.pdf

0
resources/3rdparty/glpk-4.53/doc/notes/keller.pdf → resources/3rdparty/glpk-4.57/doc/notes/keller.pdf

BIN
resources/3rdparty/glpk-4.57/doc/notes/scf.pdf

BIN
resources/3rdparty/glpk-4.57/doc/notes/simplex1.pdf

BIN
resources/3rdparty/glpk-4.57/doc/notes/simplex2.pdf

10
resources/3rdparty/glpk-4.53/examples/INDEX → resources/3rdparty/glpk-4.57/examples/INDEX

@ -1,3 +1,4 @@
alloy.mps Aluminium alloy blending
assign.mod Assignment problem
bpp.mod Bin packing problem
cal.mod Print an ASCII calendar of the given year
@ -14,10 +15,12 @@ egypt.mod A static model for fertilizer production
fctp.mod Fixed-charge transportation problem
food.mod Food manufacture model
food2.mod Food manufacture model
furnace.mps Electric-arc furnace steelmaking
gap.mod Generalized assignment problem
graph.mod Graph visualization
hashi.mod A solver for the Japanese number-puzzle Hashiwokakero
huge.mod Arithmetic mean of a large number of integers
icecream.mps Ice cream blending
jssp.mod Job-shop scheduling problem
magic.mod Magic square
maxcut.mod Maximum cut problem
@ -27,15 +30,18 @@ mfvsp.mod Minimum feedback vertex set problem
min01ks.mod Finding minimal equivalent 0-1 knapsack inequality
misp.mod Maximum independent set problem
money.mod A crypto-arithmetic puzzle
murtagh.mps Oil refinery model
mvcp.mod Minimum vertex cover problem
numbrix.mod Number placement puzzle
pbn/*.* Paint-by-numbers puzzle
plan.mod A simple LP problem
plan.lp A simple LP problem (CPLEX LP format)
plan.mod A simple LP problem (MathProg format)
plan.mps A simple LP problem (MPS format)
prod.mod A multiperiod production model
qfit.mod Quadratic curve fitting solution
queens.mod A classic combinatorial optimization problem
sat.mod Satisfiability problem
shiftcover.mod Workforce shift coverage assignment problem
shiftcov.mod Workforce shift coverage assignment problem
shikaku.mod A solver for the logic puzzle Shikaku
sorting.mod How to sort arrays in MathProg
spp.mod Shortest path problem

0
resources/3rdparty/glpk-4.53/examples/Makefile.am → resources/3rdparty/glpk-4.57/examples/Makefile.am

0
resources/3rdparty/glpk-4.53/examples/Makefile.in → resources/3rdparty/glpk-4.57/examples/Makefile.in

282
resources/3rdparty/glpk-4.57/examples/alloy.mps

@ -0,0 +1,282 @@
*NAME: ALLOY
*ROWS: 22
*COLUMNS: 20
*NONZERO: 203
*OPT SOLN: 2149.247891
*SOURCE: Linear Programming--Aluminium Alloy Blending
* Data Processing Application. N.Y.: IBM Corp.
*APPLICATION: Aluminium Alloy Blending
*COMMENTS: fixed MPS format
* encoded by Andrew Makhorin <mao@gnu.org>
*
NAME ALLOY
ROWS
N COST $ Cost $
G ZN $ Zinc Minimum lbs
L ZX $ Zinc Maximum lbs
G CN $ Copper Minimum lbs
L CX $ Copper Maximum lbs
G MN $ Magnesium Minimum lbs
L MX $ Magnesium Maximum lbs
G CHN $ Chromium Minimum lbs
L CHX $ Chromium Maximum lbs
G BN $ Beryllium Minimum lbs
L BX $ Beryllium Maximum lbs
L IX $ Iron Maximum lbs
L SX $ Silicon Maximum lbs
L MGX $ Manganese Maximum lbs
L NX $ Nickel Maximum lbs
L TX $ Titanium Maximum lbs
L LX $ Lead Maximum lbs
L TNX $ Tin Maximum lbs
L BIX $ Bismuth Maximum lbs
L GX $ General Impurities lbs
L SCX $ Scrap 1 Limit lbs
G FL $ Furnance Load lbs
COLUMNS
* Pure Aluminium 1
A1 COST .28
IX .0004
SX .0005
FL 1.0
* Pure Aluminium 2
A2 COST .26
IX .0006
SX .0006
FL 1.0
* Pure Aluminium 3
A3 COST .25
IX .0011
SX .0007
FL 1.0
* Pure Aluminium 4
A4 COST .23
IX .0026
SX .0012
FL 1.0
* Pure Copper
C COST .31
CN 1.00
CX 1.00
FL 1.0
* Pure Magnesium
M COST .38
MN 1.00
MX 1.00
FL 1.0
* Beryllium/Aluminium Alloy
B/A COST 3.60
BN 0.0600
BX 0.0600
FL 1.0
* Pure Zinc
Z COST .22
ZN .95
ZX .95
FL 1.0
* Chromium Aluminium Alloy
C/A COST .27
CHN .0300
CHX .0300
FL 1.0
* Scrap 1
SC1 COST .21
ZN .0009
ZX .0009
CN .0444
CX .0444
MN .0042
MX .0042
CHN .0001
CHX .0001
IX .0024
SX .0101
MGX .0079
NX .0001
TX .0004
LX .0001
TNX .0001
GX .0001
SCX 1.00
FL 1.0
* Scrap 2
SC2 COST .20
ZN .0012
ZX .0012
CN .0026
CX .0026
MN .0060
MX .0060
CHN .0018
CHX .0018
IX .0026
SX .0106
MGX .0003
NX .0002
TX .0004
LX .0001
TNX .0001
GX .0002
FL 1.0
* Scrap 3
SC3 COST .21
ZN .0568
ZX .0568
CN .0152
CX .0152
MN .0248
MX .0248
CHN .0020
CHX .0020
IX .0016
SX .0013
MGX .0005
TX .0004
LX .0003
TNX .0003
FL 1.0
* Scrap 4
SC4 COST .20
ZN .0563
ZX .0563
CN .0149
CX .0149
MN .0238
MX .0238
CHN .0019
CHX .0019
IX .0019
SX .0011
MGX .0004
TX .0004
LX .0003
TNX .0003
FL 1.0
* Scrap 5
SC5 COST .21
ZN .0460
ZX .0460
CN .0071
CX .0071
MN .0343
MX .0343
CHN .0013
CHX .0013
IX .0017
SX .0013
MGX .0018
TX .0002
LX .0002
TNX .0002
FL 1.0
* Scrap 6
SC6 COST .20
ZN .0455
ZX .0455
CN .0071
CX .0071
MN .0343
MX .0343
IX .0016
SX .0011
MGX .0017
TX .0002
LX .0002
TNX .0002
FL 1.0
* Scrap 7
SC7 COST .21
ZN .0009
ZX .0009
CN .0447
CX .0447
MN .0143
MX .0143
IX .0026
SX .0013
MGX .0052
TX .0003
LX .0001
TNX .0001
FL 1.0
* Scrap 8
SC8 COST .20
ZN .0006
ZX .0006
CN .0623
CX .0623
IX .0017
SX .0010
MGX .0025
TX .0005
LX .0001
TNX .0001
GX .0025
FL 1.0
* Scrap 9
SC9 COST .21
ZN .0009
ZX .0009
CN .0034
CX .0034
MN .0093
MX .0093
CHN .0019
CHX .0019
IX .0030
SX .0062
MGX .0002
TX .0003
BIX .0005
FL 1.0
* Scrap 10
SC10 COST .20
ZN .0008
ZX .0008
CN .0003
CX .0003
MN .0249
MX .0249
CHN .0016
CHX .0016
IX .0015
SX .0011
MGX .0002
FL 1.0
* Scrap 11
SC11 COST .21
ZN .0675
ZX .0675
CN .0195
CX .0195
MN .0265
MX .0265
CHN .0020
CHX .0020
IX .0014
SX .0008
MGX .0002
FL 1.0
RHS
ZN 555.
ZX 590.
CN 140.0
CX 190.0
MN 245.0
MX 275.0
CHN 19.0
CHX 22.0
BN 2.0
BX 4.0
IX 15.0
SX 10.0
MGX 3.0
NX 2.0
TX 2.0
LX 2.0
TNX 2.0
BIX 8.0
GX 8.0
SCX 900.0
FL 10000.
ENDATA

0
resources/3rdparty/glpk-4.53/examples/assign.mod → resources/3rdparty/glpk-4.57/examples/assign.mod

0
resources/3rdparty/glpk-4.53/examples/bpp.mod → resources/3rdparty/glpk-4.57/examples/bpp.mod

0
resources/3rdparty/glpk-4.53/examples/cal.mod → resources/3rdparty/glpk-4.57/examples/cal.mod

0
resources/3rdparty/glpk-4.53/examples/cf12a.mod → resources/3rdparty/glpk-4.57/examples/cf12a.mod

0
resources/3rdparty/glpk-4.53/examples/cf12b.mod → resources/3rdparty/glpk-4.57/examples/cf12b.mod

0
resources/3rdparty/glpk-4.53/examples/cflsq.mod → resources/3rdparty/glpk-4.57/examples/cflsq.mod

0
resources/3rdparty/glpk-4.53/examples/color.mod → resources/3rdparty/glpk-4.57/examples/color.mod

0
resources/3rdparty/glpk-4.53/examples/cplex/README → resources/3rdparty/glpk-4.57/examples/cplex/README

0
resources/3rdparty/glpk-4.53/examples/cplex/concorde.txt → resources/3rdparty/glpk-4.57/examples/cplex/concorde.txt

0
resources/3rdparty/glpk-4.53/examples/cplex/cplex.c → resources/3rdparty/glpk-4.57/examples/cplex/cplex.c

0
resources/3rdparty/glpk-4.53/examples/cplex/cplex.h → resources/3rdparty/glpk-4.57/examples/cplex/cplex.h

0
resources/3rdparty/glpk-4.53/examples/cpp.mod → resources/3rdparty/glpk-4.57/examples/cpp.mod

0
resources/3rdparty/glpk-4.53/examples/crypto.mod → resources/3rdparty/glpk-4.57/examples/crypto.mod

0
resources/3rdparty/glpk-4.53/examples/csv/distances.csv → resources/3rdparty/glpk-4.57/examples/csv/distances.csv

0
resources/3rdparty/glpk-4.53/examples/csv/markets.csv → resources/3rdparty/glpk-4.57/examples/csv/markets.csv

0
resources/3rdparty/glpk-4.53/examples/csv/parameters.csv → resources/3rdparty/glpk-4.57/examples/csv/parameters.csv

0
resources/3rdparty/glpk-4.53/examples/csv/plants.csv → resources/3rdparty/glpk-4.57/examples/csv/plants.csv

0
resources/3rdparty/glpk-4.53/examples/csv/transp_csv.mod → resources/3rdparty/glpk-4.57/examples/csv/transp_csv.mod

0
resources/3rdparty/glpk-4.53/examples/dbf/ForestMgt_Model_I_GIS_dbf.mod → resources/3rdparty/glpk-4.57/examples/dbf/ForestMgt_Model_I_GIS_dbf.mod

0
resources/3rdparty/glpk-4.53/examples/dbf/Forest_Cost.dbf → resources/3rdparty/glpk-4.57/examples/dbf/Forest_Cost.dbf

0
resources/3rdparty/glpk-4.53/examples/dbf/NetRev_Table.dbf → resources/3rdparty/glpk-4.57/examples/dbf/NetRev_Table.dbf

0
resources/3rdparty/glpk-4.53/examples/dbf/README → resources/3rdparty/glpk-4.57/examples/dbf/README

0
resources/3rdparty/glpk-4.53/examples/dbf/TCost_Table.dbf → resources/3rdparty/glpk-4.57/examples/dbf/TCost_Table.dbf

0
resources/3rdparty/glpk-4.53/examples/dbf/Yield_Table_Vol.dbf → resources/3rdparty/glpk-4.57/examples/dbf/Yield_Table_Vol.dbf

0
resources/3rdparty/glpk-4.53/examples/dbf/cultural_pres.dbf → resources/3rdparty/glpk-4.57/examples/dbf/cultural_pres.dbf

0
resources/3rdparty/glpk-4.53/examples/dbf/mgt_year.dbf → resources/3rdparty/glpk-4.57/examples/dbf/mgt_year.dbf

0
resources/3rdparty/glpk-4.53/examples/dbf/stands.dbf → resources/3rdparty/glpk-4.57/examples/dbf/stands.dbf

0
resources/3rdparty/glpk-4.53/examples/dbf/standtype.dbf → resources/3rdparty/glpk-4.57/examples/dbf/standtype.dbf

0
resources/3rdparty/glpk-4.53/examples/dea.mod → resources/3rdparty/glpk-4.57/examples/dea.mod

0
resources/3rdparty/glpk-4.53/examples/diet.mod → resources/3rdparty/glpk-4.57/examples/diet.mod

0
resources/3rdparty/glpk-4.53/examples/dist.mod → resources/3rdparty/glpk-4.57/examples/dist.mod

0
resources/3rdparty/glpk-4.53/examples/egypt.mod → resources/3rdparty/glpk-4.57/examples/egypt.mod

0
resources/3rdparty/glpk-4.53/examples/fctp.mod → resources/3rdparty/glpk-4.57/examples/fctp.mod

0
resources/3rdparty/glpk-4.53/examples/food.mod → resources/3rdparty/glpk-4.57/examples/food.mod

0
resources/3rdparty/glpk-4.53/examples/food2.mod → resources/3rdparty/glpk-4.57/examples/food2.mod

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save