diff --git a/.gitignore b/.gitignore index 88b3f2f47ba85c96fd5d1d4bb2950b3f8b8ebe96..4a7e4d221c1648e17c543175991e3eac20c9db06 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ Build/ _skbuild/ *.egg-info/ dist/ +MANIFEST diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..391ac476dc1e9d7ed5ca52fecf93934f1cee1223 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,100 @@ +stages: + - build + - test + - deploy + + +build_windows: + stage: build + tags: + - windows + - maingo + variables: + GIT_STRATEGY: clone + before_script: + - git submodule init + - git submodule update + script: + - mkdir build + - '$env:path += ";C:\Program Files\cmake\bin"' + - cmake -B build -G "Visual Studio 15 2017" -A x64 -D MAiNGO_build_test=TRUE -D MAiNGO_build_python_interface=TRUE -D MAiNGO_build_parser=false + - cd build + - cmake --build . --config Release -j4 + - cd .. + artifacts: + paths: + - build/Release/ + exclude: + - build/Release/*.lib + - build/Release/**/*.exp + - build/Release/**/*.lib + + +test_windows: + stage: test + needs: [build_windows] + tags: + - windows + - maingo + script: + - cd build\Release + - .\test-maingo.exe + - py testMaingopy.py + + +build_linux: + stage: build + tags: + - linux + variables: + GIT_STRATEGY: clone + before_script: + - echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + - git submodule init + - ./switchToSsh + - git submodule update -j 1 + script: + - mkdir build + - cd build + - cmake -S .. -D MAiNGO_build_test=TRUE -D MAiNGO_build_python_interface=TRUE -D MAiNGO_build_parser=false + - make -j4 + - cd .. + artifacts: + paths: + - build/test-maingo + - build/maingopy/ + - build/testMaingopy.py + - build/individualPythonTests/ + + +test_linux: + stage: test + needs: [build_linux] + tags: + - linux + script: + - cd build + - ./test-maingo + - python3 testMaingopy.py + + +pages: + stage: deploy + needs: + - job: test_windows + artifacts: false + - job: test_linux + artifacts: false + tags: + - linux + script: + - cd doc + - doxygen Doxyfile + - mv html ../public + - cd .. + artifacts: + paths: + - public + only: + - master \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 65756464e24934c880adc097986b8bdc95b6e9a3..f7bdebf0d0e1ab960450b05ba53c5611935e8190 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,51 +1,51 @@ [submodule "dep/filib"] path = dep/filib - url = https://git.rwth-aachen.de/avt.svt/public/thirdparty/filib.git + url = https://git.rwth-aachen.de/avt-svt/public/thirdparty/filib.git [submodule "dep/nlopt"] path = dep/nlopt - url = https://git.rwth-aachen.de/avt.svt/public/thirdparty/nlopt.git + url = https://git.rwth-aachen.de/avt-svt/public/thirdparty/nlopt.git [submodule "dep/fadbad"] path = dep/fadbad - url = https://git.rwth-aachen.de/avt.svt/public/thirdparty/fadbad.git + url = https://git.rwth-aachen.de/avt-svt/public/thirdparty/fadbad.git [submodule "dep/cpplapack"] path = dep/cpplapack - url = https://git.rwth-aachen.de/avt.svt/public/thirdparty/cpplapack.git + url = https://git.rwth-aachen.de/avt-svt/public/thirdparty/cpplapack.git [submodule "dep/ipopt"] path = dep/ipopt - url = https://git.rwth-aachen.de/avt.svt/public/thirdparty/ipopt.git + url = https://git.rwth-aachen.de/avt-svt/public/thirdparty/ipopt.git [submodule "dep/mumps"] path = dep/mumps - url = https://git.rwth-aachen.de/avt.svt/public/thirdparty/mumps.git + url = https://git.rwth-aachen.de/avt-svt/public/thirdparty/mumps.git [submodule "dep/blas"] path = dep/blas - url = https://git.rwth-aachen.de/avt.svt/public/thirdparty/blas.git + url = https://git.rwth-aachen.de/avt-svt/public/thirdparty/blas.git [submodule "dep/lapack"] path = dep/lapack - url = https://git.rwth-aachen.de/avt.svt/public/thirdparty/lapack.git + url = https://git.rwth-aachen.de/avt-svt/public/thirdparty/lapack.git [submodule "dep/knitro"] path = dep/knitro - url = https://git.rwth-aachen.de/avt.svt/public/thirdparty/knitro.git + url = https://git.rwth-aachen.de/avt-svt/public/thirdparty/knitro.git [submodule "dep/cplex"] path = dep/cplex - url = https://git.rwth-aachen.de/avt.svt/public/thirdparty/cplex.git + url = https://git.rwth-aachen.de/avt-svt/public/thirdparty/cplex.git [submodule "dep/clp"] path = dep/clp - url = https://git.rwth-aachen.de/avt.svt/public/thirdparty/clp.git + url = https://git.rwth-aachen.de/avt-svt/public/thirdparty/clp.git [submodule "dep/json"] path = dep/json - url = https://git.rwth-aachen.de/avt.svt/public/thirdparty/json.git + url = https://git.rwth-aachen.de/avt-svt/public/thirdparty/json.git [submodule "dep/pybind11"] path = dep/pybind11 url = https://github.com/pybind/pybind11 -[submodule "dep/babbase"] - path = dep/babbase - url = https://git.rwth-aachen.de/avt.svt/public/babbase.git -[submodule "dep/melon"] - path = dep/melon - url = https://git.rwth-aachen.de/avt.svt/public/melon.git [submodule "dep/libale"] path = dep/libale - url = https://git.rwth-aachen.de/avt.svt/public/libale.git + url = https://git.rwth-aachen.de/avt-svt/public/libale.git +[submodule "dep/melon"] + path = dep/melon + url = https://git.rwth-aachen.de/avt-svt/public/melon.git +[submodule "dep/babbase"] + path = dep/babbase + url = https://git.rwth-aachen.de/avt-svt/public/babbase.git [submodule "dep/mcpp"] path = dep/mcpp - url = https://git.rwth-aachen.de/avt.svt/public/thirdparty/mcpp.git + url = https://git.rwth-aachen.de/avt-svt/public/thirdparty/mcpp.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 79e354526072c9077f82f9f40b722d21e7c72ad6..3b6da7b89a578c1c978b2230ed62b968ffba7a9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,45 +1,69 @@ cmake_minimum_required(VERSION 3.15) -project(MAiNGO CXX) +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/MAiNGOversion.cmake) +project(MAiNGO + VERSION ${MAiNGO_VERSION} + LANGUAGES CXX) -#--------------------------- Options -------------------------------- -set(MAiNGO_build_standalone FALSE CACHE BOOL "Build MAiNGO as standalone solver with problem.h.") -set(MAiNGO_build_parser TRUE CACHE BOOL "Build MAiNGO executable with parser (not compatible with Intel compiler due to missing C++17 features).") -set(MAiNGO_build_python_interface FALSE CACHE BOOL "Build a Python extension module for calling MAiNGO from Python.") -set(MAiNGO_build_test FALSE CACHE BOOL "Build MAiNGO test cases.") -set(MAiNGO_use_melon TRUE CACHE BOOL "Build MAiNGO executable with the MeLOn toolbox (not compatible with Intel compiler due to missing C++17 features).") +#--------------------------- Settings -------------------------------- +set(MAiNGO_use_melon TRUE CACHE BOOL "Build MAiNGO executable with the MeLOn toolbox.") set(MAiNGO_use_cplex TRUE CACHE BOOL "Use CPLEX if it is available on the system.") set(MAiNGO_use_knitro TRUE CACHE BOOL "Use KNITRO if it is available on the system.") set(MAiNGO_use_mpi FALSE CACHE BOOL "Build parallel version of MAiNGO.") +set(MAiNGO_build_python_interface FALSE CACHE BOOL "Build the Python package 'maingopy' that allows to call MAiNGO from Python.") +set(MAiNGO_build_standalone FALSE CACHE BOOL "Build MAiNGOcpp executable as standalone solver with problem.h.") +if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) + set(MAiNGO_build_parser TRUE CACHE BOOL "Build MAiNGO executable with parser.") + set(MAiNGO_build_test TRUE CACHE BOOL "Build MAiNGO test cases.") +else() + set(MAiNGO_build_parser FALSE CACHE BOOL "Build MAiNGO executable with parser.") + set(MAiNGO_build_test FALSE CACHE BOOL "Build MAiNGO test cases.") +endif() -#------------------------ MAiNGO library ----------------------------- -include(${PROJECT_SOURCE_DIR}/cmake/MAiNGOsourceFiles.cmake) +#------------------------ Adjust settings when building with scikit-build ----------------------------- if(SKBUILD) message(STATUS "The project is built using scikit-build, also building Python interface.") + # Enforce use of Python interface set(MAiNGO_build_python_interface TRUE CACHE INTERNAL "" FORCE) - set(MAiNGO_use_cplex FALSE CACHE INTERNAL "" FORCE) - set(MAiNGO_use_knitro FALSE CACHE INTERNAL "" FORCE) + # Default: disable use of CPLEX and KNITRO + message(STATUS "Not using CPLEX and KNITRO even if they are available. If you still want to use them, you need to explicitly enable the corresponding CMake options.") + set(MAiNGO_use_cplex FALSE CACHE BOOL "Use CPLEX if it is available on the system." FORCE) + set(MAiNGO_use_knitro FALSE CACHE BOOL "Use KNITRO if it is available on the system." FORCE) + # Disable stuff that is not compatible with the Python package to be installed set(MAiNGO_use_mpi FALSE CACHE INTERNAL "" FORCE) set(MAiNGO_build_standalone FALSE CACHE INTERNAL "" FORCE) set(MAiNGO_build_parser FALSE CACHE INTERNAL "" FORCE) - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - set(BUILD_SHARED_LIBS FALSE CACHE INTERNAL "" FORCE) + set(MAiNGO_build_test FALSE CACHE INTERNAL "" FORCE) set(BLAS_usePrecompiledDll FALSE CACHE INTERNAL "" FORCE) set(LAPACK_usePrecompiledDlls FALSE CACHE INTERNAL "" FORCE) set(MUMPS_usePrecompiledDll FALSE CACHE INTERNAL "" FORCE) + # Force required settings + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + set(BUILD_SHARED_LIBS FALSE CACHE INTERNAL "" FORCE) endif() if(MAiNGO_build_python_interface) # if building the python interface, the generated module needs PIC, even if building static libraries set(CMAKE_POSITION_INDEPENDENT_CODE ON) endif() + + +#------------------------ MAiNGO library ----------------------------- +include(${PROJECT_SOURCE_DIR}/cmake/MAiNGOsourceFiles.cmake) add_library(maingo-core ${MAiNGO_SRC}) if(WIN32 AND BUILD_SHARED_LIBS) set_target_properties(maingo-core PRIVATE WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() -target_include_directories(maingo-core PUBLIC ${PROJECT_SOURCE_DIR}/inc) +configure_file(${PROJECT_SOURCE_DIR}/inc/version.h.in maingo-core/version.h) +target_include_directories(maingo-core + PUBLIC + ${PROJECT_SOURCE_DIR}/inc + PRIVATE + ${CMAKE_CURRENT_BINARY_DIR}/maingo-core + ) + target_compile_features(maingo-core PRIVATE cxx_std_14) if(MSVC) target_compile_options(maingo-core PRIVATE /MP;/Qpar) @@ -69,9 +93,6 @@ target_link_libraries(maingo-core ipopt clp ) -if(MAiNGO_use_melon) - target_link_libraries(maingo-core PUBLIC melon) -endif() if(MAiNGO_build_parser) add_library(parser STATIC ${PARSER_SRC}) target_include_directories(parser PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/inc) @@ -80,6 +101,9 @@ if(MAiNGO_build_parser) target_link_libraries(maingo-core PUBLIC parser) target_compile_definitions(maingo-core PUBLIC HAVE_MAiNGO_PARSER) endif() +if(MAiNGO_use_melon) + target_link_libraries(maingo-core PUBLIC melon) +endif() if(MAiNGO_use_knitro) # knitro always needs to be linked after all other math-related libraries because of incompatibility with several math routines target_link_libraries(maingo-core PRIVATE knitro) @@ -92,7 +116,7 @@ if(MAiNGO_use_mpi) endif() -#----------------- If this is the top level, include dependencies and build executable -------------------- +#----------------- If this is the top level, include dependencies -------------------- if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) # --------------- Dependencies --------------------------- @@ -112,10 +136,6 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) add_dependency_subdir(nlopt) add_dependency_subdir(clp) add_dependency_subdir(filib) - if(MAiNGO_use_melon) - add_dependency_subdir(melon) - add_dependency_subdir(json) - endif() if(MAiNGO_build_parser) add_dependency_subdir(libale) endif() @@ -135,6 +155,13 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) endif() add_dependency_subdir(pybind11) endif() + if(MAiNGO_use_melon) # Melon needs to go after pybind11, since it's CMakeLists.txt need pybind11_add_module if using the Python interface of MeLOn + if(MAiNGO_build_python_interface) + set(MeLOn_build_python_interface TRUE CACHE BOOL "" FORCE) + endif() + add_dependency_subdir(melon) + add_dependency_subdir(json) + endif() message("Done configuring dependencies.") message("=================================================================") message("=================================================================") @@ -146,135 +173,173 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) # --------- Setup the Executable/.dll output Directory ------------- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} CACHE PATH "Single Directory for all Executables.") - # --------------- MAiNGO executable (using ALE parser) --------------------------- - if (MAiNGO_build_parser) - add_executable(MAiNGO ${PROJECT_SOURCE_DIR}/examples/mainAleParser.cpp) - target_link_libraries(MAiNGO PRIVATE maingo-core) - target_compile_features(MAiNGO PRIVATE cxx_std_17) - if(MSVC) - target_compile_options(MAiNGO PRIVATE /MP;/Qpar) - set_target_properties(MAiNGO PROPERTIES LINK_FLAGS /ignore:4099) #/ignore:4099 disables annoying linker warning because cplex does not provide debugging information - else() - target_compile_options(MAiNGO - PRIVATE - $<$: $<$>:-O3> $<$:-O0>> - $<$: $<$>:-O3> $<$:-O0>> - $<$: $<$>:-O3> $<$:-O0>> - $<$: $<$>:-O3> $<$:-O0>> - ) - endif() +endif() + + + +# --------------- MAiNGO executable (using ALE parser) --------------------------- +if (MAiNGO_build_parser) + + add_executable(MAiNGO ${PROJECT_SOURCE_DIR}/examples/mainAleParser.cpp) + target_link_libraries(MAiNGO PRIVATE maingo-core) + target_compile_features(MAiNGO PRIVATE cxx_std_17) + if(MSVC) + target_compile_options(MAiNGO PRIVATE /MP;/Qpar) + set_target_properties(MAiNGO PROPERTIES LINK_FLAGS /ignore:4099) #/ignore:4099 disables annoying linker warning because cplex does not provide debugging information + else() + target_compile_options(MAiNGO + PRIVATE + $<$: $<$>:-O3> $<$:-O0>> + $<$: $<$>:-O3> $<$:-O0>> + $<$: $<$>:-O3> $<$:-O0>> + $<$: $<$>:-O3> $<$:-O0>> + ) endif() - # --------------- Standalone MAiNGO executable (for C++ API) --------------------------- - if (MAiNGO_build_standalone) - add_executable(MAiNGOcpp ${PROJECT_SOURCE_DIR}/examples/mainCppApi.cpp) - target_link_libraries(MAiNGOcpp PRIVATE maingo-core) - target_compile_features(MAiNGOcpp PRIVATE cxx_std_14) - if(MSVC) - target_compile_options(MAiNGOcpp PRIVATE /MP;/Qpar) - set_target_properties(MAiNGOcpp PROPERTIES LINK_FLAGS /ignore:4099) #/ignore:4099 disables annoying linker warning because cplex does not provide debugging information - else() - target_compile_options(MAiNGOcpp - PRIVATE - $<$: $<$>:-O3> $<$:-O0>> - $<$: $<$>:-O3> $<$:-O0>> - $<$: $<$>:-O3> $<$:-O0>> - $<$: $<$>:-O3> $<$:-O0>> - ) - endif() +endif() + +# --------------- Standalone MAiNGO executable (for C++ API) --------------------------- +if (MAiNGO_build_standalone) + + add_executable(MAiNGOcpp ${PROJECT_SOURCE_DIR}/examples/mainCppApi.cpp) + target_link_libraries(MAiNGOcpp PRIVATE maingo-core) + target_compile_features(MAiNGOcpp PRIVATE cxx_std_14) + if(MSVC) + target_compile_options(MAiNGOcpp PRIVATE /MP;/Qpar) + set_target_properties(MAiNGOcpp PROPERTIES LINK_FLAGS /ignore:4099) #/ignore:4099 disables annoying linker warning because cplex does not provide debugging information + else() + target_compile_options(MAiNGOcpp + PRIVATE + $<$: $<$>:-O3> $<$:-O0>> + $<$: $<$>:-O3> $<$:-O0>> + $<$: $<$>:-O3> $<$:-O0>> + $<$: $<$>:-O3> $<$:-O0>> + ) endif() - # --------------- Python interface --------------------------- - if(MAiNGO_build_python_interface) - if(MSVC) - set(RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Debug) - set(RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Release) - else() - set(RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}) - set(RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}) - endif() - pybind11_add_module(_pymaingo pymaingo/_pymaingo.cpp) - target_compile_features(_pymaingo PRIVATE cxx_std_14) - target_link_libraries(_pymaingo PRIVATE maingo-core) - target_compile_options(_pymaingo PRIVATE $<$: -fvisibility=default>) - if(SKBUILD) - install(TARGETS maingo-core DESTINATION . ) - install(TARGETS _pymaingo DESTINATION .) - else() - set_target_properties(_pymaingo PROPERTIES - LIBRARY_OUTPUT_DIRECTORY $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/pymaingo - ) - add_custom_target(pymaingo ALL - COMMAND ${CMAKE_COMMAND} -E make_directory - $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/pymaingo - COMMAND ${CMAKE_COMMAND} -E copy - ${PROJECT_SOURCE_DIR}/pymaingo/__init__.py - $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/pymaingo - ) - if(${BLAS_usePrecompiledDll}) - add_custom_target(copyBlasDllPymaingo ALL - COMMAND ${CMAKE_COMMAND} -E copy - $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}/blasd.dll>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}/blas.dll> - $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}/pymaingo/blasd.dll>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}/pymaingo/blas.dll>) - add_dependencies(copyBlasDllPymaingo copyBlasDll) - endif() - if(${LAPACK_usePrecompiledDlls}) - add_custom_target(copyLapackDllPymaingo ALL - COMMAND ${CMAKE_COMMAND} -E copy - $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}/lapackd.dll>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}/lapack.dll> - $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}/pymaingo/lapackd.dll>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}/pymaingo/lapack.dll>) - add_dependencies(copyLapackDllPymaingo copyLapackDll) - endif() - if(${MUMPS_usePrecompiledDll}) - add_custom_target(copyMumpsDllPymaingo ALL - COMMAND ${CMAKE_COMMAND} -E copy - $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}/mumpsd.dll>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}/mumps.dll> - $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}/pymaingo/mumpsd.dll>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}/pymaingo/mumps.dll>) - add_dependencies(copyMumpsDllPymaingo copyMumpsDll) - endif() - endif() +endif() + +# --------------- Python interface --------------------------- +if(MAiNGO_build_python_interface) + + # Get output directories right + if(MSVC) + set(RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Debug) + set(RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Release) + else() + set(RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}) + set(RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}) endif() + # Create target for _maingopy extension module + pybind11_add_module(_maingopy maingopy/_maingopy.cpp) + target_compile_features(_maingopy PRIVATE cxx_std_14) + target_link_libraries(_maingopy PRIVATE maingo-core) + target_compile_options(_maingopy PRIVATE $<$: -fvisibility=default>) - # --------------- MAiNGO Tests --------------------------- - if(MAiNGO_build_test) - add_executable(test-maingo ${PROJECT_SOURCE_DIR}/tests/testProblems/main.cpp) - target_link_libraries(test-maingo PRIVATE maingo-core) - target_compile_features(test-maingo PRIVATE cxx_std_17) - if(MSVC) - target_compile_options(test-maingo PRIVATE /MP;/Qpar) - set_target_properties(test-maingo PROPERTIES LINK_FLAGS /ignore:4099) #/ignore:4099 disables annoying linker warning because cplex does not provide debugging information + # Create target for maingopy package + if(SKBUILD) + install(TARGETS maingo-core DESTINATION . ) + install(TARGETS _maingopy DESTINATION .) + if(MAiNGO_use_melon AND MeLOn_build_python_interface) + install(TARGETS melonpy DESTINATION .) + install(FILES ${PROJECT_SOURCE_DIR}/maingopy/__init__maingopy_and_melonpy.py.in DESTINATION . RENAME __init__.py) else() - target_compile_options(test-maingo - PRIVATE - $<$: $<$>:-O3> $<$:-O0>> - $<$: $<$>:-O3> $<$:-O0>> - $<$: $<$>:-O3> $<$:-O0>> - $<$: $<$>:-O3> $<$:-O0>> - ) endif() - - if (MAiNGO_build_python_interface) - set(PYTHON_TEST_DIR ${PROJECT_SOURCE_DIR}/pymaingo/tests) - add_custom_target(test-pymaingo ALL - COMMAND ${CMAKE_COMMAND} -E copy - ${PYTHON_TEST_DIR}/testPyMAiNGO.py - $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}> + else() + set_target_properties(_maingopy PROPERTIES + LIBRARY_OUTPUT_DIRECTORY $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/maingopy + ARCHIVE_OUTPUT_DIRECTORY $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/maingopy + ) + if(MAiNGO_use_melon AND MeLOn_build_python_interface) + set_target_properties(melonpy PROPERTIES + LIBRARY_OUTPUT_DIRECTORY $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/maingopy + ARCHIVE_OUTPUT_DIRECTORY $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/maingopy + ) + add_custom_target(maingopy ALL COMMAND ${CMAKE_COMMAND} -E make_directory - $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/individualPythonTests + $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/maingopy COMMAND ${CMAKE_COMMAND} -E copy - ${PYTHON_TEST_DIR}/individualPythonTests/testEvaluationContainer.py - ${PYTHON_TEST_DIR}/individualPythonTests/testIntrinsicFunctions.py - ${PYTHON_TEST_DIR}/individualPythonTests/testMAiNGOmodel.py - ${PYTHON_TEST_DIR}/individualPythonTests/testOptimizationVariables.py - ${PYTHON_TEST_DIR}/individualPythonTests/testSolver.py - ${PYTHON_TEST_DIR}/individualPythonTests/__init__.py - $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/individualPythonTests + ${PROJECT_SOURCE_DIR}/maingopy/__init__maingopy_and_melonpy.py.in + $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/maingopy/__init__.py + ) + add_dependencies(melonpy maingopy) + add_dependencies(_maingopy maingopy) + else() + add_custom_target(maingopy ALL + COMMAND ${CMAKE_COMMAND} -E make_directory + $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/maingopy COMMAND ${CMAKE_COMMAND} -E copy - ${PROJECT_SOURCE_DIR}/examples/MAiNGOSettings.txt - $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/individualPythonTests + ${PROJECT_SOURCE_DIR}/maingopy/__init__only_maingopy.py.in + $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/maingopy/__init__.py ) + add_dependencies(_maingopy maingopy) + endif() + if(${BLAS_usePrecompiledDll}) + add_custom_target(copyBlasDllmaingopy ALL + COMMAND ${CMAKE_COMMAND} -E copy + $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}/blasd.dll>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}/blas.dll> + $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}/maingopy/blasd.dll>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}/maingopy/blas.dll>) + add_dependencies(copyBlasDllmaingopy copyBlasDll melonpy) + endif() + if(${LAPACK_usePrecompiledDlls}) + add_custom_target(copyLapackDllmaingopy ALL + COMMAND ${CMAKE_COMMAND} -E copy + $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}/lapackd.dll>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}/lapack.dll> + $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}/maingopy/lapackd.dll>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}/maingopy/lapack.dll>) + add_dependencies(copyLapackDllmaingopy copyLapackDll melonpy) + endif() + if(${MUMPS_usePrecompiledDll}) + add_custom_target(copyMumpsDllmaingopy ALL + COMMAND ${CMAKE_COMMAND} -E copy + $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}/mumpsd.dll>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}/mumps.dll> + $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}/maingopy/mumpsd.dll>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}/maingopy/mumps.dll>) + add_dependencies(copyMumpsDllmaingopy copyMumpsDll melonpy) endif() endif() endif() + + +# --------------- MAiNGO Tests --------------------------- +if(MAiNGO_build_test) + + add_executable(test-maingo ${PROJECT_SOURCE_DIR}/tests/testProblems/main.cpp) + target_link_libraries(test-maingo PRIVATE maingo-core) + target_compile_features(test-maingo PRIVATE cxx_std_17) + if(MSVC) + target_compile_options(test-maingo PRIVATE /MP;/Qpar) + set_target_properties(test-maingo PROPERTIES LINK_FLAGS /ignore:4099) #/ignore:4099 disables annoying linker warning because cplex does not provide debugging information + else() + target_compile_options(test-maingo + PRIVATE + $<$: $<$>:-O3> $<$:-O0>> + $<$: $<$>:-O3> $<$:-O0>> + $<$: $<$>:-O3> $<$:-O0>> + $<$: $<$>:-O3> $<$:-O0>> + ) + endif() + + if (MAiNGO_build_python_interface) + set(PYTHON_TEST_DIR ${PROJECT_SOURCE_DIR}/maingopy/tests) + add_custom_target(test-maingopy ALL + COMMAND ${CMAKE_COMMAND} -E copy + ${PYTHON_TEST_DIR}/testMaingopy.py + $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}> + COMMAND ${CMAKE_COMMAND} -E make_directory + $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/individualPythonTests + COMMAND ${CMAKE_COMMAND} -E copy + ${PYTHON_TEST_DIR}/individualPythonTests/testEvaluationContainer.py + ${PYTHON_TEST_DIR}/individualPythonTests/testIntrinsicFunctions.py + ${PYTHON_TEST_DIR}/individualPythonTests/testMAiNGOmodel.py + ${PYTHON_TEST_DIR}/individualPythonTests/testOptimizationVariables.py + ${PYTHON_TEST_DIR}/individualPythonTests/testSolver.py + ${PYTHON_TEST_DIR}/individualPythonTests/__init__.py + $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/individualPythonTests + COMMAND ${CMAKE_COMMAND} -E copy + ${PROJECT_SOURCE_DIR}/examples/MAiNGOSettings.txt + $<$:${RUNTIME_OUTPUT_DIRECTORY_DEBUG}>$<$>:${RUNTIME_OUTPUT_DIRECTORY_RELEASE}>/individualPythonTests + ) + endif() + +endif() \ No newline at end of file diff --git a/LICENSE b/LICENSE index e23ece2c852415800ac224b74ede6c5849f6f88d..e9cbe49bbae119348be416854653f7f33b760624 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,30 @@ +The code of MAiNGO is licensed under the Eclipse Public License v2.0 (EPL 2.0). + +MAiNGO uses several third-party libraries by various authors. +Note that these do not allow using MAiNGO in conjunction with these libraries in commercial software. + +For full details, please see the COPYING, COPYRIGHT, README, and AUTHOR files +in the repositories linked at https://git.rwth-aachen.de/avt.svt/public/maingo/-/tree/master/dep. + +As brief summary, the open-source libraries (partially) distributed with +source or binary distributions of MAiNGO are licensed under the following licenses: +- babbase, libale & MeLOn: EPL 2.0 +- MC++, IPOPT, CLP: EPL 1.0 +- Filib++, NLopt, cpplapack: LGPL +- json: MIT +- MUMPS: CeCILL-C +- pybind11, netlib LAPACK: Modified BSD +- netlib BLAS, fadbad++: own licenses + +The coyprights and license terms are given below. + + +------------------------------------------------------------------------------------------------------ + +MAiNGO, babbase, libale, & MeLOn: + +Copyright (c) 2017-2020 Process Systems Engineering (AVT.SVT), RWTH Aachen University + Eclipse Public License - v 2.0 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE @@ -261,8 +288,8 @@ No third-party beneficiary rights are created under this Agreement. Exhibit A - Form of Secondary Licenses Notice -"This Source Code may also be made available under the following -Secondary Licenses when the conditions for such availability set forth +"This Source Code may also be made available under the following +Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), version(s), and exceptions or additional permissions here}." @@ -274,4 +301,1257 @@ version(s), and exceptions or additional permissions here}." file in a relevant directory) where a recipient would be likely to look for such a notice. - You may add additional accurate notices of copyright ownership. \ No newline at end of file + You may add additional accurate notices of copyright ownership. + + +------------------------------------------------------------------------------------------------------ + +MC++: + +Copyright (C) 2009-2017 Benoit Chachuat, Imperial College London. + + +Eclipse Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + +a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and + +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and + +iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and + +b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the Program. + +Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. + + +------------------------------------------------------------------------------------------------------ + +IPOPT: + +Copyright (C) 2004, 2006 International Business Machines and others. + +Eclipse Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + +a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and + +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and + +iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and + +b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the Program. + +Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. + + + +------------------------------------------------------------------------------------------------------ + +CLP: + +Copyright (c) 2002 International Business Machines + +Eclipse Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE +PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION +OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + + a) in the case of the initial Contributor, the initial code and + documentation distributed under this Agreement, and + + b) in the case of each subsequent Contributor: + + i) changes to the Program, and + + ii) additions to the Program; + + where such changes and/or additions to the Program originate + from and are distributed by that particular Contributor. A + Contribution 'originates' from a Contributor if it was added to + the Program by such Contributor itself or anyone acting on such + Contributor's behalf. Contributions do not include additions to + the Program which: (i) are separate modules of software + distributed in conjunction with the Program under their own + license agreement, and (ii) are not derivative works of the + Program. + +"Contributor" means any person or entity that distributes the +Program. + +"Licensed Patents" mean patent claims licensable by a Contributor +which are necessarily infringed by the use or sale of its +Contribution alone or when combined with the Program. + +"Program" means the Contributions distributed in accordance with +this Agreement. + +"Recipient" means anyone who receives the Program under this +Agreement, including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby +grants Recipient a non-exclusive, worldwide, royalty-free copyright +license to reproduce, prepare derivative works of, publicly display, +publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and +object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby +grants Recipient a non-exclusive, worldwide, royalty-free patent +license under Licensed Patents to make, use, sell, offer to sell, +import and otherwise transfer the Contribution of such Contributor, +if any, in source code and object code form. This patent license +shall apply to the combination of the Contribution and the Program +if, at the time the Contribution is added by the Contributor, such +addition of the Contribution causes such combination to be covered +by the Licensed Patents. The patent license shall not apply to any +other combinations which include the Contribution. No hardware per +se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the +licenses to its Contributions set forth herein, no assurances are +provided by any Contributor that the Program does not infringe the +patent or other intellectual property rights of any other +entity. Each Contributor disclaims any liability to Recipient for +claims brought by any other entity based on infringement of +intellectual property rights or otherwise. As a condition to +exercising the rights and licenses granted hereunder, each Recipient +hereby assumes sole responsibility to secure any other intellectual +property rights needed, if any. For example, if a third party patent +license is required to allow Recipient to distribute the Program, it +is Recipient's responsibility to acquire that license before +distributing the Program. + +d) Each Contributor represents that to its knowledge it has +sufficient copyright rights in its Contribution, if any, to grant +the copyright license set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code +form under its own license agreement, provided that: + + a) it complies with the terms and conditions of this Agreement; + and + + b) its license agreement: + + i) effectively disclaims on behalf of all Contributors all + warranties and conditions, express and implied, including + warranties or conditions of title and non-infringement, and + implied warranties or conditions of merchantability and + fitness for a particular purpose; + + ii) effectively excludes on behalf of all Contributors all + liability for damages, including direct, indirect, special, + incidental and consequential damages, such as lost profits; + + iii) states that any provisions which differ from this + Agreement are offered by that Contributor alone and not by + any other party; and + + iv) states that source code for the Program is available + from such Contributor, and informs licensees how to obtain + it in a reasonable manner on or through a medium customarily + used for software exchange. + +When the Program is made available in source code form: + + a) it must be made available under this Agreement; and + + b) a copy of this Agreement must be included with each copy of + the Program. + +Contributors may not remove or alter any copyright notices contained +within the Program. + +Each Contributor must identify itself as the originator of its +Contribution, if any, in a manner that reasonably allows subsequent +Recipients to identify the originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain +responsibilities with respect to end users, business partners and +the like. While this license is intended to facilitate the +commercial use of the Program, the Contributor who includes the +Program in a commercial product offering should do so in a manner +which does not create potential liability for other +Contributors. Therefore, if a Contributor includes the Program in a +commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages +and costs (collectively "Losses") arising from claims, lawsuits and +other legal actions brought by a third party against the Indemnified +Contributor to the extent caused by the acts or omissions of such +Commercial Contributor in connection with its distribution of the +Program in a commercial product offering. The obligations in this +section do not apply to any claims or Losses relating to any actual +or alleged intellectual property infringement. In order to qualify, +an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial +Contributor to control, and cooperate with the Commercial +Contributor in, the defense and any related settlement +negotiations. The Indemnified Contributor may participate in any +such claim at its own expense. + +For example, a Contributor might include the Program in a commercial +product offering, Product X. That Contributor is then a Commercial +Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance +claims and warranties are such Commercial Contributor's +responsibility alone. Under this section, the Commercial Contributor +would have to defend claims against the other Contributors related +to those performance claims and warranties, and if a court requires +any other Contributor to pay any damages as a result, the Commercial +Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS +PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, +ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient +is solely responsible for determining the appropriateness of using +and distributing the Program and assumes all risks associated with +its exercise of rights under this Agreement , including but not +limited to the risks and costs of program errors, compliance with +applicable laws, damage to or loss of data, programs or equipment, +and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT +NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS +GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability +of the remainder of the terms of this Agreement, and without further +action by the parties hereto, such provision shall be reformed to +the minimum extent necessary to make such provision valid and +enforceable. + +If Recipient institutes patent litigation against any entity +(including a cross-claim or counterclaim in a lawsuit) alleging that +the Program itself (excluding combinations of the Program with other +software or hardware) infringes such Recipient's patent(s), then +such Recipient's rights granted under Section 2(b) shall terminate +as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it +fails to comply with any of the material terms or conditions of this +Agreement and does not cure such failure in a reasonable period of +time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use +and distribution of the Program as soon as reasonably +practicable. However, Recipient's obligations under this Agreement +and any licenses granted by Recipient relating to the Program shall +continue and survive. + +Everyone is permitted to copy and distribute copies of this +Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The +Agreement Steward reserves the right to publish new versions +(including revisions) of this Agreement from time to time. No one +other than the Agreement Steward has the right to modify this +Agreement. The Eclipse Foundation is the initial Agreement +Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each +new version of the Agreement will be given a distinguishing version +number. The Program (including Contributions) may always be +distributed subject to the version of the Agreement under which it +was received. In addition, after a new version of the Agreement is +published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as +expressly stated in Sections 2(a) and 2(b) above, Recipient receives +no rights or licenses to the intellectual property of any +Contributor under this Agreement, whether expressly, by implication, +estoppel or otherwise. All rights in the Program not expressly +granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and +the intellectual property laws of the United States of America. No +party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each +party waives its rights to a jury trial in any resulting litigation. + + + +------------------------------------------------------------------------------------------------------ + +Filib++: + +/* +** fi_lib++ --- A fast interval library (Version 3.0) +** +** Copyright (C) 2001: +** +** Werner Hofschuster, Walter Kraemer +** Wissenschaftliches Rechnen/Softwaretechnologie (WRSWT) +** Universitaet Wuppertal, Germany +** Michael Lerch, German Tischler, Juergen Wolff von Gudenberg +** Institut fuer Informatik +** Universitaet Wuerzburg, Germany +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Library General Public +** License as published by the Free Software Foundation; either +** version 2 of the License, or (at your option) any later version. +** +** This library 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 +** Library General Public License for more details. +** +** You should have received a copy of the GNU Library General Public +** License along with this library; if not, write to the Free +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + + +------------------------------------------------------------------------------------------------------ + +NLopt: + +NLopt combines several free/open-source nonlinear optimization +libraries by various authors. See the COPYING, COPYRIGHT, and README +files in the subdirectories for the original copyright and licensing +information of these packages. + +The compiled NLopt library, i.e. the combined work of all of the +included optimization routines, is licensed under the conjunction of +all of these licensing terms. Currently, the most restrictive terms +are for the code in the "luksan" directory, which is licensed under +the GNU Lesser General Public License (GNU LGPL), version 2.1 or +later (see luksan/COPYRIGHT). + +That means that the compiled NLopt library is governed by the terms of +the LGPL. + +Other portions of NLopt, including any modifications to the abovementioned +packages, are licensed under the standard "MIT License:" + +Copyright (c) 2007-2011 Massachusetts Institute of Technology + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +------------------------------------------------------------------------------------------------------ + +json: + +Copyright (c) 2013-2019 Niels Lohmann + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +------------------------------------------------------------------------------------------------------ + +MUMPS: + + Copyright 1991-2020 CERFACS, CNRS, ENS Lyon, INP Toulouse, Inria, + Mumps Technologies, University of Bordeaux. + + This version of MUMPS is provided to you free of charge. It is + released under the CeCILL-C license, + http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.html, + except for the external and optional ordering PORD, + in separate directory PORD, which is public domain (see PORD/README). + + You can acknowledge (using references [1] and [2]) the contribution of + this package in any scientific publication dependent upon the use of + the package. Please use reasonable endeavours to notify the authors + of the package of this publication. + + [1] P. R. Amestoy, I. S. Duff, J. Koster and J.-Y. L'Excellent, + A fully asynchronous multifrontal solver using distributed dynamic + scheduling, SIAM Journal on Matrix Analysis and Applications, + Vol 23, No 1, pp 15-41 (2001). + + [2] P. R. Amestoy, A. Buttari, J.-Y. L'Excellent and T. Mary, + Performance and scalability of the block low-rank multifrontal + factorization on multicore architectures, + ACM Transactions on Mathematical Software, + Vol 45, Issue 1, pp 2:1-2:26 (2019) + + As a counterpart to the access to the source code and rights to copy, + modify and redistribute granted by the license, users are provided only + with a limited warranty and the software's author, the holder of the + economic rights, and the successive licensors have only limited + liability. + + In this respect, the user's attention is drawn to the risks associated + with loading, using, modifying and/or developing or reproducing the + software by the user in light of its specific status of free software, + that may mean that it is complicated to manipulate, and that also + therefore means that it is reserved for developers and experienced + professionals having in-depth computer knowledge. Users are therefore + encouraged to load and test the software's suitability as regards their + requirements in conditions enabling the security of their systems and/or + data to be ensured and, more generally, to use and operate it in the + same conditions as regards security. + + The fact that you are presently reading this means that you have had + knowledge of the CeCILL-C license and that you accept its terms. + + + +------------------------------------------------------------------------------------------------------ + +pybind11: + +Copyright (c) 2016 Wenzel Jakob , All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Please also refer to the file .github/CONTRIBUTING.md, which clarifies licensing of +external contributions to this project including patches, pull requests, etc. + + +------------------------------------------------------------------------------------------------------ + +netlib LAPACK: + +Copyright (c) 1992-2017 The University of Tennessee and The University + of Tennessee Research Foundation. All rights + reserved. +Copyright (c) 2000-2017 The University of California Berkeley. All + rights reserved. +Copyright (c) 2006-2017 The University of Colorado Denver. All rights + reserved. + +$COPYRIGHT$ + +Additional copyrights may follow + +$HEADER$ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer listed + in this license in the documentation and/or other materials + provided with the distribution. + +- Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +The copyright holders provide no reassurances that the source code +provided does not infringe any patent, copyright, or any other +intellectual property rights of third parties. The copyright holders +disclaim any liability to any recipient for claims brought against +recipient by any third party for infringement of that parties +intellectual property rights. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +------------------------------------------------------------------------------------------------------ + +netlib BLAS: + +The reference BLAS is a freely-available software package. It is available from netlib via anonymous ftp and the World Wide Web. Thus, it can be included in commercial software packages (and has been). We only ask that proper credit be given to the authors. + +Like all software, it is copyrighted. It is not trademarked, but we do ask the following: + + If you modify the source for these routines we ask that you change the name of the routine and comment the changes made to the original. + + We will gladly answer any questions regarding the software. If a modification is done, however, it is the responsibility of the person who modified the routine to provide support. + +Credit Publications/references for the BLAS: + + C. L. Lawson, R. J. Hanson, D. Kincaid, and F. T. Krogh, Basic Linear Algebra Subprograms for FORTRAN usage, ACM Trans. Math. Soft., 5 (1979), pp. 308—323. + + J. J. Dongarra, J. Du Croz, S. Hammarling, and R. J. Hanson, An extended set of FORTRAN Basic Linear Algebra Subprograms, ACM Trans. Math. Soft., 14 (1988), pp. 1—17. + + J. J. Dongarra, J. Du Croz, S. Hammarling, and R. J. Hanson, Algorithm 656: An extended set of FORTRAN Basic Linear Algebra Subprograms, ACM Trans. Math. Soft., 14 (1988), pp. 18—32. + + J. J. Dongarra, J. Du Croz, I. S. Duff, and S. Hammarling, A set of Level 3 Basic Linear Algebra Subprograms, ACM Trans. Math. Soft., 16 (1990), pp. 1—17. + + J. J. Dongarra, J. Du Croz, I. S. Duff, and S. Hammarling, Algorithm 679: A set of Level 3 Basic Linear Algebra Subprograms, ACM Trans. Math. Soft., 16 (1990), pp. 18—28. + +New BLAS + + L. S. Blackford, J. Demmel, J. Dongarra, I. Duff, S. Hammarling, G. Henry, M. Heroux, L. Kaufman, A. Lumsdaine, A. Petitet, R. Pozo, K. Remington, R. C. Whaley, An Updated Set of Basic Linear Algebra Subprograms (BLAS), ACM Trans. Math. Soft., 28-2 (2002), pp. 135—151. + + J. Dongarra, Basic Linear Algebra Subprograms Technical Forum Standard, International Journal of High Performance Applications and Supercomputing, 16(1) (2002), pp. 1—111, and International Journal of High Performance Applications and Supercomputing, 16(2) (2002), pp. 115—199. + + + + +------------------------------------------------------------------------------------------------------ + +fadbad++: + +Copyright (C) 1996-2006 Ole Stauning (fadbad@uning.dk) +All rights reserved. + +This code is provided "as is", without any warranty of any kind, +either expressed or implied, including but not limited to, any implied +warranty of merchantibility or fitness for any purpose. In no event +will any party who distributed the code be liable for damages or for +any claim(s) by any other party, including but not limited to, any +lost profits, lost monies, lost data or data rendered inaccurate, +losses sustained by third parties, or any other special, incidental or +consequential damages arising out of the use or inability to use the +program, even if the possibility of such damages has been advised +against. The entire risk as to the quality, the performance, and the +fitness of the program for any particular purpose lies with the party +using the code. + +This code, and any derivative of this code, may not be used in a +commercial package without the prior explicit written permission of +the authors. Verbatim copies of this code may be made and distributed +in any medium, provided that this copyright notice is not removed or +altered in any way. No fees may be charged for distribution of the +codes, other than a fee to cover the cost of the media and a +reasonable handling fee. + +*************************************************************** +ANY USE OF THIS CODE CONSTITUTES ACCEPTANCE OF THE TERMS OF THE + COPYRIGHT NOTICE +*************************************************************** \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000000000000000000000000000000000000..255cfdf77b0d038dc3cd584fc84c193ebe2ac9ce --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,39 @@ +include setup.py CMakeLists.txt README.md ReleaseNotes.txt AUTHORS LICENSE +graft cmake +graft dep + +exclude dep/*/*/configure* +exclude dep/*/*/*/configure* +prune dep/*/example* +prune dep/*/*/example* +prune dep/*/test* +prune dep/*/*/test* +prune dep/*/doc* +prune dep/*/*/doc* +prune dep/*/*/DOC* +prune dep/*/build +prune dep/*/Build + +prune dep/mumps/precompiled +prune dep/blas/precompiled +prune dep/lapack/precompiled +prune dep/lapack/*/BLAS +prune dep/lapack/*/CBLAS +prune dep/lapack/*/LAPACKE +prune dep/lapack/*/TESTING +prune dep/ipopt/*/ThirdParty +prune dep/clp/*/Data +prune dep/clp/*/ThirdParty +prune dep/clp/*/Osi +prune dep/clp/*/BuildTools +prune dep/clp/*/*/MSVisualStudio +prune dep/filib/*/msvc +prune dep/filib/*/autom4te.cache + +graft examples +graft inc +graft maingopy +graft src +graft tests + +global-exclude .git* diff --git a/Readme.md b/Readme.md index 0e2d0a9df8ba799f0940aa71eeb014027d699c56..85a08a05da1b50b5973332953a8544135d382033 100644 --- a/Readme.md +++ b/Readme.md @@ -1,45 +1,56 @@ # MAiNGO
McCormick-based Algorithm for mixed-integer Nonlinear Global Optimization Thank you for using the beta version of MAiNGO! If you have any issues, concerns, or comments, please communicate them using the ["Issues" -functionality in GitLab](https://git.rwth-aachen.de/avt.svt/public/maingo/-/issues) or send an e-mail to [MAiNGO@avt.rwth-aachen.de](mailto:MAiNGO@avt.rwth-aachen.de). +functionality in GitLab](https://git.rwth-aachen.de/avt-svt/public/maingo/-/issues) or send an e-mail to [MAiNGO@avt.rwth-aachen.de](mailto:MAiNGO@avt.rwth-aachen.de). ## About General information about the capabilities and main algorithmic features of MAiNGO can be found in our technical report available on [our website](http://permalink.avt.rwth-aachen.de/?id=729717). -For a detailed installation guide, description of the algorithm, and a complete list of available options, please clone the repository first and then refer to the documentation found at `doc/html/index.html` in the MAiNGO repository. +For a detailed installation guide, description of the algorithm, and a complete list of available options, please refer to the [MAiNGO documentation](https://avt-svt.pages.rwth-aachen.de/public/maingo). ## Obtaining MAiNGO -The MAiNGO git repository contains submodules for all dependencies. Hence, to obtain MAiNGO, you need to use the following commands (on Windows, you might need to get Git Bash first). +### Via Git - $ git clone https://git.rwth-aachen.de/avt.svt/public/maingo.git +To acess the full functionality of MAiNGO including the C++ API, text-based parser, MPI parallelization and all supported subsolvers, you should obtain the code from this git repository. The MAiNGO repository uses submodules for all dependencies. Hence, to obtain MAiNGO, you need to run the following commands (on Windows, you might need to get Git Bash first). + + $ git clone https://git.rwth-aachen.de/avt-svt/public/maingo.git $ cd $ git submodule init $ git submodule update -j 1 -If you want to switch from between HTTPS (default) and SSH protocols for obtaining the submodules, simply execute the shell scripts (only for Linux or MacOS) `switchToSsh` or `switchToHttps` **after** executing the `git submodule init` command. -For more information on SSH keys, please refer to the git documentation on SSH authentication which can be found under `Help -> SSH authentication` in your GitLab. -If you are having https authentication problems on Windows, please make sure that your credential manager has stored the correct settings. The Windows credential manager can be found at -`Control Panel -> User Accounts -> Manage your credentials`. - If you want to check if the above has worked, you can check that each subfolder in the `dep` folder is non-empty. A note for users more familiar with git: `git submodule update` is executed without the `--recursive` option. -This avoids instantiating any indirect dependencies; in the repository design of MAiNGO, all dependencies (including indirect ones) are present in `dep`. Additionally, it is executed using only one process `-j 1` to avoid input failures. +This avoids instantiating any indirect dependencies; in the repository design of MAiNGO, all dependencies (including indirect ones) are present in `dep`. +Additionally, it is executed using only one process `-j 1` to avoid input failures. -## Updating MAiNGO - -If you want to update to the latest MAiNGO version, use the following git commands +If you have cloned the MAiNGO repository before and want to update to the latest version, use the following git commands $ git pull $ git submodule update -j 1 -If you changed any of the source files in MAiNGO or any dependency found in the dep/ folder, you should restore the original state of MAiNGO and the dependencies by running git stash in the corresponding repository. -Then, update the MAiNGO repository with the git pull and git submodule update commands. Finally, you can retrieve your changes via git stash pop. +### Via PyPI + +If you plan to use MAiNGO via its Python interface, you can also obtain the [maingopy package from PyPI](https://pypi.org/project/maingopy) via + + $ pip install maingopy + +This package is available as source as well as binary distribution containing a precompiled version of MAiNGO for multiple Python versions under Windows, Linux, and MacOS. +It also includes the melonpy module, the Python interface of [MeLOn](https://git.rwth-aachen.de/avt-svt/public/melon), which contains various machine learning models for use in optimization problems to be solved with MAiNGO. +Note that the following features are *not* available in the maingopy package available via PyPI: +- the MPI parallelization of MAiNGO +- the C++ API and text-based model parser of MAiNGO +- the subsolvers CPLEX and KNITRO + +If you want to use these features, you should obtain the MAiNGO code via git as described above. +This also enables you to build a version of the maingopy package that can use CPLEX and KNITRO if you have them installed on your system. +The MPI parallelization is currently not available via the Python interface of MAiNGO even when building it from source. + ## First steps -If you are new to MAiNGO, we recommend looking at the following documents in this order after having cloned the repository: -* `doc/html/index.html`: This is the manual for MAiNGO. It includes information on how to install and execute MAiNGO. +If you are new to MAiNGO, we recommend looking at the following to get started: +* The [documentation of MAiNGO](https://avt-svt.pages.rwth-aachen.de/public/maingo) contains more detailed information on how to obtain, build and execute MAiNGO. * `examples/01_BasicExample`: This folder contains the most basic example for solving problems with MAiNGO. ## Example applications diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 39a765c03d754be3bd09f3a7373fa732a245cbe8..350965590bed4c2cf6bc62fa786450bc7b570324 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,3 +1,20 @@ +Release version 0.5.0 (June 14th, 2021): + - New features & availability: + - MAiNGO is now also available from PyPI for use via Python + - New intrinsic functions: fstep & bstep, i.e. unit steps from 0 to 1 (or vice version) at x=0 + - Bugfixes: + - Fixed bug that caused instant crashes of the MPI parallelized version on some systems (see info on MUMPS below) + - Minor fixes to ensure compatibility with GCC 11 + - Several fixes in MAiNGO_Reader_Writer utility to avoid compile errors with different versions of GCC and MSVC 2019 + - Misc: + - Now using GitLab CI/CD for automated testing + - The documentation of MAiNGO is now hosted via GitLab Pages (see links in Readme.md) + - Now giving more information on third-party software (local / linear solvers etc.) used + - Now printing more comprehensive information about the initial point (constraint residuals etc.) when using BAB_verbosity = VERB_ALL + - Third-party libraries: + - Upgraded to MUMPS 5.4.0; also renamed all routines called MPI_* to FPI_* to avoid issues with the fake MPI implementation of MUMPS + when using MAiNGO with actual MPI parallelization + Release version 0.4.0 (March 4th, 2021): - New features: - MAiNGO now has a Python API. It consists of Python bindings for the C++ API and thus works very similarly to the latter @@ -11,7 +28,7 @@ Release version 0.4.0 (March 4th, 2021): - Renamed a few options as well as methods of the MAiNGO class to be more descriptive - Fixed random seeds for CPLEX and CLP - Improved diagnostic output for problems without objective or with constant objective - - Third party libraries: + - Third-party libraries: - Included pybind11 for the Python API - New version of babbase containing minor bugfixes, and now also allowing binary variables without explicit bounds - New version of mcpp containing bugfixes in relaxations and constraint propagation @@ -39,7 +56,7 @@ Release version 0.3.0 (June 12th, 2020): - An example for using MAiNGO within Bayesian optimization (i.e., maximizing/minimizing typical acquisition functions for Bayesian optimization that use Gaussian processes) - The documentation for building MAiNGO was improved - A section on the output written by MAiNGO was added - - Third party libraries: + - Third-party libraries: - Included MeLOn (see above) - Upgraded to new MUMPS version 5.3.1. diff --git a/cmake/MAiNGOversion.cmake b/cmake/MAiNGOversion.cmake new file mode 100644 index 0000000000000000000000000000000000000000..a5f825d586a1e7ea9c8986091001b36479aaac0c --- /dev/null +++ b/cmake/MAiNGOversion.cmake @@ -0,0 +1,3 @@ +set(MAiNGO_VERSION +0.5.0 +) diff --git a/dep/clp b/dep/clp index f64c5b746deaeb3fa8b13a081be53dfdfecc5374..3231f96757010afcf0e24fcb1afe18567df4c943 160000 --- a/dep/clp +++ b/dep/clp @@ -1 +1 @@ -Subproject commit f64c5b746deaeb3fa8b13a081be53dfdfecc5374 +Subproject commit 3231f96757010afcf0e24fcb1afe18567df4c943 diff --git a/dep/filib b/dep/filib index dd359bca5f0679dec0c07c1f0e13937e3787a5d7..f0cee0f4fe98ef2b2ff17e7b623de1c417fb8507 160000 --- a/dep/filib +++ b/dep/filib @@ -1 +1 @@ -Subproject commit dd359bca5f0679dec0c07c1f0e13937e3787a5d7 +Subproject commit f0cee0f4fe98ef2b2ff17e7b623de1c417fb8507 diff --git a/dep/ipopt b/dep/ipopt index 040cd37c56d7b9e3b20bbd4f8f10a282a29c83c8..5752923d046c9e05404a02ea2c87bea3b321d7f5 160000 --- a/dep/ipopt +++ b/dep/ipopt @@ -1 +1 @@ -Subproject commit 040cd37c56d7b9e3b20bbd4f8f10a282a29c83c8 +Subproject commit 5752923d046c9e05404a02ea2c87bea3b321d7f5 diff --git a/dep/libale b/dep/libale index 2fc616501a5ba0fdb63b4def75f3a6f59ac3bb2c..36e4e9d47355c53fbf25ac4107bb18ff3c180c04 160000 --- a/dep/libale +++ b/dep/libale @@ -1 +1 @@ -Subproject commit 2fc616501a5ba0fdb63b4def75f3a6f59ac3bb2c +Subproject commit 36e4e9d47355c53fbf25ac4107bb18ff3c180c04 diff --git a/dep/mcpp b/dep/mcpp index da5a2f227ef57f2d88654b30149636a0b1557085..dfbdc830edbd11afe31c4283020ecdb0683c3ee2 160000 --- a/dep/mcpp +++ b/dep/mcpp @@ -1 +1 @@ -Subproject commit da5a2f227ef57f2d88654b30149636a0b1557085 +Subproject commit dfbdc830edbd11afe31c4283020ecdb0683c3ee2 diff --git a/dep/melon b/dep/melon index 2418f3f20f4423498da4603c5befa2faf2da2e69..6a64bc96dfce27a7ca84c26c1a465d7b677aa70e 160000 --- a/dep/melon +++ b/dep/melon @@ -1 +1 @@ -Subproject commit 2418f3f20f4423498da4603c5befa2faf2da2e69 +Subproject commit 6a64bc96dfce27a7ca84c26c1a465d7b677aa70e diff --git a/dep/mumps b/dep/mumps index 72ec1603826019531be974367211eba253ddfb26..8d03311bd66b2bee39a8db75e68bf822b02952c9 160000 --- a/dep/mumps +++ b/dep/mumps @@ -1 +1 @@ -Subproject commit 72ec1603826019531be974367211eba253ddfb26 +Subproject commit 8d03311bd66b2bee39a8db75e68bf822b02952c9 diff --git a/doc/Doxyfile b/doc/Doxyfile index 8099767d8b927e3a1309ec26a8caa2d7fb7aa49a..7079f9632f85cd6c0b8a4bc6c7dc1fa91a8eafd6 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -158,7 +158,7 @@ INLINE_INHERITED_MEMB = NO # shortest path that makes the file name unique will be used # The default value is: YES. -FULL_PATH_NAMES = YES +FULL_PATH_NAMES = NO # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand @@ -816,7 +816,7 @@ WARN_LOGFILE = INPUT = . \ ../inc \ ../src \ - ../pymaingo \ + ../maingopy \ ../dep/babbase/src \ ../dep/babbase/inc @@ -953,7 +953,7 @@ EXAMPLE_RECURSIVE = NO # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = .\images +IMAGE_PATH = ./images # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program diff --git a/doc/html/CMakeGenerator.PNG b/doc/html/CMakeGenerator.PNG deleted file mode 100644 index 53fa7484637acb77bc132e43da30bc8caa2dd047..0000000000000000000000000000000000000000 Binary files a/doc/html/CMakeGenerator.PNG and /dev/null differ diff --git a/doc/html/CMakeHead.PNG b/doc/html/CMakeHead.PNG deleted file mode 100644 index a71c4466514c1d41b7331d025d7c1d64817330b3..0000000000000000000000000000000000000000 Binary files a/doc/html/CMakeHead.PNG and /dev/null differ diff --git a/doc/html/NLP.png b/doc/html/NLP.png deleted file mode 100644 index 9263d5debdc4c7ec52ef6810d0d41e1e10e48fb6..0000000000000000000000000000000000000000 Binary files a/doc/html/NLP.png and /dev/null differ diff --git a/doc/html/Relaxed_LBP.PNG b/doc/html/Relaxed_LBP.PNG deleted file mode 100644 index fe7be02ec7787caa1efb3bc07da6cfe95ed57c5b..0000000000000000000000000000000000000000 Binary files a/doc/html/Relaxed_LBP.PNG and /dev/null differ diff --git a/doc/html/Structure.PNG b/doc/html/Structure.PNG deleted file mode 100644 index 85b1efd98c450019f90e7215aee88edec906e3a2..0000000000000000000000000000000000000000 Binary files a/doc/html/Structure.PNG and /dev/null differ diff --git a/doc/html/VS_Release.PNG b/doc/html/VS_Release.PNG deleted file mode 100644 index f6efa0036f4735fc36e33ba31f21b712c1db9745..0000000000000000000000000000000000000000 Binary files a/doc/html/VS_Release.PNG and /dev/null differ diff --git a/doc/html/____init_____8py.html b/doc/html/____init_____8py.html deleted file mode 100644 index 676a64770a6ce1e7d3b343d0709e60a7d8455842..0000000000000000000000000000000000000000 --- a/doc/html/____init_____8py.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/pymaingo/__init__.py File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
- -
-
__init__.py File Reference
-
-
- - - - -

-Namespaces

 pymaingo
 
-
-
- - - - diff --git a/doc/html/__pymaingo_8cpp.html b/doc/html/__pymaingo_8cpp.html deleted file mode 100644 index f76dfcead153265ad0c07ee64c308c38f7e54ce5..0000000000000000000000000000000000000000 --- a/doc/html/__pymaingo_8cpp.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/pymaingo/_pymaingo.cpp File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
- -
-
_pymaingo.cpp File Reference
-
-
-
#include "MAiNGO.h"
-#include "MAiNGOmodel.h"
-#include "MAiNGOmodelEpsCon.h"
-#include "functionWrapper.h"
-#include "babOptVar.h"
-#include "ffunc.hpp"
-#include <pybind11/operators.h>
-#include <pybind11/pybind11.h>
-#include <pybind11/stl.h>
-
- - - -

-Classes

class  PyMAiNGOmodel
 
- - - -

-Functions

 PYBIND11_MODULE (_pymaingo, m)
 
-

Function Documentation

- -

◆ PYBIND11_MODULE()

- -
-
- - - - - - - - - - - - - - - - - - -
PYBIND11_MODULE (_pymaingo ,
 
)
-
- -
-
-
-
- - - - diff --git a/doc/html/__pymaingo_8cpp.js b/doc/html/__pymaingo_8cpp.js deleted file mode 100644 index b0ee020c070eb92c3c5e6d01bf0afb3c9494dd45..0000000000000000000000000000000000000000 --- a/doc/html/__pymaingo_8cpp.js +++ /dev/null @@ -1,5 +0,0 @@ -var __pymaingo_8cpp = -[ - [ "PyMAiNGOmodel", "class_py_m_ai_n_g_omodel.html", "class_py_m_ai_n_g_omodel" ], - [ "PYBIND11_MODULE", "__pymaingo_8cpp.html#a75e1ee573073a440d528a799ccd1e331", null ] -]; \ No newline at end of file diff --git a/doc/html/_m_ai_n_g_o_8cpp.html b/doc/html/_m_ai_n_g_o_8cpp.html deleted file mode 100644 index 132e041a466bfd16c53180de4fe95482e5fd81ef..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_o_8cpp.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/src/MAiNGO.cpp File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGO.cpp File Reference
-
-
-
#include "MAiNGO.h"
-#include "MAiNGOException.h"
-#include "MAiNGOmodelEpsCon.h"
-#include "bab.h"
-#include "getTime.h"
-#include "intervalLibrary.h"
-#include "lbp.h"
-#include "mpiUtilities.h"
-#include "ubp.h"
-#include "utilities.h"
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_o_8h.html b/doc/html/_m_ai_n_g_o_8h.html deleted file mode 100644 index e53b9e7b055b80300909e9bf84b071cc8afeb269..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_o_8h.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/MAiNGO.h File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
- -
-
MAiNGO.h File Reference
-
-
-
#include "MAiNGOdebug.h"
-#include "MAiNGOmodel.h"
-#include "constraint.h"
-#include "logger.h"
-#include "returnCodes.h"
-#include "settings.h"
-#include "babNode.h"
-#include "babUtils.h"
-#include <list>
-#include <memory>
-#include <utility>
-#include <vector>
-
-

Go to the source code of this file.

- - - - - -

-Classes

class  maingo::MAiNGO
 This class is the MAiNGO solver holding the B&B tree, upper bounding solver, lower bounding solver and settings. More...
 
- - - - - - - - - - - - - -

-Namespaces

 maingo
 namespace holding all essentials of MAiNGO
 
 maingo::bab
 namespace holding everything related to the actual branch-and-bound algorithm
 
 maingo::lbp
 namespace holding all essentials of the lower bounding solver
 
 maingo::ubp
 namespace holding all essentials of the upper bounding solvers
 
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_o_8h_source.html b/doc/html/_m_ai_n_g_o_8h_source.html deleted file mode 100644 index ea5b1ea9b07a593b1724ac9795d5c2a077344075..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_o_8h_source.html +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/MAiNGO.h Source File - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGO.h
-
-
-Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2019 Process Systems Engineering (AVT.SVT), RWTH Aachen University
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License 2.0 which is available at
6  * http://www.eclipse.org/legal/epl-2.0.
7  *
8  * SPDX-License-Identifier: EPL-2.0
9  *
10  **********************************************************************************/
11 
12 #pragma once
13 
14 #include "MAiNGOdebug.h"
15 #include "MAiNGOmodel.h"
16 #include "constraint.h"
17 #include "logger.h"
18 #include "returnCodes.h"
19 #include "settings.h"
20 
21 #include "babNode.h"
22 #include "babUtils.h"
23 
24 #include <list>
25 #include <memory>
26 #include <utility>
27 #include <vector>
28 
29 
30 namespace maingo {
31 
32 
33 // Forward declarations to avoid excessive includes
34 namespace bab {
35 class BranchAndBound;
36 } // end namespace bab
37 namespace lbp {
38 class LowerBoundingSolver;
39 } // end namespace lbp
40 namespace ubp {
41 class UpperBoundingSolver;
42 } // end namespace ubp
43 
44 
51 class MAiNGO {
52 
53  public:
57  MAiNGO(std::shared_ptr<MAiNGOmodel> myModel);
58 
62  ~MAiNGO() {}
63 
67  void set_model(std::shared_ptr<MAiNGOmodel> myModel);
68 
72  RETCODE solve();
73 
78 
85  bool set_option(const std::string &option, const double value);
86 
95  bool set_option(const std::string &option, const bool value) { return set_option(option, (double)value); }
96 
105  bool set_option(const std::string &option, const int value) { return set_option(option, (double)value); }
106 
112  void read_settings(const std::string &settingsFileName = "MAiNGOSettings.txt");
113 
119  void set_output_stream(std::ostream *const outputStream) { _logger->set_output_stream(outputStream); }
120 
126  void set_log_file_name(const std::string &logFileName) { _logger->logFileName = logFileName; }
127 
133  void set_result_file_name(const std::string &resultFileName) { _resultFileName = resultFileName; }
134 
140  void set_solution_and_statistics_csv_file_name(const std::string &csvSolutionStatisticsName) { _csvSolutionStatisticsName = csvSolutionStatisticsName; }
141 
147  void set_iterations_csv_file_name(const std::string &csvIterationsName) { _logger->csvIterationsName = csvIterationsName; }
148 
154  void set_json_file_name(const std::string &jsonFileName) { _jsonFileName = jsonFileName; }
155 
167  void write_model_to_file_in_other_language(const WRITING_LANGUAGE writingLanguage, std::string fileName = "", const std::string solverName = "SCIP",
168  const bool useMinMax = true, const bool useTrig = true, const bool ignoreBoundingFuncs = false, const bool writeRelaxationOnly = true);
169 
177  double get_objective_value() const;
178 
182  std::vector<double> get_solution_point() const;
183 
187  double get_cpu_solution_time() const;
188 
192  double get_wallclock_solution_time() const;
193 
197  double get_iterations() const;
198 
202  double get_max_nodes_in_memory() const;
203 
207  double get_UBP_count() const;
208 
212  double get_LBP_count() const;
213 
217  double get_final_LBD() const;
218 
222  double get_final_abs_gap() const;
223 
227  double get_final_rel_gap() const;
228 
232  RETCODE get_status() const;
233 
244  std::vector<double> evaluate_model_at_solution_point();
245 
249  std::vector<std::pair<std::string, double>> evaluate_additional_outputs_at_solution_point();
250 
264  std::pair<std::vector<double>, bool> evaluate_model_at_point(const std::vector<double> &point);
265 
271  std::vector<std::pair<std::string, double>> evaluate_additional_outputs_at_point(const std::vector<double> &point);
277  void print_MAiNGO(std::ostream &outstream = std::cout);
278 
279  private:
283  MAiNGO();
284 
288  MAiNGO(const MAiNGO &);
289 
293  MAiNGO &operator=(const MAiNGO &);
294 
299 
304 
309 
313  void _construct_DAG();
314 
322  void _classify_objective_and_constraints(std::vector<mc::FFVar> &tmpFunctions, const std::vector<mc::FFVar> &tmpDAGVars);
323 
331  void _ensure_valid_objective_function_using_dummy_variable(const mc::FFVar &dummyVariable);
332 
341  bool _check_for_hidden_zero_constraints(const std::vector<mc::FFVar> &tmpDAGVars, std::vector<mc::FFVar> &tmpDAGFunctions, std::vector<mc::FFVar> &tmpDAGoutputFunctions);
342 
347 
351  void _initialize_solve();
352 
356  void _root_obbt_feasibility();
357 
362 
367 
371  void _root_multistart();
372 
376  void _recognize_structure();
377 
382 
390  void _print_statistics();
391 
395  void _print_solution();
396 
400  void _print_time();
401 
415  void _write_files();
416 
421  void _write_files_error(const std::string &errorMessage);
422 
427 
431  void _write_json_file();
432 
437  void _write_result_file();
449  bool _check_feasibility_of_relaxation_only_constraints(const std::vector<double> &solutionPoint, std::string &str, const std::string &whitespaces);
450 
462  void _write_gams_file(const std::string gamsFileName = "MAiNGO_GAMS_file", const std::string solverName = "SCIP", const bool writeRelaxationOnly = false);
463 
469  void _write_gams_variables(std::ofstream &gamsFile);
470 
477  void _write_gams_functions(std::ofstream &gamsFile, bool writeRelaxationOnly);
478 
485  void _write_gams_options(std::ofstream &gamsFile, std::string solverName = "SCIP");
486 
492  void _add_linebreaks_to_gams_string(std::string &str);
493 
501  void _write_ale_file(const std::string aleFileName = "MAiNGO_ALE_file", const std::string solverName = "SCIP", const bool writeRelaxationOnly = false);
502 
508  void _write_ale_variables(std::ofstream &aleFile);
509 
516  void _write_ale_functions(std::ofstream &aleFile, bool writeRelaxationOnly);
517 
524  void _write_ale_options(std::ofstream &aleFile, std::string solverName = "SCIP");
525 
532  void _print_MAiNGO_header_for_other_modeling_language(const WRITING_LANGUAGE writingLanguage, std::ofstream &file);
538  void _print_MAiNGO_header();
539 
545  void _print_message(const std::string &message);
546 
553  void _write_epsilon_constraint_result(const std::vector<std::vector<double>> &objectiveValues, const std::vector<std::vector<double>> &solutionPoints);
554 
568  std::pair<std::vector<double>, bool> _evaluate_model_at_point(const std::vector<double> &point);
569 
575  std::vector<std::pair<std::string, double>> _evaluate_additional_outputs_at_point(const std::vector<double> &point);
576 
581  mc::FFGraph _DAG;
582  std::vector<mc::FFVar> _DAGvars;
583  std::vector<mc::FFVar> _DAGfunctions;
584  std::vector<mc::FFVar> _DAGoutputFunctions;
585  std::vector<mc::FFVar> _resultVars;
586  std::vector<OptimizationVariable> _originalVariables;
587  std::vector<OptimizationVariable *> _infeasibleVariables;
588  std::vector<OptimizationVariable> _variables;
589  std::vector<bool> _removedVariables;
590  std::vector<std::string> _uniqueNamesOriginal;
591  std::vector<std::string> _uniqueNames;
592  std::vector<double> _initialPointOriginal;
593  std::vector<double> _initialPoint;
594  unsigned _nvarOriginal;
598  unsigned _nvar;
599  unsigned _nineq;
600  unsigned _neq;
603  unsigned _nineqSquash;
604  unsigned _noutputVariables;
605  unsigned _nconstantIneq;
606  unsigned _nconstantEq;
611  std::vector<std::string> _outputNames;
612  std::shared_ptr<MAiNGOmodel> _myFFVARmodel;
619  std::shared_ptr<std::vector<Constraint>> _originalConstraints;
620  std::shared_ptr<std::vector<Constraint>> _constantConstraints;
621  std::shared_ptr<std::vector<Constraint>> _nonconstantConstraints;
622  std::shared_ptr<std::vector<Constraint>> _nonconstantConstraintsUBP;
623  std::shared_ptr<std::vector<Constraint>> _constantOutputs;
624  std::shared_ptr<std::vector<Constraint>> _nonconstantOutputs;
631  mc::FFGraph _DAGlbd;
632  std::vector<mc::FFVar> _DAGvarsLbd;
633  std::vector<mc::FFVar> _DAGfunctionsLbd;
634  std::vector<mc::FFVar> _DAGoutputFunctionsLbd;
635  std::vector<OptimizationVariable> _variablesLbd;
636  unsigned _nvarLbd;
644  std::vector<double> _solutionPoint;
645  double _solutionValue;
646  double _solutionTime;
648  double _babTime;
649  double _outputTime;
665  std::shared_ptr<lbp::LowerBoundingSolver> _myLBS;
666  std::shared_ptr<ubp::UpperBoundingSolver> _myUBSPre;
667  std::shared_ptr<ubp::UpperBoundingSolver> _myUBSBab;
668  std::shared_ptr<bab::BranchAndBound> _myBaB;
675  std::shared_ptr<Settings> _maingoSettings = std::make_shared<Settings>();
682  std::shared_ptr<Logger> _logger = std::make_shared<Logger>();
683  std::string _jsonFileName = "statisticsAndSolution.json";
684  std::string _resultFileName = "MAiNGOresult.txt";
685  std::string _csvSolutionStatisticsName = "statisticsAndSolution.csv";
692  std::vector<double> _objectivesAtRoot;
693  std::vector<SUBSOLVER_RETCODE> _feasibleAtRoot;
695  bool _inMAiNGOsolve = false;
698 #ifdef HAVE_MAiNGO_MPI
699 
703  int _rank;
704  int _nProcs;
706 #endif
707 
708 }; // end of class MAiNGO
709 
710 
711 } // end of namespace maingo
void set_log_file_name(const std::string &logFileName)
Sets name of the log file into which logging information may be written.
Definition: MAiNGO.h:126
-
void _root_multistart()
Conducts multistart local search at the root node.
Definition: MAiNGO.cpp:1476
-
std::vector< double > _objectivesAtRoot
Definition: MAiNGO.h:692
-
PROBLEM_STRUCTURE _problemStructure
Definition: MAiNGO.h:652
-
double _solutionTime
Definition: MAiNGO.h:646
-
void _root_obbt_feasibility()
Conducts feasibility-based bound tightening at the root node.
Definition: MAiNGO.cpp:1265
-
unsigned _nconstantIneqRelOnly
Definition: MAiNGO.h:607
-
unsigned _nconstantIneq
Definition: MAiNGO.h:605
-
double _solutionTimeWallClock
Definition: MAiNGO.h:650
-
std::shared_ptr< ubp::UpperBoundingSolver > _myUBSBab
Definition: MAiNGO.h:667
-
double _preprocessTime
Definition: MAiNGO.h:647
-
std::vector< mc::FFVar > _DAGfunctionsLbd
Definition: MAiNGO.h:633
-
unsigned _noutputVariables
Definition: MAiNGO.h:604
-
double get_wallclock_solution_time() const
Function returning wallclock solution time.
Definition: MAiNGOgetterFunctions.cpp:78
-
void _classify_objective_and_constraints(std::vector< mc::FFVar > &tmpFunctions, const std::vector< mc::FFVar > &tmpDAGVars)
Fills the constraints vectors (original, constant, non-constant) and outputs and writes non-constant ...
Definition: MAiNGO.cpp:1716
-
unsigned _neqRelaxationOnly
Definition: MAiNGO.h:602
-
void _print_message(const std::string &message)
Prints message with beautiful &#39;*&#39; box.
Definition: MAiNGOprintingFunctions.cpp:441
-
RETCODE _maingoStatus
Definition: MAiNGO.h:651
-
void set_solution_and_statistics_csv_file_name(const std::string &csvSolutionStatisticsName)
Sets names of the csv file into which the solution and statistics may be written. ...
Definition: MAiNGO.h:140
-
std::shared_ptr< std::vector< Constraint > > _constantOutputs
Definition: MAiNGO.h:623
-
double get_iterations() const
Function returning the number of iterations.
Definition: MAiNGOgetterFunctions.cpp:92
-
std::vector< std::string > _uniqueNames
Definition: MAiNGO.h:591
-
std::shared_ptr< std::vector< Constraint > > _nonconstantOutputs
Definition: MAiNGO.h:624
-
BAB_RETCODE
Enum for representing the return codes returned by the B&B solver.
Definition: babUtils.h:126
-
void _write_ale_variables(std::ofstream &aleFile)
Function writing variables, variable bounds and a initial point in the ale file.
Definition: MAiNGOtoOtherLanguage.cpp:683
-
double get_final_LBD() const
Function returning the final LBD.
Definition: MAiNGOgetterFunctions.cpp:168
-
TIGHTENING_RETCODE _rootConPropStatus
Definition: MAiNGO.h:654
-
bool _variablesFeasible
Definition: MAiNGO.h:616
-
unsigned _nvarOriginalBinary
Definition: MAiNGO.h:596
-
unsigned _neq
Definition: MAiNGO.h:600
-
void _root_obbt_feasibility_optimality()
Conducts feasibility- and optimality-based bound tightening at the root node.
Definition: MAiNGO.cpp:1336
-
Class representing a node in the Branch-and-Bound tree.
Definition: babNode.h:35
-
void _write_json_file()
Write json summaries to disk.
Definition: MAiNGOwritingFunctions.cpp:298
-
babBase::enums::BAB_RETCODE _babStatus
Definition: MAiNGO.h:658
-
std::vector< mc::FFVar > _DAGoutputFunctionsLbd
Definition: MAiNGO.h:634
-
double _solutionValue
Definition: MAiNGO.h:645
-
std::vector< OptimizationVariable > _originalVariables
Definition: MAiNGO.h:586
-
void _recognize_structure()
Uses mc::FFDep properties and the DAG to obtain information on the structure of the underlying proble...
Definition: MAiNGO.cpp:1551
-
double get_final_rel_gap() const
Function returning the final relative gap.
Definition: MAiNGOgetterFunctions.cpp:206
-
void _write_gams_file(const std::string gamsFileName="MAiNGO_GAMS_file", const std::string solverName="SCIP", const bool writeRelaxationOnly=false)
Writes MAiNGO problem to GAMS file.
Definition: MAiNGOtoOtherLanguage.cpp:114
- -
std::vector< double > get_solution_point() const
Function returning solution point.
Definition: MAiNGOgetterFunctions.cpp:37
-
std::string _csvSolutionStatisticsName
Definition: MAiNGO.h:685
-
std::vector< OptimizationVariable > _variables
Definition: MAiNGO.h:588
-
Struct for storing settings for MAiNGO.
Definition: settings.h:125
-
mc::FFGraph _DAGlbd
Definition: MAiNGO.h:631
-
SUBSOLVER_RETCODE _miqpStatus
Definition: MAiNGO.h:656
-
bool _inMAiNGOsolve
Definition: MAiNGO.h:695
-
double get_UBP_count() const
Function returning number of UBD problems solved.
Definition: MAiNGOgetterFunctions.cpp:130
-
void _set_constraint_properties()
Uses mc::FFDep properties and the DAG to obtain information on the properties of constraints.
Definition: MAiNGO.cpp:2329
-
std::shared_ptr< lbp::LowerBoundingSolver > _myLBS
Definition: MAiNGO.h:665
-
bool _check_for_hidden_zero_constraints(const std::vector< mc::FFVar > &tmpDAGVars, std::vector< mc::FFVar > &tmpDAGFunctions, std::vector< mc::FFVar > &tmpDAGoutputFunctions)
Checks if the constraints are non-zero (constant) after the DAG has been constructed (this may happen...
Definition: MAiNGO.cpp:1958
-
std::vector< mc::FFVar > _DAGvars
Definition: MAiNGO.h:582
-
void _print_statistics()
Prints problem & solution statistics on screen.
Definition: MAiNGOprintingFunctions.cpp:25
-
std::vector< std::pair< std::string, double > > evaluate_additional_outputs_at_point(const std::vector< double > &point)
Function returning values of the additional outputs of the set model at a point.
Definition: MAiNGOevaluationFunctions.cpp:100
-
double _outputTime
Definition: MAiNGO.h:649
-
babBase::BabNode _rootNode
Definition: MAiNGO.h:657
-
bool _initialPointFeasible
Definition: MAiNGO.h:694
-
std::vector< double > _initialPoint
Definition: MAiNGO.h:593
-
RETCODE solve_epsilon_constraint()
Solve a multi-objective problem using the epsilon-constraint method.
Definition: MAiNGO.cpp:165
-
RETCODE
Enum for representing the return codes returned by MAiNGO after the solve() function was called...
Definition: returnCodes.h:22
-
Settings _maingoOriginalSettings
Definition: MAiNGO.h:676
-
std::pair< std::vector< double >, bool > _evaluate_model_at_point(const std::vector< double > &point)
Function telling whether a point is feasible or not and returning values of the set model of the obje...
Definition: MAiNGOevaluationFunctions.cpp:168
-
EvaluationContainer _modelOutput
Definition: MAiNGO.h:613
-
void _initialize_solve()
Initializes subsolvers and internal solution variables for the solution of an LP, MIP...
Definition: MAiNGO.cpp:1185
-
unsigned _nineq
Definition: MAiNGO.h:599
-
double get_max_nodes_in_memory() const
Function returning the maximum number of nodes in memory.
Definition: MAiNGOgetterFunctions.cpp:111
-
unsigned _nvarOriginalContinuous
Definition: MAiNGO.h:595
-
void _root_constraint_propagation()
Conducts feasibility- and optimality-based bound tightening at the root node.
Definition: MAiNGO.cpp:1408
-
TIGHTENING_RETCODE _rootObbtStatus
Definition: MAiNGO.h:653
-
void _write_gams_options(std::ofstream &gamsFile, std::string solverName="SCIP")
Function writing options and model information into gams file.
Definition: MAiNGOtoOtherLanguage.cpp:551
-
bool _feasibilityProblem
Definition: MAiNGO.h:618
-
Struct for storing the values returned by model evaluation at the given point "var".
Definition: evaluationContainer.h:208
-
unsigned _nauxiliaryRelOnlyEqs
Definition: MAiNGO.h:637
-
void _write_files_error(const std::string &errorMessage)
Writes logging and csv information to disk when an error occurs.
Definition: MAiNGOwritingFunctions.cpp:47
-
bool _DAGconstructed
Definition: MAiNGO.h:615
-
bool _readyToSolve
Definition: MAiNGO.h:614
-
void _print_additional_output()
Prints additional model output on screen.
Definition: MAiNGOprintingFunctions.cpp:356
-
double get_objective_value() const
Function returning objective value.
Definition: MAiNGOgetterFunctions.cpp:23
-
std::vector< OptimizationVariable > _variablesLbd
Definition: MAiNGO.h:635
- -
std::shared_ptr< std::vector< Constraint > > _nonconstantConstraintsUBP
Definition: MAiNGO.h:622
-
std::vector< mc::FFVar > _DAGvarsLbd
Definition: MAiNGO.h:632
-
void _write_gams_variables(std::ofstream &gamsFile)
Function writing variables, variable bounds and a initial point in the gams file. ...
Definition: MAiNGOtoOtherLanguage.cpp:151
-
std::string _resultFileName
Definition: MAiNGO.h:684
-
~MAiNGO()
Destructor.
Definition: MAiNGO.h:62
-
RETCODE _analyze_and_solve_problem()
Internal function conducts structure recognition, sets constraint properties, and invokes the correct...
Definition: MAiNGO.cpp:513
-
double get_LBP_count() const
Function returning number of LBD problems solved.
Definition: MAiNGOgetterFunctions.cpp:149
-
unsigned _nconstantIneqSquash
Definition: MAiNGO.h:609
-
void _write_gams_functions(std::ofstream &gamsFile, bool writeRelaxationOnly)
Function writing functions into the gams file.
Definition: MAiNGOtoOtherLanguage.cpp:302
-
std::shared_ptr< std::vector< Constraint > > _originalConstraints
Definition: MAiNGO.h:619
-
This class is the MAiNGO solver holding the B&B tree, upper bounding solver, lower bounding solver an...
Definition: MAiNGO.h:51
-
PROBLEM_STRUCTURE
Enum for representing the problem structure.
Definition: constraint.h:25
-
std::pair< std::vector< double >, bool > evaluate_model_at_point(const std::vector< double > &point)
Function telling whether a point is feasible or not and returning values of the set model of the obje...
Definition: MAiNGOevaluationFunctions.cpp:64
-
void read_settings(const std::string &settingsFileName="MAiNGOSettings.txt")
Reads settings from text file.
Definition: MAiNGOreadSettings.cpp:26
-
std::vector< OptimizationVariable * > _infeasibleVariables
Definition: MAiNGO.h:587
-
void set_json_file_name(const std::string &jsonFileName)
Sets name of the json file into which information on the problem and solution may be written...
Definition: MAiNGO.h:154
-
std::vector< std::pair< std::string, double > > _evaluate_additional_outputs_at_point(const std::vector< double > &point)
Function returning values of the additional outputs of the set model at a point.
Definition: MAiNGOevaluationFunctions.cpp:135
-
RETCODE _solve_MIQP()
Solves an LP, MIP, QP or MIQP.
Definition: MAiNGO.cpp:621
-
std::string _jsonFileName
Definition: MAiNGO.h:683
-
unsigned _nconstantEqRelOnly
Definition: MAiNGO.h:608
-
std::vector< double > _initialPointOriginal
Definition: MAiNGO.h:592
-
TIGHTENING_RETCODE
Enum for representing the return codes returned by LowerBoundingSolvers when solving OBBT or constrai...
Definition: returnCodes.h:45
-
void _add_auxiliary_variables_to_lbd_dag()
Modifies the lower bound DAG _DAGlbd by adding auxiliary optimization variables for intermediate fact...
Definition: MAiNGO.cpp:2163
-
std::shared_ptr< std::vector< Constraint > > _nonconstantConstraints
Definition: MAiNGO.h:621
-
SUBSOLVER_RETCODE
Enum for representing the return codes returned by the different sub-solvers (UpperBoundingSolver, LowerBoundingSolver).
Definition: returnCodes.h:36
-
RETCODE get_status() const
Funcition returning whether MAiNGO solved the problem or not.
Definition: MAiNGOgetterFunctions.cpp:225
-
void _print_MAiNGO_header()
Write MAiNGO header.
Definition: MAiNGOprintingFunctions.cpp:418
-
void _add_linebreaks_to_gams_string(std::string &str)
Function for adding linebreaks in gams string. Older GAMS versions allow only for 40000 characters in...
Definition: MAiNGOtoOtherLanguage.cpp:623
-
mc::FFGraph _DAG
Definition: MAiNGO.h:581
-
bool set_option(const std::string &option, const int value)
Sets an option with an integer value - just forwards to version with double value.
Definition: MAiNGO.h:105
- -
RETCODE _solve_MINLP()
Solves an NLP or MINLP.
Definition: MAiNGO.cpp:769
-
std::shared_ptr< std::vector< Constraint > > _constantConstraints
Definition: MAiNGO.h:620
-
namespace holding all essentials of MAiNGO
Definition: aleModel.h:25
-
std::vector< bool > _removedVariables
Definition: MAiNGO.h:589
- -
unsigned _nvarOriginalInteger
Definition: MAiNGO.h:597
-
bool _check_feasibility_of_relaxation_only_constraints(const std::vector< double > &solutionPoint, std::string &str, const std::string &whitespaces)
Checks whether the current incumbent satisfies relaxation only constraints and gives a warning if not...
Definition: MAiNGO.cpp:1647
-
std::shared_ptr< Logger > _logger
Definition: MAiNGO.h:682
-
std::vector< SUBSOLVER_RETCODE > _feasibleAtRoot
Definition: MAiNGO.h:693
- -
void _write_files()
Writes logging and csv information to disk.
Definition: MAiNGOwritingFunctions.cpp:23
-
unsigned _nvar
Definition: MAiNGO.h:598
-
std::vector< mc::FFVar > _resultVars
Definition: MAiNGO.h:585
-
void _write_ale_functions(std::ofstream &aleFile, bool writeRelaxationOnly)
Function writing functions into the ale file.
Definition: MAiNGOtoOtherLanguage.cpp:792
-
void _write_epsilon_constraint_result(const std::vector< std::vector< double >> &objectiveValues, const std::vector< std::vector< double >> &solutionPoints)
Function for writing the pareto front to MAiNGO_epsilon_constraint_objective_values.csv and the corresponding solution points to MAiNGO_epsilon_constraint_solution_points.csv.
Definition: MAiNGOwritingFunctions.cpp:426
-
MAiNGO & operator=(const MAiNGO &)
Preventing use of default copy assignment.
-
void _write_ale_file(const std::string aleFileName="MAiNGO_ALE_file", const std::string solverName="SCIP", const bool writeRelaxationOnly=false)
Writes MAiNGO problem to ALE file.
Definition: MAiNGOtoOtherLanguage.cpp:645
-
unsigned _nineqRelaxationOnly
Definition: MAiNGO.h:601
-
std::vector< std::string > _outputNames
Definition: MAiNGO.h:611
-
bool _constantConstraintsFeasible
Definition: MAiNGO.h:617
-
std::shared_ptr< ubp::UpperBoundingSolver > _myUBSPre
Definition: MAiNGO.h:666
-
void set_result_file_name(const std::string &resultFileName)
Sets name of the text file into which information on the solution may be written. ...
Definition: MAiNGO.h:133
-
void set_model(std::shared_ptr< MAiNGOmodel > myModel)
Initializes model.
Definition: MAiNGO.cpp:967
-
std::vector< std::pair< std::string, double > > evaluate_additional_outputs_at_solution_point()
Function returning the additional model outputs at the solution point.
Definition: MAiNGOevaluationFunctions.cpp:42
-
double _babTime
Definition: MAiNGO.h:648
-
void _print_solution()
Prints solution on screen.
Definition: MAiNGOprintingFunctions.cpp:116
- -
void set_iterations_csv_file_name(const std::string &csvIterationsName)
Sets names of the csv file into which information on the individual B&B iterations may be written...
Definition: MAiNGO.h:147
-
void _construct_DAG()
Construct DAG.
Definition: MAiNGO.cpp:1035
-
std::vector< mc::FFVar > _DAGfunctions
Definition: MAiNGO.h:583
-
void _write_solution_and_statistics_csv()
Write csv summaries to disk.
Definition: MAiNGOwritingFunctions.cpp:204
- -
WRITING_LANGUAGE
Enum for representing the modeling language in which MAiNGO is supposed to write the current model to...
Definition: settings.h:49
-
std::shared_ptr< Settings > _maingoSettings
Definition: MAiNGO.h:675
-
std::vector< mc::FFVar > _DAGoutputFunctions
Definition: MAiNGO.h:584
-
double get_final_abs_gap() const
Function returning the final absolute gap.
Definition: MAiNGOgetterFunctions.cpp:187
-
void _ensure_valid_objective_function_using_dummy_variable(const mc::FFVar &dummyVariable)
Ensures that the objective function stored in the _modelOutput is valid. In particular, if _modelOutput is an empty vector, a constant will be used as objective function. If the objective function is a constant, this functions makes sure it is still correctly associated with the DAG.
Definition: MAiNGO.cpp:1929
-
std::shared_ptr< MAiNGOmodel > _myFFVARmodel
Definition: MAiNGO.h:612
-
double get_cpu_solution_time() const
Function returning CPU solution time.
Definition: MAiNGOgetterFunctions.cpp:64
-
void _print_time()
Prints solution time on screen.
Definition: MAiNGOprintingFunctions.cpp:313
-
std::shared_ptr< bab::BranchAndBound > _myBaB
Definition: MAiNGO.h:668
-
void _write_ale_options(std::ofstream &aleFile, std::string solverName="SCIP")
Function writing options and model information into ale file.
-
void _print_MAiNGO_header_for_other_modeling_language(const WRITING_LANGUAGE writingLanguage, std::ofstream &file)
Write MAiNGO header for a different modeling language.
Definition: MAiNGOtoOtherLanguage.cpp:991
-
void print_MAiNGO(std::ostream &outstream=std::cout)
Function printing an ASCII MAiNGO with copyright.
Definition: MAiNGOprintingFunctions.cpp:389
-
void _write_result_file()
Write res file to disk containing non-standard model information such as, e.g., residuals It will be ...
Definition: MAiNGOwritingFunctions.cpp:62
-
void set_output_stream(std::ostream *const outputStream)
Sets output stream onto which logging information may be printed.
Definition: MAiNGO.h:119
- -
MAiNGO()
Preventing use of default constructor.
-
unsigned _nvarOriginal
Definition: MAiNGO.h:594
-
unsigned _nvarLbd
Definition: MAiNGO.h:636
-
unsigned _nineqSquash
Definition: MAiNGO.h:603
-
std::vector< double > _solutionPoint
Definition: MAiNGO.h:644
-
bool set_option(const std::string &option, const bool value)
Sets an option with a boolean value.
Definition: MAiNGO.h:95
-
std::vector< std::string > _uniqueNamesOriginal
Definition: MAiNGO.h:590
-
void write_model_to_file_in_other_language(const WRITING_LANGUAGE writingLanguage, std::string fileName="", const std::string solverName="SCIP", const bool useMinMax=true, const bool useTrig=true, const bool ignoreBoundingFuncs=false, const bool writeRelaxationOnly=true)
Writes MAiNGO model to a a file in a different modeling language.
Definition: MAiNGOtoOtherLanguage.cpp:29
-
bool set_option(const std::string &option, const double value)
Sets an option with a double value. This function is used for all options.
Definition: MAiNGOsetOption.cpp:27
-
unsigned _nconstantOutputVariables
Definition: MAiNGO.h:610
-
std::vector< double > evaluate_model_at_solution_point()
Function returning all model function values at solution point. The ordering of the returned vector i...
Definition: MAiNGOevaluationFunctions.cpp:22
-
SUBSOLVER_RETCODE _rootMultistartStatus
Definition: MAiNGO.h:655
-
unsigned _nconstantEq
Definition: MAiNGO.h:606
-
RETCODE solve()
Solves the problem.
Definition: MAiNGO.cpp:46
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_o_exception_8h.html b/doc/html/_m_ai_n_g_o_exception_8h.html deleted file mode 100644 index a6005c64e16be68a854bff7c47318329fb0de02f..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_o_exception_8h.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/MAiNGOException.h File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
- -
-
MAiNGOException.h File Reference
-
-
-
#include "babNode.h"
-#include <exception>
-#include <sstream>
-#include <string>
-#include <typeinfo>
-
-

Go to the source code of this file.

- - - - - -

-Classes

class  maingo::MAiNGOException
 This class defines the exceptions thrown by MAiNGO. More...
 
- - - - -

-Namespaces

 maingo
 namespace holding all essentials of MAiNGO
 
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_o_exception_8h_source.html b/doc/html/_m_ai_n_g_o_exception_8h_source.html deleted file mode 100644 index 47789cf9a0a6e2bccf47c827f4643907221766a9..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_o_exception_8h_source.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/MAiNGOException.h Source File - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGOException.h
-
-
-Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2019 Process Systems Engineering (AVT.SVT), RWTH Aachen University
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License 2.0 which is available at
6  * http://www.eclipse.org/legal/epl-2.0.
7  *
8  * SPDX-License-Identifier: EPL-2.0
9  *
10  **********************************************************************************/
11 
12 #pragma once
13 
14 #include "babNode.h"
15 
16 #include <exception>
17 #include <sstream>
18 #include <string>
19 #include <typeinfo>
20 
21 
22 namespace maingo {
23 
24 
35 class MAiNGOException: public std::exception {
36 
37  public:
38  MAiNGOException() = delete;
39  MAiNGOException(const MAiNGOException&) = default;
40  MAiNGOException(MAiNGOException&&) = default;
41  MAiNGOException& operator=(const MAiNGOException&) = default;
43  virtual ~MAiNGOException() = default;
44 
45  explicit MAiNGOException(const std::string& errorMessage)
46  {
47  _construct_complete_error_message(errorMessage, nullptr, nullptr);
48  }
49 
50  MAiNGOException(const std::string& errorMessage, const babBase::BabNode& nodeThatErrorOccurredIn)
51  {
52  _construct_complete_error_message(errorMessage, nullptr, &nodeThatErrorOccurredIn);
53  }
54 
55  MAiNGOException(const std::string& errorMessage, const std::exception& originalException)
56  {
57  _construct_complete_error_message(errorMessage, &originalException, nullptr);
58  }
59 
60  MAiNGOException(const std::string& errorMessage, const std::exception& originalException, const babBase::BabNode& nodeThatErrorOccurredIn)
61  {
62  _construct_complete_error_message(errorMessage, &originalException, &nodeThatErrorOccurredIn);
63  }
64 
65  const char* what() const noexcept override
66  {
67  return _errorMessage.c_str();
68  }
69 
70 
71  private:
72  std::string _errorMessage{""};
73 
74  void _construct_complete_error_message(const std::string& errorMessage, const std::exception* originalException, const babBase::BabNode* nodeThatErrorOccurredIn)
75  {
76  std::ostringstream errorMessageStream;
77 
78  _append_original_exception_info_to_message(originalException, errorMessageStream);
79  _append_current_error_message_to_message(errorMessage, errorMessageStream);
80  _append_node_info_to_message(nodeThatErrorOccurredIn, errorMessageStream);
81 
82  _errorMessage = errorMessageStream.str();
83  }
84 
85  void _append_current_error_message_to_message(const std::string& currentErrorMessage, std::ostringstream& completeErrorMessage)
86  {
87  completeErrorMessage << currentErrorMessage;
88  }
89 
90  void _append_original_exception_info_to_message(const std::exception* originalException, std::ostringstream& completeErrorMessage)
91  {
92  if (originalException) {
93  if (typeid(*originalException).name() != typeid(*this).name()) {
94  completeErrorMessage << " Original exception type: " << typeid(*originalException).name() << ": " << std::endl
95  << " ";
96  }
97  completeErrorMessage << originalException->what() << std::endl;
98  }
99  }
100 
101  void _append_node_info_to_message(const babBase::BabNode* nodeThatErrorOccurredIn, std::ostringstream& completeErrorMessage)
102  {
103  if (nodeThatErrorOccurredIn) {
104  std::vector<double> lowerVarBounds(nodeThatErrorOccurredIn->get_lower_bounds()), upperVarBounds(nodeThatErrorOccurredIn->get_upper_bounds());
105  completeErrorMessage << std::endl
106  << " Exception was thrown while processing node no. " << nodeThatErrorOccurredIn->get_ID() << ":";
107  for (size_t i = 0; i < lowerVarBounds.size(); i++) {
108  completeErrorMessage << std::endl
109  << " x(" << i << "): " << std::setprecision(16) << lowerVarBounds[i] << ":" << upperVarBounds[i];
110  }
111  }
112  }
113 };
114 
115 
116 } // end namespace maingo
std::string _errorMessage
Definition: MAiNGOException.h:72
-
int get_ID() const
Function for querying the node ID.
Definition: babNode.h:100
-
Class representing a node in the Branch-and-Bound tree.
Definition: babNode.h:35
- -
MAiNGOException(const std::string &errorMessage, const std::exception &originalException)
Definition: MAiNGOException.h:55
-
void _append_node_info_to_message(const babBase::BabNode *nodeThatErrorOccurredIn, std::ostringstream &completeErrorMessage)
Definition: MAiNGOException.h:101
-
MAiNGOException(const std::string &errorMessage, const std::exception &originalException, const babBase::BabNode &nodeThatErrorOccurredIn)
Definition: MAiNGOException.h:60
-
std::vector< double > get_lower_bounds() const
Function for querying the lower bounds on the optimization variables within this node.
Definition: babNode.h:90
-
void _append_original_exception_info_to_message(const std::exception *originalException, std::ostringstream &completeErrorMessage)
Definition: MAiNGOException.h:90
-
const char * what() const noexcept override
Definition: MAiNGOException.h:65
-
MAiNGOException(const std::string &errorMessage, const babBase::BabNode &nodeThatErrorOccurredIn)
Definition: MAiNGOException.h:50
-
void _construct_complete_error_message(const std::string &errorMessage, const std::exception *originalException, const babBase::BabNode *nodeThatErrorOccurredIn)
Definition: MAiNGOException.h:74
-
namespace holding all essentials of MAiNGO
Definition: aleModel.h:25
-
virtual ~MAiNGOException()=default
-
MAiNGOException & operator=(const MAiNGOException &)=default
-
MAiNGOException(const std::string &errorMessage)
Definition: MAiNGOException.h:45
-
std::vector< double > get_upper_bounds() const
Function for querying the upper bounds on the optimization variables within this node.
Definition: babNode.h:95
-
This class defines the exceptions thrown by MAiNGO.
Definition: MAiNGOException.h:35
-
void _append_current_error_message_to_message(const std::string &currentErrorMessage, std::ostringstream &completeErrorMessage)
Definition: MAiNGOException.h:85
- -
-
- - - - diff --git a/doc/html/_m_ai_n_g_o_mpi_exception_8h.html b/doc/html/_m_ai_n_g_o_mpi_exception_8h.html deleted file mode 100644 index e39d78d184a883949a9397264b6004a89a660225..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_o_mpi_exception_8h.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/MAiNGOMpiException.h File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGOMpiException.h File Reference
-
- -
- - - - diff --git a/doc/html/_m_ai_n_g_o_mpi_exception_8h_source.html b/doc/html/_m_ai_n_g_o_mpi_exception_8h_source.html deleted file mode 100644 index 1db047e8b773ae6042da6259cdfcc3118b466937..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_o_mpi_exception_8h_source.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/MAiNGOMpiException.h Source File - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGOMpiException.h
-
-
-Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2019 Process Systems Engineering (AVT.SVT), RWTH Aachen University
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License 2.0 which is available at
6  * http://www.eclipse.org/legal/epl-2.0.
7  *
8  * SPDX-License-Identifier: EPL-2.0
9  *
10  **********************************************************************************/
11 
12 #ifdef HAVE_MAiNGO_MPI
13 #pragma once
14 
15 #include "MAiNGOException.h"
16 #include "babNode.h"
17 
18 
19 namespace maingo {
20 
21 
31 class MAiNGOMpiException: public MAiNGOException {
32 
33  public:
34  MAiNGOMpiException() = delete;
35  MAiNGOMpiException(const MAiNGOMpiException&) = default;
36  MAiNGOMpiException(MAiNGOMpiException&&) = default;
37  MAiNGOMpiException& operator=(const MAiNGOMpiException&) = default;
38  MAiNGOMpiException& operator=(MAiNGOMpiException&&) = default;
39  ~MAiNGOMpiException() = default;
40 
41  enum ORIGIN {
42  ORIGIN_ME = 1,
43  ORIGIN_OTHER
44  };
45 
46  MAiNGOMpiException(const std::string& errorMessage, const ORIGIN origin):
47  MAiNGOException(errorMessage), _origin(origin)
48  {
49  }
50 
51  MAiNGOMpiException(const std::string& errorMessage, const babBase::BabNode& nodeThatProblemOccurredIn, const ORIGIN origin):
52  MAiNGOException(errorMessage, nodeThatProblemOccurredIn), _origin(origin)
53  {
54  }
55 
56  MAiNGOMpiException(const std::string& errorMessage, const std::exception& originalException, const ORIGIN origin):
57  MAiNGOException(errorMessage, originalException), _origin(origin)
58  {
59  }
60 
61  MAiNGOMpiException(const std::string& errorMessage, const std::exception& originalException, const babBase::BabNode& nodeThatProblemOccurredIn, const ORIGIN origin):
62  MAiNGOException(errorMessage, originalException, nodeThatProblemOccurredIn), _origin(origin)
63  {
64  }
65 
66  MAiNGOMpiException(MAiNGOException& originalException, ORIGIN origin):
67  MAiNGOException(originalException), _origin(origin)
68  {
69  }
70 
71  ORIGIN origin() const noexcept { return _origin; }
72 
73  private:
74  ORIGIN _origin;
75 };
76 
77 
78 } // end namespace maingo
79 #endif
Class representing a node in the Branch-and-Bound tree.
Definition: babNode.h:35
- -
namespace holding all essentials of MAiNGO
Definition: aleModel.h:25
- -
-
- - - - diff --git a/doc/html/_m_ai_n_g_o_w_a_l_l_8cpp.html b/doc/html/_m_ai_n_g_o_w_a_l_l_8cpp.html deleted file mode 100644 index 9a10a159cfe0e24ced0d3735a2748d39eafa0d84..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_o_w_a_l_l_8cpp.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - -MAiNGO: C:/Users/dobo01/maingo/src/MAiNGOWALL.cpp File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGOWALL.cpp File Reference
-
-
-
#include "MAiNGO.h"
-#include "MAiNGOmodelEpsCon.h"
-#include "bab.h"
-#include "exceptions.h"
-#include "getTime.h"
-#include "intervalLibrary.h"
-#include "lbp.h"
-#include "mpiUtilities.h"
-#include "ubp.h"
-#include "utilities.h"
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_odebug_8h.html b/doc/html/_m_ai_n_g_odebug_8h.html deleted file mode 100644 index 3c197562cf2e9c8fdcbd636c16f2f11a473d22d7..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_odebug_8h.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/MAiNGOdebug.h File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
- -
-
MAiNGOdebug.h File Reference
-
-
- -

Go to the source code of this file.

- - - - -

-Macros

#define LP__OPTIMALITY_CHECK
 
-

Macro Definition Documentation

- -

◆ LP__OPTIMALITY_CHECK

- -
-
- - - - -
#define LP__OPTIMALITY_CHECK
-
- -
-
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_odebug_8h.js b/doc/html/_m_ai_n_g_odebug_8h.js deleted file mode 100644 index ab8f368a08fe8ce5f596acd5df5101ec92735377..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_odebug_8h.js +++ /dev/null @@ -1,4 +0,0 @@ -var _m_ai_n_g_odebug_8h = -[ - [ "LP__OPTIMALITY_CHECK", "_m_ai_n_g_odebug_8h.html#a2426c899a5c3a34bfa2fb0f61f6dcaf5", null ] -]; \ No newline at end of file diff --git a/doc/html/_m_ai_n_g_odebug_8h_source.html b/doc/html/_m_ai_n_g_odebug_8h_source.html deleted file mode 100644 index 38d3dc10344195561861e5f1b2a9136f1df38a25..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_odebug_8h_source.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/MAiNGOdebug.h Source File - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGOdebug.h
-
-
-Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2019 Process Systems Engineering (AVT.SVT), RWTH Aachen University
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License 2.0 which is available at
6  * http://www.eclipse.org/legal/epl-2.0.
7  *
8  * SPDX-License-Identifier: EPL-2.0
9  *
10  **********************************************************************************/
11 
12 #pragma once
13 
14 // Pre-processor variable for specific additional output in MAiNGO useful for debugging
15 #undef MAiNGO_DEBUG_MODE
16 
17 // Pre-processor variable enabling infeasibility, optimality and feasibility checks for the lower bounding LP
18 #define LP__OPTIMALITY_CHECK
19 
20 // Pre-processor variable enabling writing of files for the above checks
21 #undef LP__WRITE_CHECK_FILES
-
- - - - diff --git a/doc/html/_m_ai_n_g_oevaluation_functions_8cpp.html b/doc/html/_m_ai_n_g_oevaluation_functions_8cpp.html deleted file mode 100644 index d8de132fe146fc0aaf0037606a543b9f857b0d35..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_oevaluation_functions_8cpp.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/src/MAiNGOevaluationFunctions.cpp File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGOevaluationFunctions.cpp File Reference
-
-
-
#include "MAiNGO.h"
-#include "MAiNGOException.h"
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_oevaluator_8h.html b/doc/html/_m_ai_n_g_oevaluator_8h.html deleted file mode 100644 index 9284ff132bad9d74ca90a740544255b5edac54c8..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_oevaluator_8h.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/MAiNGOevaluator.h File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
- -
-
MAiNGOevaluator.h File Reference
-
-
-
#include "MAiNGOException.h"
-#include "symbol_table.hpp"
-#include "util/evaluator.hpp"
-#include "ffunc.hpp"
-
-

Go to the source code of this file.

- - - - - - - - -

-Classes

struct  maingo::ConstraintContainer
 Containter for constraint evaluation. More...
 
class  maingo::MaingoEvaluator
 Evaluates ALE expressions to Var. More...
 
- - - - -

-Namespaces

 maingo
 namespace holding all essentials of MAiNGO
 
- - - -

-Typedefs

using maingo::Var = mc::FFVar
 
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_oevaluator_8h.js b/doc/html/_m_ai_n_g_oevaluator_8h.js deleted file mode 100644 index 197dd3adfcc7f15283c318545d0f68c5df255015..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_oevaluator_8h.js +++ /dev/null @@ -1,6 +0,0 @@ -var _m_ai_n_g_oevaluator_8h = -[ - [ "ConstraintContainer", "structmaingo_1_1_constraint_container.html", "structmaingo_1_1_constraint_container" ], - [ "MaingoEvaluator", "classmaingo_1_1_maingo_evaluator.html", "classmaingo_1_1_maingo_evaluator" ], - [ "Var", "_m_ai_n_g_oevaluator_8h.html#af5ee07a403d9ee6e7075d41518d93f77", null ] -]; \ No newline at end of file diff --git a/doc/html/_m_ai_n_g_oevaluator_8h_source.html b/doc/html/_m_ai_n_g_oevaluator_8h_source.html deleted file mode 100644 index 3df7fc352914eeb328d6bb314be2b49f68500292..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_oevaluator_8h_source.html +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/MAiNGOevaluator.h Source File - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGOevaluator.h
-
-
-Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2019 Process Systems Engineering (AVT.SVT), RWTH Aachen University
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License 2.0 which is available at
6  * http://www.eclipse.org/legal/epl-2.0.
7  *
8  * SPDX-License-Identifier: EPL-2.0
9  *
10  **********************************************************************************/
11 
12 #pragma once
13 
14 #include "MAiNGOException.h"
15 #include "symbol_table.hpp"
16 
17 #include "util/evaluator.hpp"
18 
19 #include "ffunc.hpp"
20 
21 
22 namespace maingo {
23 
24 
25 using namespace ale;
26 using namespace ale::util;
27 using Var = mc::FFVar;
28 
34  std::vector<Var> eq;
35  std::vector<Var> ineq;
36 };
37 
43 
44  public:
53  symbol_table& symbols,
54  const std::vector<Var>& variables,
55  const std::unordered_map<std::string, int>& positions):
56  _symbols(symbols),
57  _variables(variables),
58  _positions(positions)
59  {
60  }
61 
67  Var dispatch(expression<real<0>>& expr)
68  {
69  return dispatch(expr.get());
70  }
71 
72  ConstraintContainer dispatch(expression<boolean<0>>& expr)
73  {
74  return dispatch(expr.get());
75  }
76 
77  template <typename TReturn, typename TType>
78  TReturn dispatch(value_node<TType>* node)
79  {
80  throw MAiNGOException(" Error: MaingoEvaluator -- Used unsupported dispatch");
81  }
82 
83  template <unsigned IDim>
84  typename ale::index<IDim>::ref_type dispatch(value_node<ale::index<IDim>>* node)
85  {
86  evaluator eval(_symbols);
87  return eval.dispatch(node);
88  }
89 
90  template <typename TType>
91  typename set<TType, 0>::basic_type dispatch(value_node<set<TType, 0>>* node)
92  {
93  evaluator eval(_symbols);
94  return eval.dispatch(node);
95  }
96 
97 
98  template <unsigned IDim>
99  tensor<Var, IDim> dispatch(value_node<real<IDim>>* node)
100  {
101  return std::visit(*this, node->get_variant());
102  }
103 
104 
105  Var dispatch(value_node<real<0>>* node)
106  {
107  return std::visit(*this, node->get_variant());
108  }
109 
110 
111  ConstraintContainer dispatch(value_node<boolean<0>>* node)
112  {
113  return std::visit(*this, node->get_variant());
114  }
115 
116 
117  template <unsigned IDim>
118  tensor<Var, IDim> dispatch(value_symbol<real<IDim>>* sym)
119  {
120  return std::visit(*this, sym->get_value_variant());
121  }
122 
123  Var dispatch(value_symbol<real<0>>* sym)
124  {
125  return std::visit(*this, sym->get_value_variant());
126  }
134  template <unsigned IDim>
135  tensor<Var, IDim> operator()(constant_node<real<IDim>>* node)
136  {
137  tensor<Var, IDim> result(node->value.shape());
138  result.ref().assign(node->value);
139  return result;
140  }
141 
142 
143  Var operator()(constant_node<real<0>>* node)
144  {
145  return node->value;
146  }
147 
148 
149  ConstraintContainer operator()(constant_node<boolean<0>>* node)
150  {
151  throw MAiNGOException(" Error: MaingoEvaluator -- Evaluated unsupported general logical expression");
152  return ConstraintContainer();
153  }
154 
155 
156  template <unsigned IDim>
157  tensor<Var, IDim> operator()(parameter_node<real<IDim>>* node)
158  {
159  auto sym = _symbols.resolve<real<IDim>>(node->name);
160  if (!sym) {
161  throw MAiNGOException(" Error: MaingoEvaluator -- Symbol " + node->name + " has unexpected type");
162  }
163  return dispatch(sym);
164  }
165 
166  Var operator()(parameter_node<real<0>>* node)
167  {
168  auto sym = _symbols.resolve<real<0>>(node->name);
169  if (!sym) {
170  throw MAiNGOException(" Error: MaingoEvaluator -- Symbol " + node->name + " has unexpected type");
171  }
172  return dispatch(sym);
173  }
174 
175 
176  ConstraintContainer operator()(parameter_node<boolean<0>>* node)
177  {
178  throw MAiNGOException(" Error: MaingoEvaluator -- Evaluated unsupported general logical expression");
179  return ConstraintContainer();
180  }
181 
182 
183  template <unsigned IDim>
184  tensor<Var, IDim> operator()(parameter_symbol<real<IDim>>* sym)
185  {
186  tensor<Var, IDim> result(sym->m_value.shape());
187  result.ref().assign(sym->m_value);
188  return result;
189  }
190 
191 
192  Var operator()(parameter_symbol<real<0>>* sym)
193  {
194  return sym->m_value;
195  }
196 
197 
198  template <unsigned IDim>
199  tensor<Var, IDim> operator()(variable_symbol<real<IDim>>* sym)
200  {
201  tensor<Var, IDim> result(sym->shape());
202  size_t indexes[IDim];
203  for (int i = 0; i < IDim; ++i) {
204  indexes[i] = 0;
205  }
206  int position = _positions.at(sym->m_name);
207  while (indexes[0] < result.shape(0)) {
208  result[indexes] = _variables[position];
209  ++position;
210  for (int i = IDim - 1; i >= 0; --i) {
211  if (++indexes[i] < sym->shape(i)) {
212  break;
213  }
214  else if (i != 0) {
215  indexes[i] = 0;
216  }
217  }
218  }
219  return result;
220  }
221 
222 
223  Var operator()(variable_symbol<real<0>>* sym)
224  {
225  return _variables[_positions.at(sym->m_name)];
226  }
227 
228 
229  Var operator()(expression_symbol<real<0>>* sym)
230  {
231  return dispatch(sym->m_value.get());
232  }
233 
234 
235  ConstraintContainer operator()(expression_symbol<boolean<0>>* sym)
236  {
237  return dispatch(sym->m_value.get());
238  }
239 
240 
241  template <unsigned IDim>
242  tensor<Var, IDim> operator()(entry_node<real<IDim>>* node)
243  {
244  return dispatch(node->template get_child<0>())[dispatch(node->template get_child<1>()) - 1];
245  }
246 
247 
248  Var operator()(entry_node<real<0>>* node)
249  {
250  return dispatch(node->get_child<0>())[dispatch(node->get_child<1>()) - 1];
251  }
252 
253 
254  Var operator()(minus_node* node)
255  {
256  return -dispatch(node->get_child<0>());
257  }
258 
259 
260  Var operator()(inverse_node* node)
261  {
262  return 1 / dispatch(node->get_child<0>());
263  }
264 
265 
266  Var operator()(addition_node* node)
267  {
268  Var result = 0;
269  for (auto it = node->children.begin(); it != node->children.end(); ++it) {
270  result += dispatch(it->get());
271  }
272  return result;
273  }
274 
275 
276  Var operator()(sum_div_node* node)
277  {
278  if (node->children.size() % 2 == 0) {
279  throw MAiNGOException(" Error: MaingoEvaluator -- Called sum_div with even number of arguments");
280  }
281  if (node->children.size() < 3) {
282  throw MAiNGOException(" Error: MaingoEvaluator -- Called sum_div with less than 3 arguments");
283  }
284  std::vector<Var> vars;
285  std::vector<double> coeff;
286  for (auto it = node->children.begin(); it != node->children.end(); ++it) {
287  if (distance(node->children.begin(), it) < (int)(node->children.size() / 2)) {
288  vars.emplace_back(dispatch(it->get()));
289  }
290  else {
291  if (!dispatch(it->get()).cst()) {
292  throw MAiNGOException(" MaingoEvaluator -- Error: The " + std::to_string(distance(node->children.begin(), it)) + "-th coefficient in sum_div is not a constant");
293  }
294  coeff.emplace_back(dispatch(it->get()).num().val());
295  }
296  }
297  return mc::sum_div(vars, coeff);
298  }
299 
300 
301  Var operator()(xlog_sum_node* node)
302  {
303  if (!(node->children.size() % 2 == 0)) {
304  throw MAiNGOException(" Error: MaingoEvaluator -- Called xlog_sum with odd number of arguments");
305  }
306  if (node->children.size() < 2) {
307  throw MAiNGOException(" Error: MaingoEvaluator -- Called xlog_sum with less than arguments");
308  }
309  std::vector<Var> vars;
310  std::vector<double> coeff;
311  for (auto it = node->children.begin(); it != node->children.end(); ++it) {
312  if (distance(node->children.begin(), it) < (int)(node->children.size() / 2)) {
313  vars.emplace_back(dispatch(it->get()));
314  }
315  else {
316  if (!dispatch(it->get()).cst()) {
317  throw MAiNGOException(" Error: MaingoEvaluator -- The " + std::to_string(distance(node->children.begin(), it)) + "-th coefficient in xlog_sum is not a constant");
318  }
319  coeff.emplace_back(dispatch(it->get()).num().val());
320  }
321  }
322  return mc::xlog_sum(vars, coeff);
323  }
324 
325 
326  Var operator()(multiplication_node* node)
327  {
328  Var result = 1;
329  for (auto it = node->children.begin(); it != node->children.end(); ++it) {
330  result *= dispatch(it->get());
331  }
332  return result;
333  }
334 
335 
336  Var operator()(exponentiation_node* node)
337  {
338  Var result = 1;
339  for (auto it = node->children.rbegin(); it != node->children.rend(); ++it) {
340  result = pow(dispatch(it->get()), result);
341  }
342  return result;
343  }
344 
345 
346  Var operator()(min_node* node)
347  {
348  if (node->children.size() == 0) {
349  throw MAiNGOException(" Error: MaingoEvaluator -- Called min without arguments");
350  }
351  auto it = node->children.begin();
352  Var result = dispatch(it->get());
353  it++;
354  for (; it != node->children.end(); ++it) {
355  result = mc::min(dispatch(it->get()), result);
356  }
357  return result;
358  }
359 
360 
361  Var operator()(max_node* node)
362  {
363  if (node->children.size() == 0) {
364  throw MAiNGOException(" Error: MaingoEvaluator -- Called max without arguments");
365  }
366  auto it = node->children.begin();
367  Var result = dispatch(it->get());
368  it++;
369  for (; it != node->children.end(); ++it) {
370  result = mc::max(dispatch(it->get()), result);
371  }
372  return result;
373  }
374 
375 
376  template <typename TType>
377  Var operator()(set_min_node<TType>* node)
378  {
379  auto elements = dispatch(node->template get_child<0>());
380  _symbols.push_scope();
381  if (elements.begin() == elements.end()) {
382  throw MAiNGOException(" Error: MaingoEvaluator -- Called set_min with empty set");
383  }
384  auto it = elements.begin();
385  _symbols.define(node->name, new parameter_symbol<TType>(node->name, *it));
386  Var result = dispatch(node->template get_child<1>());
387  ++it;
388  for (; it != elements.end(); ++it) {
389  _symbols.define(node->name, new parameter_symbol<TType>(node->name, *it));
390  result = mc::min(dispatch(node->template get_child<1>()), result);
391  }
392  _symbols.pop_scope();
393  return result;
394  }
395 
396 
397  template <typename TType>
398  Var operator()(set_max_node<TType>* node)
399  {
400  auto elements = dispatch(node->template get_child<0>());
401  _symbols.push_scope();
402  if (elements.begin() == elements.end()) {
403  throw MAiNGOException(" Error: MaingoEvaluator -- Called set_max with empty set");
404  }
405  auto it = elements.begin();
406  _symbols.define(node->name, new parameter_symbol<TType>(node->name, *it));
407  Var result = dispatch(node->template get_child<1>());
408  ++it;
409  for (; it != elements.end(); ++it) {
410  _symbols.define(node->name, new parameter_symbol<TType>(node->name, *it));
411  result = mc::max(dispatch(node->template get_child<1>()), result);
412  }
413  _symbols.pop_scope();
414  return result;
415  }
416 
417 
418  Var operator()(exp_node* node)
419  {
420  return exp(dispatch(node->get_child<0>()));
421  }
422 
423 
424  Var operator()(log_node* node)
425  {
426  return log(dispatch(node->get_child<0>()));
427  }
428 
429 
430  Var operator()(sqrt_node* node)
431  {
432  return sqrt(dispatch(node->get_child<0>()));
433  }
434 
435 
436  Var operator()(sin_node* node)
437  {
438  return sin(dispatch(node->get_child<0>()));
439  }
440 
441 
442  Var operator()(asin_node* node)
443  {
444  return asin(dispatch(node->get_child<0>()));
445  }
446 
447 
448  Var operator()(cos_node* node)
449  {
450  return cos(dispatch(node->get_child<0>()));
451  }
452 
453 
454  Var operator()(acos_node* node)
455  {
456  return acos(dispatch(node->get_child<0>()));
457  }
458 
459 
460  Var operator()(tan_node* node)
461  {
462  return tan(dispatch(node->get_child<0>()));
463  }
464 
465 
466  Var operator()(atan_node* node)
467  {
468  return atan(dispatch(node->get_child<0>()));
469  }
470 
471 
472  Var operator()(lmtd_node* node)
473  {
474  return mc::lmtd(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()));
475  }
476 
477 
478  Var operator()(xexpax_node* node)
479  {
480  if (!dispatch(node->get_child<1>()).cst()) {
481  throw MAiNGOException(" Error: MaingoEvaluator -- Second argument in xexpax is not a constant");
482  }
483  return mc::xexpax(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val());
484  }
485 
486 
487  Var operator()(arh_node* node)
488  {
489  if (!dispatch(node->get_child<1>()).cst()) {
490  throw MAiNGOException(" Error: MaingoEvaluator -- Second argument in arh is not a constant");
491  }
492  return mc::Op<mc::FFVar>::arh(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val());
493  }
494 
495 
496  Var operator()(lb_func_node* node)
497  {
498  if (!dispatch(node->get_child<1>()).cst()) {
499  throw MAiNGOException(" Error: MaingoEvaluator -- Second argument in lb_func is not a constant");
500  }
501  return mc::lb_func(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val());
502  }
503 
504 
505  Var operator()(ub_func_node* node)
506  {
507  if (!dispatch(node->get_child<1>()).cst()) {
508  throw MAiNGOException(" Error: MaingoEvaluator -- Second argument in ub_func is not a constant");
509  }
510  return mc::ub_func(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val());
511  }
512 
513 
514  Var operator()(bounding_func_node* node)
515  {
516  if (!dispatch(node->get_child<1>()).cst()) {
517  throw MAiNGOException(" Error: MaingoEvaluator -- Second argument in bounding_func is not a constant");
518  }
519  if (!dispatch(node->get_child<2>()).cst()) {
520  throw MAiNGOException(" Error: MaingoEvaluator -- Third argument in bounding_func is not a constant");
521  }
522  return mc::bounding_func(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val());
523  }
524 
525 
526  Var operator()(ale::squash_node* node)
527  {
528  if (!dispatch(node->get_child<1>()).cst()) {
529  throw MAiNGOException(" Error: MaingoEvaluator -- Second argument in squash_node is not a constant");
530  }
531  if (!dispatch(node->get_child<2>()).cst()) {
532  throw MAiNGOException(" Error: MaingoEvaluator -- Third argument in squash_node is not a constant");
533  }
534  return mc::squash_node(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val());
535  }
536 
537 
538  Var operator()(ale::af_lcb_node* node)
539  {
540  if (!dispatch(node->get_child<2>()).cst()) {
541  throw MAiNGOException(" Error: MaingoEvaluator -- Third argument in af_lcb_node is not a constant");
542  }
543  return mc::acquisition_function(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()), 1, dispatch(node->get_child<2>()).num().val());
544  }
545 
546 
547  Var operator()(ale::af_ei_node* node)
548  {
549  if (!dispatch(node->get_child<2>()).cst()) {
550  throw MAiNGOException(" Error: MaingoEvaluator -- Third argument in af_ei_node is not a constant");
551  }
552  return mc::acquisition_function(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()), 2, dispatch(node->get_child<2>()).num().val());
553  }
554 
555 
556  Var operator()(ale::af_pi_node* node)
557  {
558  if (!dispatch(node->get_child<2>()).cst()) {
559  throw MAiNGOException(" Error: MaingoEvaluator -- Third argument in af_pi_node is not a constant");
560  }
561  return mc::acquisition_function(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()), 3, dispatch(node->get_child<2>()).num().val());
562  }
563 
564 
565  Var operator()(ale::regnormal_node* node)
566  {
567  if (!dispatch(node->get_child<1>()).cst()) {
568  throw MAiNGOException(" Error: MaingoEvaluator -- Second argument in regnormal_node is not a constant");
569  }
570  if (!dispatch(node->get_child<2>()).cst()) {
571  throw MAiNGOException(" Error: MaingoEvaluator -- Third argument in regnormal_node is not a constant");
572  }
573  return mc::regnormal(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val());
574  }
575 
576 
577  Var operator()(nrtl_dtau_node* node)
578  {
579  if (!dispatch(node->get_child<1>()).cst()) {
580  throw MAiNGOException(" Error: MaingoEvaluator -- Second argument in nrtl_dtau is not a constant");
581  }
582  if (!dispatch(node->get_child<2>()).cst()) {
583  throw MAiNGOException(" Error: MaingoEvaluator -- Third argument in nrtl_dtau is not a constant");
584  }
585  if (!dispatch(node->get_child<3>()).cst()) {
586  throw MAiNGOException(" Error: MaingoEvaluator -- Fourth argument in nrtl_dtau is not a constant");
587  }
588  return mc::nrtl_dtau(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val(),
589  dispatch(node->get_child<3>()).num().val());
590  }
591 
592 
593  Var operator()(ext_antoine_psat_node* node)
594  {
595  if (!dispatch(node->get_child<1>()).cst()) {
596  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p1 in ext_antoine_psat is not a constant");
597  }
598  if (!dispatch(node->get_child<2>()).cst()) {
599  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p2 in ext_antoine_psat is not a constant");
600  }
601  if (!dispatch(node->get_child<3>()).cst()) {
602  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p3 in ext_antoine_psat is not a constant");
603  }
604  if (!dispatch(node->get_child<4>()).cst()) {
605  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p4 in ext_antoine_psat is not a constant");
606  }
607  if (!dispatch(node->get_child<5>()).cst()) {
608  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p5 in ext_antoine_psat is not a constant");
609  }
610  if (!dispatch(node->get_child<6>()).cst()) {
611  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p6 in ext_antoine_psat is not a constant");
612  }
613  if (!dispatch(node->get_child<7>()).cst()) {
614  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p7 in ext_antoine_psat is not a constant");
615  }
616  // ext_antoine_psat = type 1
617  return mc::vapor_pressure(dispatch(node->get_child<0>()), 1, dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val(),
618  dispatch(node->get_child<3>()).num().val(), dispatch(node->get_child<4>()).num().val(), dispatch(node->get_child<5>()).num().val(),
619  dispatch(node->get_child<6>()).num().val(), dispatch(node->get_child<7>()).num().val());
620  }
621 
622 
623  Var operator()(antoine_psat_node* node)
624  {
625  if (!dispatch(node->get_child<1>()).cst()) {
626  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p1 in antoine_psat is not a constant");
627  }
628  if (!dispatch(node->get_child<2>()).cst()) {
629  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p2 in antoine_psat is not a constant");
630  }
631  if (!dispatch(node->get_child<3>()).cst()) {
632  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p3 in antoine_psat is not a constant");
633  }
634  // antoine_psat = type 2
635  return mc::vapor_pressure(dispatch(node->get_child<0>()), 2, dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val(),
636  dispatch(node->get_child<3>()).num().val());
637  }
638 
639 
640  Var operator()(wagner_psat_node* node)
641  {
642  if (!dispatch(node->get_child<1>()).cst()) {
643  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p1 in wagner_psat is not a constant");
644  }
645  if (!dispatch(node->get_child<2>()).cst()) {
646  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p2 in wagner_psat is not a constant");
647  }
648  if (!dispatch(node->get_child<3>()).cst()) {
649  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p3 in wagner_psat is not a constant");
650  }
651  if (!dispatch(node->get_child<4>()).cst()) {
652  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p4 in wagner_psat is not a constant");
653  }
654  if (!dispatch(node->get_child<5>()).cst()) {
655  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p5 in wagner_psat is not a constant");
656  }
657  if (!dispatch(node->get_child<6>()).cst()) {
658  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p6 in wagner_psat is not a constant");
659  }
660  // wagner_psat = type 3
661  return mc::vapor_pressure(dispatch(node->get_child<0>()), 3, dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val(),
662  dispatch(node->get_child<3>()).num().val(), dispatch(node->get_child<4>()).num().val(), dispatch(node->get_child<5>()).num().val(),
663  dispatch(node->get_child<6>()).num().val());
664  }
665 
666 
667  Var operator()(ik_cape_psat_node* node)
668  {
669  if (!dispatch(node->get_child<1>()).cst()) {
670  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p1 in ik_cape_psat is not a constant");
671  }
672  if (!dispatch(node->get_child<2>()).cst()) {
673  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p2 in ik_cape_psat is not a constant");
674  }
675  if (!dispatch(node->get_child<3>()).cst()) {
676  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p3 in ik_cape_psat is not a constant");
677  }
678  if (!dispatch(node->get_child<4>()).cst()) {
679  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p4 in ik_cape_psat is not a constant");
680  }
681  if (!dispatch(node->get_child<5>()).cst()) {
682  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p5 in ik_cape_psat is not a constant");
683  }
684  if (!dispatch(node->get_child<6>()).cst()) {
685  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p6 in ik_cape_psat is not a constant");
686  }
687  if (!dispatch(node->get_child<7>()).cst()) {
688  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p7 in ik_cape_psat is not a constant");
689  }
690  if (!dispatch(node->get_child<8>()).cst()) {
691  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p8 in ik_cape_psat is not a constant");
692  }
693  if (!dispatch(node->get_child<9>()).cst()) {
694  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p9 in ik_cape_psat is not a constant");
695  }
696  if (!dispatch(node->get_child<10>()).cst()) {
697  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p10 in ik_cape_psat is not a constant");
698  }
699  // ik_cape_psat = type 4
700  return mc::vapor_pressure(dispatch(node->get_child<0>()), 4, dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val(),
701  dispatch(node->get_child<3>()).num().val(), dispatch(node->get_child<4>()).num().val(), dispatch(node->get_child<5>()).num().val(),
702  dispatch(node->get_child<6>()).num().val(), dispatch(node->get_child<7>()).num().val(), dispatch(node->get_child<8>()).num().val(),
703  dispatch(node->get_child<9>()).num().val(), dispatch(node->get_child<10>()).num().val());
704  }
705 
706 
707  Var operator()(aspen_hig_node* node)
708  {
709  if (!dispatch(node->get_child<1>()).cst()) {
710  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p1 in aspen_hig is not a constant");
711  }
712  if (!dispatch(node->get_child<2>()).cst()) {
713  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p2 in aspen_hig is not a constant");
714  }
715  if (!dispatch(node->get_child<3>()).cst()) {
716  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p3 in aspen_hig is not a constant");
717  }
718  if (!dispatch(node->get_child<4>()).cst()) {
719  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p4 in aspen_hig is not a constant");
720  }
721  if (!dispatch(node->get_child<5>()).cst()) {
722  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p5 in aspen_hig is not a constant");
723  }
724  if (!dispatch(node->get_child<6>()).cst()) {
725  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p6 in aspen_hig is not a constant");
726  }
727  if (!dispatch(node->get_child<7>()).cst()) {
728  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p7 in aspen_hig is not a constant");
729  }
730  // aspen_hig = type 1
731  return mc::ideal_gas_enthalpy(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val(), 1, dispatch(node->get_child<2>()).num().val(),
732  dispatch(node->get_child<3>()).num().val(), dispatch(node->get_child<4>()).num().val(), dispatch(node->get_child<5>()).num().val(),
733  dispatch(node->get_child<6>()).num().val(), dispatch(node->get_child<7>()).num().val());
734  }
735 
736 
737  Var operator()(nasa9_hig_node* node)
738  {
739  if (!dispatch(node->get_child<1>()).cst()) {
740  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p1 in nasa9_hig is not a constant");
741  }
742  if (!dispatch(node->get_child<2>()).cst()) {
743  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p2 in nasa9_hig is not a constant");
744  }
745  if (!dispatch(node->get_child<3>()).cst()) {
746  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p3 in nasa9_hig is not a constant");
747  }
748  if (!dispatch(node->get_child<4>()).cst()) {
749  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p4 in nasa9_hig is not a constant");
750  }
751  if (!dispatch(node->get_child<5>()).cst()) {
752  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p5 in nasa9_hig is not a constant");
753  }
754  if (!dispatch(node->get_child<6>()).cst()) {
755  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p6 in nasa9_hig is not a constant");
756  }
757  if (!dispatch(node->get_child<7>()).cst()) {
758  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p7 in nasa9_hig is not a constant");
759  }
760  if (!dispatch(node->get_child<8>()).cst()) {
761  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p8 in nasa9_hig is not a constant");
762  }
763  // nasa9_hig = type 2
764  return mc::ideal_gas_enthalpy(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val(), 2, dispatch(node->get_child<2>()).num().val(),
765  dispatch(node->get_child<3>()).num().val(), dispatch(node->get_child<4>()).num().val(), dispatch(node->get_child<5>()).num().val(),
766  dispatch(node->get_child<6>()).num().val(), dispatch(node->get_child<7>()).num().val(), dispatch(node->get_child<8>()).num().val());
767  }
768 
769 
770  Var operator()(dippr107_hig_node* node)
771  {
772  if (!dispatch(node->get_child<1>()).cst()) {
773  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p1 in dippr107_hig is not a constant");
774  }
775  if (!dispatch(node->get_child<2>()).cst()) {
776  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p2 in dippr107_hig is not a constant");
777  }
778  if (!dispatch(node->get_child<3>()).cst()) {
779  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p3 in dippr107_hig is not a constant");
780  }
781  if (!dispatch(node->get_child<4>()).cst()) {
782  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p4 in dippr107_hig is not a constant");
783  }
784  if (!dispatch(node->get_child<5>()).cst()) {
785  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p5 in dippr107_hig is not a constant");
786  }
787  if (!dispatch(node->get_child<6>()).cst()) {
788  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p6 in dippr107_hig is not a constant");
789  }
790  // dippr107_hig_node = type 3
791  return mc::ideal_gas_enthalpy(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val(), 3, dispatch(node->get_child<2>()).num().val(),
792  dispatch(node->get_child<3>()).num().val(), dispatch(node->get_child<4>()).num().val(), dispatch(node->get_child<5>()).num().val(),
793  dispatch(node->get_child<6>()).num().val());
794  }
795 
796 
797  Var operator()(dippr127_hig_node* node)
798  {
799  if (!dispatch(node->get_child<1>()).cst()) {
800  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p1 in dippr127_hig is not a constant");
801  }
802  if (!dispatch(node->get_child<2>()).cst()) {
803  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p2 in dippr127_hig is not a constant");
804  }
805  if (!dispatch(node->get_child<3>()).cst()) {
806  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p3 in dippr127_hig is not a constant");
807  }
808  if (!dispatch(node->get_child<4>()).cst()) {
809  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p4 in dippr127_hig is not a constant");
810  }
811  if (!dispatch(node->get_child<5>()).cst()) {
812  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p5 in dippr127_hig is not a constant");
813  }
814  if (!dispatch(node->get_child<6>()).cst()) {
815  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p6 in dippr127_hig is not a constant");
816  }
817  if (!dispatch(node->get_child<7>()).cst()) {
818  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p7 in dippr127_hig is not a constant");
819  }
820  if (!dispatch(node->get_child<8>()).cst()) {
821  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p8 in dippr127_hig is not a constant");
822  }
823  // dippr127_hig = type 4
824  return mc::ideal_gas_enthalpy(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val(), 4, dispatch(node->get_child<2>()).num().val(),
825  dispatch(node->get_child<3>()).num().val(), dispatch(node->get_child<4>()).num().val(), dispatch(node->get_child<5>()).num().val(),
826  dispatch(node->get_child<6>()).num().val(), dispatch(node->get_child<7>()).num().val(), dispatch(node->get_child<8>()).num().val());
827  }
828 
829 
830  Var operator()(antoine_tsat_node* node)
831  {
832  if (!dispatch(node->get_child<1>()).cst()) {
833  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p1 in antoine_tsat is not a constant");
834  }
835  if (!dispatch(node->get_child<2>()).cst()) {
836  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p2 in antoine_tsat is not a constant");
837  }
838  if (!dispatch(node->get_child<3>()).cst()) {
839  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p3 in antoine_tsat is not a constant");
840  }
841  // antoine_tsat = type 2
842  return mc::saturation_temperature(dispatch(node->get_child<0>()), 2, dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val(),
843  dispatch(node->get_child<3>()).num().val());
844  }
845 
846 
847  Var operator()(watson_dhvap_node* node)
848  {
849  if (!dispatch(node->get_child<1>()).cst()) {
850  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p1 in watson_dhvap is not a constant");
851  }
852  if (!dispatch(node->get_child<2>()).cst()) {
853  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p2 in watson_dhvap is not a constant");
854  }
855  if (!dispatch(node->get_child<3>()).cst()) {
856  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p3 in watson_dhvap is not a constant");
857  }
858  if (!dispatch(node->get_child<4>()).cst()) {
859  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p4 in watson_dhvap is not a constant");
860  }
861  if (!dispatch(node->get_child<5>()).cst()) {
862  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p5 in watson_dhvap is not a constant");
863  }
864  // watson_dhvap = type 1
865  return mc::enthalpy_of_vaporization(dispatch(node->get_child<0>()), 1, dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val(),
866  dispatch(node->get_child<3>()).num().val(), dispatch(node->get_child<4>()).num().val(), dispatch(node->get_child<5>()).num().val());
867  }
868 
869 
870  Var operator()(dippr106_dhvap_node* node)
871  {
872  if (!dispatch(node->get_child<1>()).cst()) {
873  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p1 in dippr106_dhvap is not a constant");
874  }
875  if (!dispatch(node->get_child<2>()).cst()) {
876  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p2 in dippr106_dhvap is not a constant");
877  }
878  if (!dispatch(node->get_child<3>()).cst()) {
879  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p3 in dippr106_dhvap is not a constant");
880  }
881  if (!dispatch(node->get_child<4>()).cst()) {
882  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p4 in dippr106_dhvap is not a constant");
883  }
884  if (!dispatch(node->get_child<5>()).cst()) {
885  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p5 in dippr106_dhvap is not a constant");
886  }
887  if (!dispatch(node->get_child<6>()).cst()) {
888  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p6 in dippr106_dhvap is not a constant");
889  }
890  // dippr106_dhvap = type 2
891  return mc::enthalpy_of_vaporization(dispatch(node->get_child<0>()), 2, dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val(),
892  dispatch(node->get_child<3>()).num().val(), dispatch(node->get_child<4>()).num().val(), dispatch(node->get_child<5>()).num().val(),
893  dispatch(node->get_child<6>()).num().val());
894  }
895 
896 
897  Var operator()(cost_turton_node* node)
898  {
899  if (!dispatch(node->get_child<1>()).cst()) {
900  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p1 in cost_turton is not a constant");
901  }
902  if (!dispatch(node->get_child<2>()).cst()) {
903  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p2 in cost_turton is not a constant");
904  }
905  if (!dispatch(node->get_child<3>()).cst()) {
906  throw MAiNGOException(" Error: MaingoEvaluator -- Parameter p3 in cost_turton is not a constant");
907  }
908  // cost_turton = type 1
909  return mc::cost_function(dispatch(node->get_child<0>()), 1, dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val(),
910  dispatch(node->get_child<3>()).num().val());
911  }
912 
913  Var operator()(covar_matern_1_node* node)
914  {
915  // covar_matern_1 = type 1
916  return mc::covariance_function(dispatch(node->get_child<0>()), 1);
917  }
918 
919  Var operator()(covar_matern_3_node* node)
920  {
921  // covar_matern_3 = type 1
922  return mc::covariance_function(dispatch(node->get_child<0>()), 2);
923  }
924 
925  Var operator()(covar_matern_5_node* node)
926  {
927  // covar_matern_5 = type 1
928  return mc::covariance_function(dispatch(node->get_child<0>()), 3);
929  }
930 
931  Var operator()(covar_sqrexp_node* node)
932  {
933  // covar_sqrexp = type 1
934  return mc::covariance_function(dispatch(node->get_child<0>()), 4);
935  }
936 
937  Var operator()(gpdf_node* node)
938  {
939  return mc::gaussian_probability_density_function(dispatch(node->get_child<0>()));
940  }
941 
942  Var operator()(nrtl_tau_node* node)
943  {
944  if (!dispatch(node->get_child<1>()).cst()) {
945  throw MAiNGOException(" Error: MaingoEvaluator -- Second argument in nrtl_tau is not a constant");
946  }
947  if (!dispatch(node->get_child<2>()).cst()) {
948  throw MAiNGOException(" Error: MaingoEvaluator -- Third argument in nrtl_tau is not a constant");
949  }
950  if (!dispatch(node->get_child<3>()).cst()) {
951  throw MAiNGOException(" Error: MaingoEvaluator -- Fourth argument in nrtl_tau is not a constant");
952  }
953  if (!dispatch(node->get_child<4>()).cst()) {
954  throw MAiNGOException(" Error: MaingoEvaluator -- Fifth argument in nrtl_tau is not a constant");
955  }
956  return mc::nrtl_tau(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val(),
957  dispatch(node->get_child<3>()).num().val(), dispatch(node->get_child<4>()).num().val());
958  }
959 
960 
961  Var operator()(nrtl_g_node* node)
962  {
963  if (!dispatch(node->get_child<1>()).cst()) {
964  throw MAiNGOException(" Error: MaingoEvaluator -- Second argument in nrtl_g is not a constant");
965  }
966  if (!dispatch(node->get_child<2>()).cst()) {
967  throw MAiNGOException(" Error: MaingoEvaluator -- Third argument in nrtl_g is not a constant");
968  }
969  if (!dispatch(node->get_child<3>()).cst()) {
970  throw MAiNGOException(" Error: MaingoEvaluator -- Fourth argument in nrtl_g is not a constant");
971  }
972  if (!dispatch(node->get_child<4>()).cst()) {
973  throw MAiNGOException(" Error: MaingoEvaluator -- Fifth argument in nrtl_g is not a constant");
974  }
975  if (!dispatch(node->get_child<5>()).cst()) {
976  throw MAiNGOException(" Error: MaingoEvaluator -- Sixth argument in nrtl_g is not a constant");
977  }
978  return mc::nrtl_G(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val(),
979  dispatch(node->get_child<3>()).num().val(), dispatch(node->get_child<4>()).num().val(), dispatch(node->get_child<5>()).num().val());
980  }
981 
982 
983  Var operator()(nrtl_gtau_node* node)
984  {
985  if (!dispatch(node->get_child<1>()).cst()) {
986  throw MAiNGOException(" Error: MaingoEvaluator -- Second argument in nrtl_gtau is not a constant");
987  }
988  if (!dispatch(node->get_child<2>()).cst()) {
989  throw MAiNGOException(" Error: MaingoEvaluator -- Third argument in nrtl_gtau is not a constant");
990  }
991  if (!dispatch(node->get_child<3>()).cst()) {
992  throw MAiNGOException(" Error: MaingoEvaluator -- Fourth argument in nrtl_gtau is not a constant");
993  }
994  if (!dispatch(node->get_child<4>()).cst()) {
995  throw MAiNGOException(" Error: MaingoEvaluator -- Fifth argument in nrtl_gtau is not a constant");
996  }
997  if (!dispatch(node->get_child<5>()).cst()) {
998  throw MAiNGOException(" Error: MaingoEvaluator -- Sixth argument in nrtl_gtau is not a constant");
999  }
1000  return mc::nrtl_Gtau(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val(),
1001  dispatch(node->get_child<3>()).num().val(), dispatch(node->get_child<4>()).num().val(), dispatch(node->get_child<5>()).num().val());
1002  }
1003 
1004 
1005  Var operator()(nrtl_gdtau_node* node)
1006  {
1007  if (!dispatch(node->get_child<1>()).cst()) {
1008  throw MAiNGOException(" Error: MaingoEvaluator -- Second argument in nrtl_gdtau is not a constant");
1009  }
1010  if (!dispatch(node->get_child<2>()).cst()) {
1011  throw MAiNGOException(" Error: MaingoEvaluator -- Third argument in nrtl_gdtau is not a constant");
1012  }
1013  if (!dispatch(node->get_child<3>()).cst()) {
1014  throw MAiNGOException(" Error: MaingoEvaluator -- Fourth argument in nrtl_gdtau is not a constant");
1015  }
1016  if (!dispatch(node->get_child<4>()).cst()) {
1017  throw MAiNGOException(" Error: MaingoEvaluator -- Fifth argument in nrtl_gdtau is not a constant");
1018  }
1019  if (!dispatch(node->get_child<5>()).cst()) {
1020  throw MAiNGOException(" Error: MaingoEvaluator -- Sixth argument in nrtl_gdtau is not a constant");
1021  }
1022  return mc::nrtl_Gdtau(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val(),
1023  dispatch(node->get_child<3>()).num().val(), dispatch(node->get_child<4>()).num().val(), dispatch(node->get_child<5>()).num().val());
1024  }
1025 
1026 
1027  Var operator()(nrtl_dgtau_node* node)
1028  {
1029  if (!dispatch(node->get_child<1>()).cst()) {
1030  throw MAiNGOException(" Error: MaingoEvaluator -- Second argument in nrtl_dgtau is not a constant");
1031  }
1032  if (!dispatch(node->get_child<2>()).cst()) {
1033  throw MAiNGOException(" Error: MaingoEvaluator -- Third argument in nrtl_dgtau is not a constant");
1034  }
1035  if (!dispatch(node->get_child<3>()).cst()) {
1036  throw MAiNGOException(" Error: MaingoEvaluator -- Fourth argument in nrtl_dgtau is not a constant");
1037  }
1038  if (!dispatch(node->get_child<4>()).cst()) {
1039  throw MAiNGOException(" Error: MaingoEvaluator -- Fifth argument in nrtl_dgtau is not a constant");
1040  }
1041  if (!dispatch(node->get_child<5>()).cst()) {
1042  throw MAiNGOException(" Error: MaingoEvaluator -- Sixth argument in nrtl_dgtau is not a constant");
1043  }
1044  return mc::nrtl_dGtau(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()).num().val(), dispatch(node->get_child<2>()).num().val(),
1045  dispatch(node->get_child<3>()).num().val(), dispatch(node->get_child<4>()).num().val(), dispatch(node->get_child<5>()).num().val());
1046  }
1047 
1048 
1049  Var operator()(norm2_node* node)
1050  {
1051  return mc::euclidean_norm_2d(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()));
1052  }
1053 
1054 
1055  Var operator()(abs_node* node)
1056  {
1057  return mc::fabs(dispatch(node->get_child<0>()));
1058  }
1059 
1060 
1061  Var operator()(xabsx_node* node)
1062  {
1063  return mc::fabsx_times_x(dispatch(node->get_child<0>()));
1064  }
1065 
1066 
1067  Var operator()(xlogx_node* node)
1068  {
1069  return mc::xlog(dispatch(node->get_child<0>()));
1070  }
1071 
1072 
1073  Var operator()(cosh_node* node)
1074  {
1075  return mc::cosh(dispatch(node->get_child<0>()));
1076  }
1077 
1078 
1079  Var operator()(sinh_node* node)
1080  {
1081  return mc::sinh(dispatch(node->get_child<0>()));
1082  }
1083 
1084 
1085  Var operator()(tanh_node* node)
1086  {
1087  return mc::tanh(dispatch(node->get_child<0>()));
1088  }
1089 
1090 
1091  Var operator()(coth_node* node)
1092  {
1093  return mc::coth(dispatch(node->get_child<0>()));
1094  }
1095 
1096 
1097  Var operator()(acosh_node* node)
1098  {
1099  return mc::Op<mc::FFVar>::acosh(dispatch(node->get_child<0>()));
1100  }
1101 
1102 
1103  Var operator()(asinh_node* node)
1104  {
1105  return mc::Op<mc::FFVar>::asinh(dispatch(node->get_child<0>()));
1106  }
1107 
1108 
1109  Var operator()(atanh_node* node)
1110  {
1111  return mc::Op<mc::FFVar>::atanh(dispatch(node->get_child<0>()));
1112  }
1113 
1114 
1115  Var operator()(acoth_node* node)
1116  {
1117  return mc::Op<mc::FFVar>::acoth(dispatch(node->get_child<0>()));
1118  }
1119 
1120 
1121  Var operator()(erf_node* node)
1122  {
1123  return mc::erf(dispatch(node->get_child<0>()));
1124  }
1125 
1126 
1127  Var operator()(erfc_node* node)
1128  {
1129  return mc::erfc(dispatch(node->get_child<0>()));
1130  }
1131 
1132 
1133  Var operator()(pos_node* node)
1134  {
1135  return mc::pos(dispatch(node->get_child<0>()));
1136  }
1137 
1138 
1139  Var operator()(neg_node* node)
1140  {
1141  return mc::neg(dispatch(node->get_child<0>()));
1142  }
1143 
1144 
1145  Var operator()(rlmtd_node* node)
1146  {
1147  return mc::rlmtd(dispatch(node->get_child<0>()), dispatch(node->get_child<1>()));
1148  }
1149 
1150 
1151  Var operator()(xexpy_node* node)
1152  {
1153  return mc::expx_times_y(dispatch(node->get_child<1>()), dispatch(node->get_child<0>()));
1154  }
1155 
1156 
1157  Var operator()(schroeder_ethanol_p_node* node)
1158  {
1159  return mc::p_sat_ethanol_schroeder(dispatch(node->get_child<0>()));
1160  }
1161 
1162 
1163  Var operator()(schroeder_ethanol_rhovap_node* node)
1164  {
1165  return mc::rho_vap_sat_ethanol_schroeder(dispatch(node->get_child<0>()));
1166  }
1167 
1168 
1169  Var operator()(schroeder_ethanol_rholiq_node* node)
1170  {
1171  return mc::rho_liq_sat_ethanol_schroeder(dispatch(node->get_child<0>()));
1172  }
1173 
1174 
1175  Var operator()(mid_node* node)
1176  {
1177  Var arg1 = dispatch(node->get_child<0>());
1178  Var arg2 = dispatch(node->get_child<1>());
1179  Var arg3 = dispatch(node->get_child<2>());
1180  return mc::min(mc::max(arg1, arg2), mc::min(mc::max(arg2, arg3), mc::max(arg3, arg1)));
1181  }
1182 
1183 
1184  template <typename TType>
1185  Var operator()(sum_node<TType>* node)
1186  {
1187  auto elements = dispatch(node->template get_child<0>());
1188  _symbols.push_scope();
1189  Var result = 0;
1190  for (auto it = elements.begin(); it != elements.end(); ++it) {
1191  _symbols.define(node->name, new parameter_symbol<TType>(node->name, *it));
1192  result += dispatch(node->template get_child<1>());
1193  }
1194  _symbols.pop_scope();
1195  return result;
1196  }
1197 
1198 
1199  ConstraintContainer operator()(negation_node* node)
1200  {
1201  throw MAiNGOException(" Error: MaingoEvaluator -- Evaluated unsupported negation expression");
1202  return ConstraintContainer();
1203  }
1204 
1205 
1206  ConstraintContainer operator()(equal_node<real<0>>* node)
1207  {
1208  ConstraintContainer result;
1209  result.eq.push_back(dispatch(node->get_child<0>()) - dispatch(node->get_child<1>()));
1210  return result;
1211  }
1212 
1213 
1214  ConstraintContainer operator()(less_node<real<0>>* node)
1215  {
1216  throw MAiNGOException(" Error: MaingoEvaluator -- Evaluated unsupported strict inequality expression");
1217  return ConstraintContainer();
1218  }
1219 
1220 
1221  ConstraintContainer operator()(less_equal_node<real<0>>* node)
1222  {
1223  ConstraintContainer result;
1224  result.ineq.push_back(dispatch(node->get_child<0>()) - dispatch(node->get_child<1>()));
1225  return result;
1226  }
1227 
1228 
1229  ConstraintContainer operator()(greater_node<real<0>>* node)
1230  {
1231  throw MAiNGOException(" Error: MaingoEvaluator -- Evaluated unsupported strict inequality expression");
1232  return ConstraintContainer();
1233  }
1234 
1235 
1236  ConstraintContainer operator()(greater_equal_node<real<0>>* node)
1237  {
1238  ConstraintContainer result;
1239  result.ineq.push_back(dispatch(node->get_child<1>()) - dispatch(node->get_child<0>()));
1240  return result;
1241  }
1242 
1243 
1244  ConstraintContainer operator()(equal_node<ale::index<0>>* node)
1245  {
1246  throw MAiNGOException(" Error: MaingoEvaluator -- Evaluated unsupported index comparison expression");
1247  return ConstraintContainer();
1248  }
1249 
1250 
1251  ConstraintContainer operator()(less_node<ale::index<0>>* node)
1252  {
1253  throw MAiNGOException(" Error: MaingoEvaluator -- Evaluated unsupported index comparison expression");
1254  return ConstraintContainer();
1255  }
1256 
1257 
1258  ConstraintContainer operator()(less_equal_node<ale::index<0>>* node)
1259  {
1260  throw MAiNGOException(" Error: MaingoEvaluator -- Evaluated unsupported index comparison expression");
1261  return ConstraintContainer();
1262  }
1263 
1264 
1265  ConstraintContainer operator()(greater_node<ale::index<0>>* node)
1266  {
1267  throw MAiNGOException(" Error: MaingoEvaluator -- Evaluated unsupported index comparison expression");
1268  return ConstraintContainer();
1269  }
1270 
1271 
1272  ConstraintContainer operator()(greater_equal_node<ale::index<0>>* node)
1273  {
1274  throw MAiNGOException(" Error: MaingoEvaluator -- Evaluated unsupported index comparison expression");
1275  return ConstraintContainer();
1276  }
1277 
1278 
1279  ConstraintContainer operator()(disjunction_node* node)
1280  {
1281  throw MAiNGOException(" Error: MaingoEvaluator -- Evaluated unsupported disjunction expression");
1282  return ConstraintContainer();
1283  }
1284 
1285 
1286  ConstraintContainer operator()(conjunction_node* node)
1287  {
1288  throw MAiNGOException(" Error: MaingoEvaluator -- Evaluated unsupported conjunction expression");
1289  return ConstraintContainer();
1290  }
1291 
1292 
1293  ConstraintContainer operator()(element_node* node)
1294  {
1295  throw MAiNGOException(" Error: MaingoEvaluator -- Evaluated unsupported general logical expression");
1296  return ConstraintContainer();
1297  };
1298 
1299 
1300  template <typename TType>
1301  ConstraintContainer operator()(forall_node<TType>* node)
1302  {
1303  ConstraintContainer result;
1304  auto elements = dispatch(node->template get_child<0>());
1305  _symbols.push_scope();
1306  for (auto it = elements.begin(); it != elements.end(); ++it) {
1307  _symbols.define(node->name, new parameter_symbol<TType>(node->name, *it));
1308  auto cons = dispatch(node->template get_child<1>());
1309  result.eq.insert(result.eq.end(), cons.eq.begin(), cons.eq.end());
1310  result.ineq.insert(result.ineq.end(), cons.ineq.begin(), cons.ineq.end());
1311  }
1312  _symbols.pop_scope();
1313  return result;
1314  }
1317  private:
1318  symbol_table& _symbols; /*< symbol_table for symbol lookup*/
1319  const std::vector<Var>& _variables; /*< MAiNGO variable vector*/
1320  const std::unordered_map<std::string, int>& _positions; /*< ALE symbol positions in MAiNGO variable vector*/
1321 };
1322 
1323 
1324 } // namespace maingo
symbol_table & _symbols
Definition: MAiNGOevaluator.h:1318
-
Var operator()(parameter_symbol< real< 0 >> *sym)
Definition: MAiNGOevaluator.h:192
-
Var operator()(set_min_node< TType > *node)
Definition: MAiNGOevaluator.h:377
-
const std::unordered_map< std::string, int > & _positions
Definition: MAiNGOevaluator.h:1320
-
Var operator()(antoine_psat_node *node)
Definition: MAiNGOevaluator.h:623
-
Var operator()(sum_div_node *node)
Definition: MAiNGOevaluator.h:276
-
Var operator()(nrtl_gtau_node *node)
Definition: MAiNGOevaluator.h:983
-
tensor< Var, IDim > operator()(parameter_symbol< real< IDim >> *sym)
Definition: MAiNGOevaluator.h:184
-
Var operator()(addition_node *node)
Definition: MAiNGOevaluator.h:266
-
Var operator()(variable_symbol< real< 0 >> *sym)
Definition: MAiNGOevaluator.h:223
-
Var operator()(nasa9_hig_node *node)
Definition: MAiNGOevaluator.h:737
-
Var operator()(mid_node *node)
Definition: MAiNGOevaluator.h:1175
-
ConstraintContainer operator()(expression_symbol< boolean< 0 >> *sym)
Definition: MAiNGOevaluator.h:235
-
Var operator()(aspen_hig_node *node)
Definition: MAiNGOevaluator.h:707
-
Var operator()(sum_node< TType > *node)
Definition: MAiNGOevaluator.h:1185
-
ConstraintContainer operator()(negation_node *node)
Definition: MAiNGOevaluator.h:1199
-
Var operator()(ale::squash_node *node)
Definition: MAiNGOevaluator.h:526
-
Var operator()(covar_sqrexp_node *node)
Definition: MAiNGOevaluator.h:931
-
Var operator()(parameter_node< real< 0 >> *node)
Definition: MAiNGOevaluator.h:166
-
Var operator()(tan_node *node)
Definition: MAiNGOevaluator.h:460
-
ConstraintContainer operator()(disjunction_node *node)
Definition: MAiNGOevaluator.h:1279
-
ConstraintContainer operator()(less_node< ale::index< 0 >> *node)
Definition: MAiNGOevaluator.h:1251
-
Var operator()(multiplication_node *node)
Definition: MAiNGOevaluator.h:326
-
Var operator()(cosh_node *node)
Definition: MAiNGOevaluator.h:1073
-
std::vector< Var > eq
Definition: MAiNGOevaluator.h:34
- -
Var operator()(ub_func_node *node)
Definition: MAiNGOevaluator.h:505
-
ConstraintContainer operator()(greater_node< real< 0 >> *node)
Definition: MAiNGOevaluator.h:1229
-
Var operator()(set_max_node< TType > *node)
Definition: MAiNGOevaluator.h:398
-
Var operator()(cos_node *node)
Definition: MAiNGOevaluator.h:448
-
Var operator()(acoth_node *node)
Definition: MAiNGOevaluator.h:1115
-
Var operator()(cost_turton_node *node)
Definition: MAiNGOevaluator.h:897
-
ConstraintContainer operator()(greater_equal_node< ale::index< 0 >> *node)
Definition: MAiNGOevaluator.h:1272
-
Var operator()(xlog_sum_node *node)
Definition: MAiNGOevaluator.h:301
-
Var operator()(sinh_node *node)
Definition: MAiNGOevaluator.h:1079
-
Var dispatch(expression< real< 0 >> &expr)
Definition: MAiNGOevaluator.h:67
-
const std::vector< Var > & _variables
Definition: MAiNGOevaluator.h:1319
-
tensor< Var, IDim > operator()(entry_node< real< IDim >> *node)
Definition: MAiNGOevaluator.h:242
-
Var operator()(nrtl_g_node *node)
Definition: MAiNGOevaluator.h:961
-
Var operator()(ale::af_ei_node *node)
Definition: MAiNGOevaluator.h:547
-
ConstraintContainer operator()(greater_node< ale::index< 0 >> *node)
Definition: MAiNGOevaluator.h:1265
-
std::vector< Var > ineq
Definition: MAiNGOevaluator.h:35
-
Var operator()(bounding_func_node *node)
Definition: MAiNGOevaluator.h:514
-
Var operator()(abs_node *node)
Definition: MAiNGOevaluator.h:1055
-
Var operator()(xexpy_node *node)
Definition: MAiNGOevaluator.h:1151
-
Var operator()(exponentiation_node *node)
Definition: MAiNGOevaluator.h:336
-
ConstraintContainer operator()(constant_node< boolean< 0 >> *node)
Definition: MAiNGOevaluator.h:149
-
Var operator()(covar_matern_1_node *node)
Definition: MAiNGOevaluator.h:913
-
Containter for constraint evaluation.
Definition: MAiNGOevaluator.h:33
-
set< TType, 0 >::basic_type dispatch(value_node< set< TType, 0 >> *node)
Definition: MAiNGOevaluator.h:91
-
Var operator()(ale::regnormal_node *node)
Definition: MAiNGOevaluator.h:565
-
Var operator()(gpdf_node *node)
Definition: MAiNGOevaluator.h:937
-
Var operator()(nrtl_dtau_node *node)
Definition: MAiNGOevaluator.h:577
-
tensor< Var, IDim > operator()(parameter_node< real< IDim >> *node)
Definition: MAiNGOevaluator.h:157
-
Var operator()(schroeder_ethanol_p_node *node)
Definition: MAiNGOevaluator.h:1157
-
Var operator()(erfc_node *node)
Definition: MAiNGOevaluator.h:1127
-
Var operator()(expression_symbol< real< 0 >> *sym)
Definition: MAiNGOevaluator.h:229
-
Var operator()(arh_node *node)
Definition: MAiNGOevaluator.h:487
-
Var operator()(asinh_node *node)
Definition: MAiNGOevaluator.h:1103
-
Var operator()(schroeder_ethanol_rhovap_node *node)
Definition: MAiNGOevaluator.h:1163
-
ConstraintContainer operator()(less_node< real< 0 >> *node)
Definition: MAiNGOevaluator.h:1214
-
mc::FFVar Var
Definition: MAiNGOevaluator.h:27
-
ConstraintContainer operator()(conjunction_node *node)
Definition: MAiNGOevaluator.h:1286
-
Var operator()(nrtl_tau_node *node)
Definition: MAiNGOevaluator.h:942
-
Evaluates ALE expressions to Var.
Definition: MAiNGOevaluator.h:42
-
Var operator()(watson_dhvap_node *node)
Definition: MAiNGOevaluator.h:847
-
Var operator()(norm2_node *node)
Definition: MAiNGOevaluator.h:1049
-
Var operator()(coth_node *node)
Definition: MAiNGOevaluator.h:1091
-
ConstraintContainer operator()(greater_equal_node< real< 0 >> *node)
Definition: MAiNGOevaluator.h:1236
-
TReturn dispatch(value_node< TType > *node)
Definition: MAiNGOevaluator.h:78
-
Var operator()(antoine_tsat_node *node)
Definition: MAiNGOevaluator.h:830
-
ConstraintContainer operator()(parameter_node< boolean< 0 >> *node)
Definition: MAiNGOevaluator.h:176
-
namespace holding all essentials of MAiNGO
Definition: aleModel.h:25
-
Var operator()(neg_node *node)
Definition: MAiNGOevaluator.h:1139
-
Var operator()(lb_func_node *node)
Definition: MAiNGOevaluator.h:496
-
Var dispatch(value_node< real< 0 >> *node)
Definition: MAiNGOevaluator.h:105
-
Var operator()(inverse_node *node)
Definition: MAiNGOevaluator.h:260
-
ale::index< IDim >::ref_type dispatch(value_node< ale::index< IDim >> *node)
Definition: MAiNGOevaluator.h:84
-
ConstraintContainer operator()(less_equal_node< real< 0 >> *node)
Definition: MAiNGOevaluator.h:1221
-
Var operator()(atan_node *node)
Definition: MAiNGOevaluator.h:466
-
Var operator()(dippr127_hig_node *node)
Definition: MAiNGOevaluator.h:797
-
Var operator()(xabsx_node *node)
Definition: MAiNGOevaluator.h:1061
- -
Var operator()(dippr106_dhvap_node *node)
Definition: MAiNGOevaluator.h:870
-
ConstraintContainer dispatch(expression< boolean< 0 >> &expr)
Definition: MAiNGOevaluator.h:72
-
Var operator()(tanh_node *node)
Definition: MAiNGOevaluator.h:1085
-
Var operator()(log_node *node)
Definition: MAiNGOevaluator.h:424
-
Var operator()(schroeder_ethanol_rholiq_node *node)
Definition: MAiNGOevaluator.h:1169
-
Var operator()(xlogx_node *node)
Definition: MAiNGOevaluator.h:1067
-
Var dispatch(value_symbol< real< 0 >> *sym)
Definition: MAiNGOevaluator.h:123
-
mc::FFVar nrtl_tau(const mc::FFVar &T, const std::vector< double > p)
Definition: functionWrapper.h:200
-
Var operator()(xexpax_node *node)
Definition: MAiNGOevaluator.h:478
-
Var operator()(covar_matern_3_node *node)
Definition: MAiNGOevaluator.h:919
-
ConstraintContainer operator()(equal_node< real< 0 >> *node)
Definition: MAiNGOevaluator.h:1206
-
Var operator()(min_node *node)
Definition: MAiNGOevaluator.h:346
-
Var operator()(lmtd_node *node)
Definition: MAiNGOevaluator.h:472
-
ConstraintContainer dispatch(value_node< boolean< 0 >> *node)
Definition: MAiNGOevaluator.h:111
-
Var operator()(sqrt_node *node)
Definition: MAiNGOevaluator.h:430
-
ConstraintContainer operator()(equal_node< ale::index< 0 >> *node)
Definition: MAiNGOevaluator.h:1244
-
ConstraintContainer operator()(element_node *node)
Definition: MAiNGOevaluator.h:1293
-
Var operator()(acosh_node *node)
Definition: MAiNGOevaluator.h:1097
-
mc::FFVar nrtl_dtau(const mc::FFVar &T, const std::vector< double > p)
Definition: functionWrapper.h:207
-
Var operator()(atanh_node *node)
Definition: MAiNGOevaluator.h:1109
-
Var operator()(dippr107_hig_node *node)
Definition: MAiNGOevaluator.h:770
-
Var operator()(nrtl_dgtau_node *node)
Definition: MAiNGOevaluator.h:1027
-
Var operator()(rlmtd_node *node)
Definition: MAiNGOevaluator.h:1145
-
MaingoEvaluator(symbol_table &symbols, const std::vector< Var > &variables, const std::unordered_map< std::string, int > &positions)
Constructor.
Definition: MAiNGOevaluator.h:52
-
Var operator()(ik_cape_psat_node *node)
Definition: MAiNGOevaluator.h:667
-
ConstraintContainer operator()(forall_node< TType > *node)
Definition: MAiNGOevaluator.h:1301
-
Var operator()(covar_matern_5_node *node)
Definition: MAiNGOevaluator.h:925
-
tensor< Var, IDim > dispatch(value_symbol< real< IDim >> *sym)
Definition: MAiNGOevaluator.h:118
-
This class defines the exceptions thrown by MAiNGO.
Definition: MAiNGOException.h:35
-
Var operator()(max_node *node)
Definition: MAiNGOevaluator.h:361
-
Var operator()(asin_node *node)
Definition: MAiNGOevaluator.h:442
-
ConstraintContainer operator()(less_equal_node< ale::index< 0 >> *node)
Definition: MAiNGOevaluator.h:1258
-
Var operator()(nrtl_gdtau_node *node)
Definition: MAiNGOevaluator.h:1005
-
tensor< Var, IDim > dispatch(value_node< real< IDim >> *node)
Definition: MAiNGOevaluator.h:99
-
Var operator()(minus_node *node)
Definition: MAiNGOevaluator.h:254
-
Var operator()(entry_node< real< 0 >> *node)
Definition: MAiNGOevaluator.h:248
-
Var operator()(ale::af_lcb_node *node)
Definition: MAiNGOevaluator.h:538
-
Var operator()(exp_node *node)
Definition: MAiNGOevaluator.h:418
- -
Var operator()(sin_node *node)
Definition: MAiNGOevaluator.h:436
-
Var operator()(ale::af_pi_node *node)
Definition: MAiNGOevaluator.h:556
-
Var operator()(ext_antoine_psat_node *node)
Definition: MAiNGOevaluator.h:593
-
Var operator()(constant_node< real< 0 >> *node)
Definition: MAiNGOevaluator.h:143
-
tensor< Var, IDim > operator()(constant_node< real< IDim >> *node)
Definition: MAiNGOevaluator.h:135
-
Var operator()(acos_node *node)
Definition: MAiNGOevaluator.h:454
-
Var operator()(erf_node *node)
Definition: MAiNGOevaluator.h:1121
-
Var operator()(wagner_psat_node *node)
Definition: MAiNGOevaluator.h:640
-
tensor< Var, IDim > operator()(variable_symbol< real< IDim >> *sym)
Definition: MAiNGOevaluator.h:199
-
Var operator()(pos_node *node)
Definition: MAiNGOevaluator.h:1133
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_ogetter_functions_8cpp.html b/doc/html/_m_ai_n_g_ogetter_functions_8cpp.html deleted file mode 100644 index b56f1ad1b69f24f655e9182e9153d5430c3e3be3..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_ogetter_functions_8cpp.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/src/MAiNGOgetterFunctions.cpp File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGOgetterFunctions.cpp File Reference
-
-
-
#include "MAiNGO.h"
-#include "MAiNGOException.h"
-#include "bab.h"
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_omodel_8h.html b/doc/html/_m_ai_n_g_omodel_8h.html deleted file mode 100644 index 39a30e00a683d051887c6a3cb869fc9c089cd73c..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_omodel_8h.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/MAiNGOmodel.h File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
- -
-
MAiNGOmodel.h File Reference
-
-
-
#include "evaluationContainer.h"
-#include "babOptVar.h"
-#include "babUtils.h"
-#include "ffunc.hpp"
-#include "functionWrapper.h"
-#include <vector>
-
-

Go to the source code of this file.

- - - - - -

-Classes

class  maingo::MAiNGOmodel
 This class is the base class for models to be solved by MAiNGO. More...
 
- - - - -

-Namespaces

 maingo
 namespace holding all essentials of MAiNGO
 
- - - - - - - -

-Typedefs

using maingo::OptimizationVariable = babBase::OptimizationVariable
 
using maingo::Bounds = babBase::Bounds
 
using maingo::VT = babBase::enums::VT
 
- - - - - - - -

-Variables

constexpr VT maingo::VT_CONTINUOUS = babBase::enums::VT_CONTINUOUS
 
constexpr VT maingo::VT_BINARY = babBase::enums::VT_BINARY
 
constexpr VT maingo::VT_INTEGER = babBase::enums::VT_INTEGER
 
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_omodel_8h.js b/doc/html/_m_ai_n_g_omodel_8h.js deleted file mode 100644 index 5f8957bd3a34441f229ccbd552411035e82c8fc3..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_omodel_8h.js +++ /dev/null @@ -1,10 +0,0 @@ -var _m_ai_n_g_omodel_8h = -[ - [ "MAiNGOmodel", "classmaingo_1_1_m_ai_n_g_omodel.html", "classmaingo_1_1_m_ai_n_g_omodel" ], - [ "Bounds", "_m_ai_n_g_omodel_8h.html#a56be7240143795082f52dcb10cb2d1ba", null ], - [ "OptimizationVariable", "_m_ai_n_g_omodel_8h.html#adf4533c14585b7b44a5849066d6637cc", null ], - [ "VT", "_m_ai_n_g_omodel_8h.html#a6754e89435e018272f9b618e78f255f0", null ], - [ "VT_BINARY", "_m_ai_n_g_omodel_8h.html#a2636675161b046fa4c46354e7496b821", null ], - [ "VT_CONTINUOUS", "_m_ai_n_g_omodel_8h.html#a89cab929c81b85f38d710492c504a2aa", null ], - [ "VT_INTEGER", "_m_ai_n_g_omodel_8h.html#a041341062af0bec7f553f388a88f63fc", null ] -]; \ No newline at end of file diff --git a/doc/html/_m_ai_n_g_omodel_8h_source.html b/doc/html/_m_ai_n_g_omodel_8h_source.html deleted file mode 100644 index c9b8eac5d70b9589528281ce8dc01b9df924e731..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_omodel_8h_source.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/MAiNGOmodel.h Source File - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGOmodel.h
-
-
-Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2019 Process Systems Engineering (AVT.SVT), RWTH Aachen University
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License 2.0 which is available at
6  * http://www.eclipse.org/legal/epl-2.0.
7  *
8  * SPDX-License-Identifier: EPL-2.0
9  *
10  **********************************************************************************/
11 
12 #pragma once
13 
14 #include "evaluationContainer.h"
15 
16 #include "babOptVar.h"
17 #include "babUtils.h"
18 
19 #include "ffunc.hpp"
20 #include "functionWrapper.h"
21 
22 
23 #include <vector>
24 
25 
26 // Using declarations of all additional functions defined in MC++ for a comfortable use of these functions in the model
27 using mc::acquisition_function;
28 using mc::arh;
29 using mc::bounding_func;
30 using mc::cost_function;
31 using mc::covariance_function;
32 using mc::enthalpy_of_vaporization;
33 using mc::euclidean_norm_2d;
34 using mc::expx_times_y;
35 using mc::fabsx_times_x;
36 using mc::gaussian_probability_density_function;
37 using mc::iapws;
38 using mc::ideal_gas_enthalpy;
39 using mc::lb_func;
40 using mc::lmtd;
41 using mc::mc_print;
42 using mc::neg;
43 using mc::nrtl_dGtau;
44 using mc::nrtl_dtau;
45 using mc::nrtl_G;
46 using mc::nrtl_Gdtau;
47 using mc::nrtl_Gtau;
48 using mc::nrtl_tau;
49 using mc::p_sat_ethanol_schroeder;
50 using mc::pos;
51 using mc::regnormal;
52 using mc::rho_liq_sat_ethanol_schroeder;
53 using mc::rho_vap_sat_ethanol_schroeder;
54 using mc::rlmtd;
55 using mc::saturation_temperature;
56 using mc::sqr;
57 using mc::squash_node;
58 using mc::sum_div;
59 using mc::ub_func;
60 using mc::vapor_pressure;
61 using mc::xexpax;
62 using mc::xlog;
63 using mc::xlog_sum;
64 using std::max;
65 using std::min;
66 
67 
72 namespace maingo {
73 
87 class MAiNGOmodel {
88 
89  public:
90  using Var = mc::FFVar;
95  virtual ~MAiNGOmodel() {}
96 
102  virtual EvaluationContainer evaluate(const std::vector<Var> &optVars) = 0;
103 
107  virtual std::vector<OptimizationVariable> get_variables() = 0;
108 
112  virtual std::vector<double> get_initial_point() { return std::vector<double>(); }
113 
114  private:
115 };
116 
117 
118 } // namespace maingo
Definition: babOptVar.h:46
-
virtual EvaluationContainer evaluate(const std::vector< Var > &optVars)=0
Virtual function which has to be implemented by the user in order to enable evaluation of the model...
- -
Auxiliary struct for representing bounds on an optimization variable.
Definition: babBounds.h:32
-
Definition: babOptVar.h:44
-
Class for representing an optimization variable specified by the user.
Definition: babOptVar.h:60
-
constexpr VT VT_INTEGER
Definition: MAiNGOmodel.h:79
-
Struct for storing the values returned by model evaluation at the given point "var".
Definition: evaluationContainer.h:208
-
This class is the base class for models to be solved by MAiNGO.
Definition: MAiNGOmodel.h:87
-
constexpr VT VT_CONTINUOUS
Definition: MAiNGOmodel.h:77
-
namespace holding all essentials of MAiNGO
Definition: aleModel.h:25
-
mc::FFVar Var
Definition: MAiNGOmodel.h:90
-
virtual std::vector< OptimizationVariable > get_variables()=0
Virtual function which has to be implemented by the user in order to enable getting data on optimizat...
- -
virtual std::vector< double > get_initial_point()
Virtual function which has to be implemented by the user in order to enable getting data on the initi...
Definition: MAiNGOmodel.h:112
-
mc::FFVar nrtl_tau(const mc::FFVar &T, const std::vector< double > p)
Definition: functionWrapper.h:200
-
mc::FFVar nrtl_dtau(const mc::FFVar &T, const std::vector< double > p)
Definition: functionWrapper.h:207
-
babBase::OptimizationVariable OptimizationVariable
Definition: MAiNGOmodel.h:74
- -
VT
Enum for representing the Variable Type of an optimization variable as specified by the user...
Definition: babOptVar.h:43
-
constexpr VT VT_BINARY
Definition: MAiNGOmodel.h:78
-
virtual ~MAiNGOmodel()
Destructor.
Definition: MAiNGOmodel.h:95
-
babBase::Bounds Bounds
Definition: MAiNGOmodel.h:75
- -
Definition: babOptVar.h:45
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_omodel_eps_con_8cpp.html b/doc/html/_m_ai_n_g_omodel_eps_con_8cpp.html deleted file mode 100644 index 1455a276e37a77632fba69aa86a4233da00795ca..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_omodel_eps_con_8cpp.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/src/MAiNGOmodelEpsCon.cpp File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
- -
-
MAiNGOmodelEpsCon.cpp File Reference
-
-
-
#include "MAiNGOmodelEpsCon.h"
-#include "MAiNGOException.h"
-#include <string>
-
- - - - -

-Namespaces

 maingo
 namespace holding all essentials of MAiNGO
 
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_omodel_eps_con_8h.html b/doc/html/_m_ai_n_g_omodel_eps_con_8h.html deleted file mode 100644 index 7782a6a29d31c89bdcd9a43dc14903dc7603d273..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_omodel_eps_con_8h.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/MAiNGOmodelEpsCon.h File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
- -
-
MAiNGOmodelEpsCon.h File Reference
-
-
-
#include "MAiNGOmodel.h"
-
-

Go to the source code of this file.

- - - - - -

-Classes

class  maingo::MAiNGOmodelEpsCon
 This class is the base class for implementing bi-objective problems. More...
 
- - - - -

-Namespaces

 maingo
 namespace holding all essentials of MAiNGO
 
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_omodel_eps_con_8h_source.html b/doc/html/_m_ai_n_g_omodel_eps_con_8h_source.html deleted file mode 100644 index 413001070db035779322b307794e1de1a1fe25a3..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_omodel_eps_con_8h_source.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/MAiNGOmodelEpsCon.h Source File - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGOmodelEpsCon.h
-
-
-Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2019 Process Systems Engineering (AVT.SVT), RWTH Aachen University
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License 2.0 which is available at
6  * http://www.eclipse.org/legal/epl-2.0.
7  *
8  * SPDX-License-Identifier: EPL-2.0
9  *
10  **********************************************************************************/
11 
12 #pragma once
13 
14 #include "MAiNGOmodel.h"
15 
16 
21 namespace maingo {
22 
23 
31 
32  public:
36  virtual ~MAiNGOmodelEpsCon() {}
37 
43  virtual EvaluationContainer evaluate_user_model(const std::vector<Var> &optVars) = 0;
44 
48  virtual std::vector<OptimizationVariable> get_variables() = 0;
49 
55  EvaluationContainer evaluate(const std::vector<Var> &optVars) final;
56 
60  virtual std::vector<double> get_initial_point() { return std::vector<double>(); }
61 
67  void set_epsilon(const std::vector<double> &epsilon)
68  {
69  _epsilon = epsilon;
70  }
71 
77  void set_objective_index(const size_t objectiveIndex)
78  {
79  _objectiveIndex = objectiveIndex;
80  }
81 
87  void set_single_objective(bool singleObjective)
88  {
89  _singleObjective = singleObjective;
90  }
91 
92  private:
93  std::vector<double> _epsilon;
94  size_t _objectiveIndex;
95  bool _singleObjective = true;
96 };
97 
98 
99 } // end namespace maingo
void set_single_objective(bool singleObjective)
Function for setting the _singleObjective flag.
Definition: MAiNGOmodelEpsCon.h:87
-
This class is the base class for implementing bi-objective problems.
Definition: MAiNGOmodelEpsCon.h:30
-
bool _singleObjective
Definition: MAiNGOmodelEpsCon.h:95
-
EvaluationContainer evaluate(const std::vector< Var > &optVars) final
Virtual function which has to be implemented by the user in order to enable evaluation of the model...
Definition: MAiNGOmodelEpsCon.cpp:27
-
virtual std::vector< double > get_initial_point()
Virtual function which has to be implemented by the user in order to enable getting data on the initi...
Definition: MAiNGOmodelEpsCon.h:60
-
Struct for storing the values returned by model evaluation at the given point "var".
Definition: evaluationContainer.h:208
-
virtual EvaluationContainer evaluate_user_model(const std::vector< Var > &optVars)=0
Virtual function which has to be implemented by the user in order to enable evaluation of the model...
-
This class is the base class for models to be solved by MAiNGO.
Definition: MAiNGOmodel.h:87
-
void set_epsilon(const std::vector< double > &epsilon)
Function for changing the epsilon-parameters.
Definition: MAiNGOmodelEpsCon.h:67
-
size_t _objectiveIndex
Definition: MAiNGOmodelEpsCon.h:94
-
namespace holding all essentials of MAiNGO
Definition: aleModel.h:25
- -
virtual ~MAiNGOmodelEpsCon()
Destructor.
Definition: MAiNGOmodelEpsCon.h:36
-
virtual std::vector< OptimizationVariable > get_variables()=0
Virtual function which has to be implemented by the user in order to enable getting data on optimizat...
-
std::vector< double > _epsilon
Definition: MAiNGOmodelEpsCon.h:93
-
void set_objective_index(const size_t objectiveIndex)
Function for setting the objective index.
Definition: MAiNGOmodelEpsCon.h:77
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_oprinting_functions_8cpp.html b/doc/html/_m_ai_n_g_oprinting_functions_8cpp.html deleted file mode 100644 index 2d79d757f1e7bc2c3ca27646cec65e18d551d304..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_oprinting_functions_8cpp.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/src/MAiNGOprintingFunctions.cpp File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGOprintingFunctions.cpp File Reference
-
-
-
#include "MAiNGO.h"
-#include "MAiNGOException.h"
-#include "bab.h"
-#include "getTime.h"
-#include "utilities.h"
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_oread_settings_8cpp.html b/doc/html/_m_ai_n_g_oread_settings_8cpp.html deleted file mode 100644 index b9817b774c7d7d793ba6eb42459e39c81b2bc9c2..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_oread_settings_8cpp.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/src/MAiNGOreadSettings.cpp File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGOreadSettings.cpp File Reference
-
-
-
#include "MAiNGO.h"
-#include "settings.h"
-#include <fstream>
-#include <sstream>
-#include <string>
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_oset_option_8cpp.html b/doc/html/_m_ai_n_g_oset_option_8cpp.html deleted file mode 100644 index c7c7e5bf63769a746f54847cb604fbe63e0b8268..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_oset_option_8cpp.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/src/MAiNGOsetOption.cpp File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGOsetOption.cpp File Reference
-
-
-
#include "MAiNGO.h"
-#include "settings.h"
-#include <limits>
-#include <string>
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_oto_other_language_8cpp.html b/doc/html/_m_ai_n_g_oto_other_language_8cpp.html deleted file mode 100644 index f0a88a49417ffdf22cb580fb335004ce6addbc8a..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_oto_other_language_8cpp.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/src/MAiNGOtoOtherLanguage.cpp File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGOtoOtherLanguage.cpp File Reference
-
-
-
#include "MAiNGO.h"
-#include "MAiNGOException.h"
-#include "utilities.h"
-#include "fftostring.hpp"
-#include <cctype>
-#include <cstring>
-#include <fstream>
-#include <string>
-
-
- - - - diff --git a/doc/html/_m_ai_n_g_owriting_functions_8cpp.html b/doc/html/_m_ai_n_g_owriting_functions_8cpp.html deleted file mode 100644 index 19f7c6306eb75eb8da04bc4521b607168845b1cf..0000000000000000000000000000000000000000 --- a/doc/html/_m_ai_n_g_owriting_functions_8cpp.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/src/MAiNGOwritingFunctions.cpp File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
MAiNGOwritingFunctions.cpp File Reference
-
-
-
#include "MAiNGO.h"
-#include "bab.h"
-#include "utilities.h"
-
-
- - - - diff --git a/doc/html/ale_model_8cpp.html b/doc/html/ale_model_8cpp.html deleted file mode 100644 index 9dd2247edf269d525a23d82dadd6afe71b7aaf7f..0000000000000000000000000000000000000000 --- a/doc/html/ale_model_8cpp.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/src/aleModel.cpp File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
aleModel.cpp File Reference
-
-
-
#include "aleModel.h"
-#include "MAiNGOevaluator.h"
-#include "variableLister.h"
-#include <algorithm>
-#include <exception>
-#include <string>
-
-
- - - - diff --git a/doc/html/ale_model_8h.html b/doc/html/ale_model_8h.html deleted file mode 100644 index 617952a7ec0d04e7d882f29cb0eb5d251fc9c9a2..0000000000000000000000000000000000000000 --- a/doc/html/ale_model_8h.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/aleModel.h File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
- -
-
aleModel.h File Reference
-
-
-
#include "MAiNGOmodel.h"
-#include "program.h"
-#include "symbol_table.hpp"
-#include <unordered_map>
-
-

Go to the source code of this file.

- - - - - -

-Classes

class  maingo::AleModel
 This class provides the interface for a program composed of ALE expressions. More...
 
- - - - -

-Namespaces

 maingo
 namespace holding all essentials of MAiNGO
 
- - - -

-Typedefs

using Var = mc::FFVar
 
-

Typedef Documentation

- -

◆ Var

- -
-
- - - - -
using Var = mc::FFVar
-
- -
-
-
-
- - - - diff --git a/doc/html/ale_model_8h.js b/doc/html/ale_model_8h.js deleted file mode 100644 index 118d167864989ca3b717f9af796d4f9f5b2be5ad..0000000000000000000000000000000000000000 --- a/doc/html/ale_model_8h.js +++ /dev/null @@ -1,5 +0,0 @@ -var ale_model_8h = -[ - [ "AleModel", "classmaingo_1_1_ale_model.html", "classmaingo_1_1_ale_model" ], - [ "Var", "ale_model_8h.html#a9c4e868adf1bc404290197d3c92f56bc", null ] -]; \ No newline at end of file diff --git a/doc/html/ale_model_8h_source.html b/doc/html/ale_model_8h_source.html deleted file mode 100644 index fb6c7c08087a09a4e37931b3fce7720f9314f20c..0000000000000000000000000000000000000000 --- a/doc/html/ale_model_8h_source.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/aleModel.h Source File - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
aleModel.h
-
-
-Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2019 Process Systems Engineering (AVT.SVT), RWTH Aachen University
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License 2.0 which is available at
6  * http://www.eclipse.org/legal/epl-2.0.
7  *
8  * SPDX-License-Identifier: EPL-2.0
9  *
10  **********************************************************************************/
11 
12 #pragma once
13 
14 #include "MAiNGOmodel.h"
15 #include "program.h"
16 
17 #include "symbol_table.hpp"
18 
19 #include <unordered_map>
20 
21 
22 using Var = mc::FFVar;
23 
24 
25 namespace maingo {
26 
31 class AleModel: public MAiNGOmodel {
32 
33  public:
39  EvaluationContainer evaluate(const std::vector<Var>& optVars);
40 
47  AleModel(Program prog, ale::symbol_table& symbols):
48  _prog(prog), _symbols(symbols)
49  {
51  };
52 
56  std::vector<OptimizationVariable> get_variables();
57 
61  const std::unordered_map<std::string, int>& get_positions();
62 
66  std::vector<double> get_initial_point();
67 
71  void make_variables();
72 
73  private:
75  ale::symbol_table& _symbols;
77  std::vector<OptimizationVariable> _variables;
78  std::vector<double> _initials;
79  std::unordered_map<std::string, int> _positions;
80 };
81 
82 
83 } // namespace maingo
ale::symbol_table & _symbols
Definition: aleModel.h:75
-
std::vector< OptimizationVariable > get_variables()
Function for getting optimization variables data.
Definition: aleModel.cpp:27
-
std::vector< double > get_initial_point()
Function for getting initial point data.
Definition: aleModel.cpp:45
-
mc::FFVar Var
Definition: aleModel.h:22
-
Container Class for ALE expressions comprising an optimization problem.
Definition: program.h:24
-
Struct for storing the values returned by model evaluation at the given point "var".
Definition: evaluationContainer.h:208
- -
void make_variables()
Function for populating _variables, _initials, and _positions.
Definition: aleModel.cpp:94
-
std::vector< double > _initials
Definition: aleModel.h:78
-
This class is the base class for models to be solved by MAiNGO.
Definition: MAiNGOmodel.h:87
-
This class provides the interface for a program composed of ALE expressions.
Definition: aleModel.h:31
-
EvaluationContainer evaluate(const std::vector< Var > &optVars)
Main function used to evaluate the model and construct a directed acyclic graph.
Definition: aleModel.cpp:54
-
namespace holding all essentials of MAiNGO
Definition: aleModel.h:25
- -
Program _prog
Definition: aleModel.h:74
-
std::unordered_map< std::string, int > _positions
Definition: aleModel.h:79
-
std::vector< OptimizationVariable > _variables
Definition: aleModel.h:77
-
const std::unordered_map< std::string, int > & get_positions()
Function for getting optimization variable position data.
Definition: aleModel.cpp:36
-
AleModel(Program prog, ale::symbol_table &symbols)
Constructor taking a ALE-based Program and an ALE symbol_table.
Definition: aleModel.h:47
-
-
- - - - diff --git a/doc/html/algorithm.html b/doc/html/algorithm.html deleted file mode 100644 index 7987a0f736386008414c02e016ff639537bea3b8..0000000000000000000000000000000000000000 --- a/doc/html/algorithm.html +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - - -MAiNGO: How does MAiNGO work? - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
How does MAiNGO work?
-
-
-

-Basic Structure

-

MAiNGO implements a relatively basic spatial Branch-and-Bound (B&B) algorithm, enhanced with some features for range reduction and a multi-start heuristic. The basic structure of the solver is as follows (where x includes both the integer and continuous variables):

-

-Structure.PNG -
-

Here, f, g, and h are bounded factorable functions (also including multivariate outer functions) that can be implemented by some computer code or given in text format (see Section Modeling in MAiNGO). Based on this implementation, MAiNGO will evaluate the functions to construct a directed acyclic graph (DAG) represention of the model using the MC++ library. Later while solving the problem, MAiNGO works only with this DAG to evaluate the functions in different arithmetics: We use automatic differentiation via FADBAD++ to obtain first and second derivatives of the functions. Convex and concave relaxations together with their subgradients are constructed through MC++ using the McCormick theorems, where the required intervals are obtained via FILIB++. To compute lower (LBD) and upper bounds (UBD) on the optimal objective value based on the gradients and relaxations, MAiNGO uses several linear programming and local nonlinear programming solvers. These are accessed through lower and upper bounding wrappers.

-

-Details of MINLP solution algorithm

-

Initially, the structure of the problem is analyzed to treat special cases. If MAiNGO detects the problem to be a (mixed-integer) linear program or a (mixed-integer) quadratic program, then it simply calls an available (MI)LP or (MI)QP solver to solve the problem. Otherwise, the problem is handled as a (mixed-integer) non-linear program and the solution procedure is as described in the following (in the following, UBD denotes the current global upper bound on the optimal objective value, i.e., the best objective value encountered at a feasible point so far, and LBD denotes the global lower bound on the optimal objective value):

-
    -
  • Step 0: Preprocessing at the root node
    -
    -
      -
    • a: Initialization: Upper and lower bounding solvers and the branch-and-bound tree are initialized. The initial solution value is set to infinity.
      -
      -
    • -
    • b: Option check: MAiNGO checks for settings consistency, e.g., if specific heuristics are compatible with specific solvers, and informs the user about possibly modified settings. MAiNGO also performs a simple evaluation of McCormick relaxations at the middle point of the domain in order to directly throw interval or McCormick exceptions before even starting any computations (e.g., in case of division by zero).
      -
      -
    • -
    • c: Constraint propagation (optional): If BAB_constraintPropagation is turned on, constraint propagation is executed for the root node. Since no feasible point is available yet, we set the bounds of the objective to (-infinity, infinity). If constraint propagation finds variable bounds to be inconsistent with constraints this means that the problem is infeasible and MAiNGO will terminate.
      -
      -
    • -
    • d: OBBT (optional): If the number of OBBT max rounds is >0, several rounds of optimization-based bound tightening are conducted (cf., e.g., Gleixner et al., J. Global Optim. 67 (2017) 731). Since up to here no feasible point is known and UBD is equal to infinity, OBBT considers feasibility only, i.e., each variable may be maximized or minimized subject to the relaxed constraints to tighten the variable bounds. If any of the LPs solved is found to be infeasible, this means that the original problem was infeasible and MAiNGO will terminate. This also applies to the other instances where OBBT is used (Steps 0e and 2). The order in which variables are selected for OBBT is chosen according to the 'greedy' heuristic described by Gleixner et al., J. Global Optim. 67 (2017) 731.
      - To balance the effort spent for OBBT and the gain through tightened bounds, we implemented the 'trivial filtering' heuristic described by Gleixner et al. Thus, you can adjust the minimum OBBT improvement (in [0,1]) to determine that a certain variable should only be considered for OBBT if this could improve its bound by at least LBP_obbtMinImprovement times the width of its interval bound in the current node. While this is not as crucial at the root node, it can make a big difference when using OBBT within the B&B loop.
      -
      -
    • -
    • e: Multi-start (optional): If the number of PRE_maxLocalSearches is >0 and steps 0c-d did not prove the problem to be infeasible, several runs of local optimization will be conducted using the local NLP solver specified by UBP_solverPreprocessing. If an initial point is specified by the user as part of the problem definition, it will be checked for feasibility first, then the first local search will start from here. The next local search starts from the midpoint of the root node, while all remaining searches start from randomly generated initial points within the root node.
      - By default, output is only written about these local searches when a new incumbent (i.e., best solution point so far) is found. If you want to display the results of every local solution, enable PRE_printEveryLocalSearch.
      - If you wish to perform a pure multi-start you can activate option PRE_pureMultistart. Steps 0b, 0c, 0e and 1-10 are then not performed at all and in step 0a only an upper bounding solver is initialized.
      -
      -
    • -
    • f: Constraint propagation (optional): If BAB_constraintPropagation is turned on, constraint propagation is executed for the root node. If a feasible point is available, we set the bounds of the objective to (-infinity, solution value) and to (-infinity,infinity) otherwise.
      -
      -
    • -
    • g: OBBT (optional): If OBBT was conducted in 0c and a feasible point was found in 0d, one additional round of OBBT is conducted that also considers optimality in addition to feasibility. That is, when maximizing and minimizing each variable, a constraint that the relaxed objective function be equal to or smaller than UBD is added in addition to the relaxed versions of the original constraints. Locatelli & Schoen call this step 'standard range reduction'.
      -
      -
    • -
    -
  • -
  • Steps 1-10: Main B&B loop (is executed while there are still nodes left in the B&B tree, or until the limits on CPU time, B&B iterations, or maximum number of nodes in memory are reached)
    -
    -
      -
    • 1: Node selection: The next node (an instance of BabNode) to be treated is selected and extracted from the B&B tree. Available heuristics for node selection include choosing the one with the lowest lower bound (default, since it guarantees convergence), as well as the oldest or newest nodes in the tree. Also, the overall LBD (i.e., lowest lower bound of nodes in the B&B tree) is updated.
      -
      -
    • -
    • 2: Pre-processing (constraint propagation and OBBT, optional):
        -
      • a: If BAB_constraintPropagation is turned on, constraint propagation is executed for the current node. If a feasible point is available, we set the bounds of the objective to (-infinity, UBD) and to (-infinity,infinity) otherwise.
        -
        -
      • -
      • b: If BAB_alwaysSolveObbt is turned on, OBBT is conducted for the current node. If a feasible point has already been found, it considers both feasibility and optimality, otherwise it uses feasibility only. While many established global solvers (at least by default) do not perform OBBT at every node because the computational cost can get prohibitive for problems containing many variables (recall that we need to solve two additional LPs per variable), we decided to implement it since by construction the problems that MAiNGO is designed for (i.e., those with reduced-space formulations) should have relatively few variables. Here, it can pay off to set LBP_obbtMinImprovement (cf. 0c) to limit OBBT to those variables for which significant improvements can be achieved.
        - If the node is proven to be infeasible during OBBT, it is fathomed by infeasibility and thus simply discarded (i.e., we go back directly to 10 and then back to 1).
        -
        -
      • -
      -
    • -
    • 3: Lower bounding: To obtain a lower bound, a relaxation of the original problem on the current node is constructed in three steps: 1) Relax the integrality requirements. 2) Replace equalities by two inequalities each. 3) Using the McCormick relaxations of the objective function and constraints obtained from MC++. However, in general the McCormick relaxations are non-smooth, and therefore a further affine relaxation based on linearization using the subgradients at one or more linearization points xLin (controlled by the setting LBP_linPoints) is conducted. We thus obtain a lower bounding problem (LBP) in the form of a linear program (LP), which allows the use of robust LP solvers (shown for one linearization point; the index k denotes the current B&B node):
      -Relaxed_LBP.PNG -
      - Note that in contrast to current state-of-the-art global solvers, MAiNGO typically does not introduce auxiliary variables when constructing the lower bounding problem, synergizing with the reduced-space philosophy of modeling in MAiNGO. Thus, the above LBP typically has the same number of variables as the original problem. MAiNGO will only add a few auxiliary variables for re-occurring nonlinear factors within the functions if the setting LBP_addAuxiliaryVars is set to true. This can lead to tighter relaxations, at the expense of a slightly larger LBP. The LBP is solved for the current node using one of the LBP solvers. If the LBP is infeasible, the node is fathomed by infeasibility and thus, simply discarded (i.e., we go directly to 10 and then back to 1). Otherwise, if the computed lower bound is greater than the current incumbent UBD or above UBD but within tolerance, the node is fathomed by value dominance and thus also discarded.
      -
      -
    • -
    • 4: Upper bounding: The original problem (UBP) is solved using the local NLP solver specified by UBP_solverBab. If available, the LBP solution point is used as an initial point. Otherwise, the center of the current node is used. The solution point returned by the NLP solver is checked for feasibility within the user-specified feasibility tolerances (deltaIneq, deltaEq) regardless of the return code of the NLP solver. If no NLP solver is used, a single function evaluation is conducted at the initial point.
      - If the problem contains integer (or binary) variables, these are relaxed in the problem handed to the NLP solver. If the returned solution is not (integer) feasible, the integer variables are fixed to the nearest integer value and the problem is re-solved with only the continuous variables being free to be varied by the NLP solver.
      - If a feasible point was found this way, it is compared to the current incumbent. If it is better, the new point becomes the new incumbent and UBD is lowered to the objective value of this new incumbent. In this case, all nodes in the B&B tree (possibly including the current one) with a (node) lower bound greater than this new UBD are fathomed by value dominance and thus deleted from the tree. If the new UBD is significantly better than the previous one (i.e., they are not equal within the optimality tolerances), an asterisk '*' will be shown in the B&B output.
      -
      -
    • -
    • 5: Post-processing (DBBT & probing, optional): If duality-based bound tightening (DBBT) is activated, (cf. Ryoo & Sahinidis, J. Global Optim. 8 (1996) 107), we exploit dual information from the LBP solution to tighten bounds based on optimality. This only works if the LBP solution lies at a bound of the current node, and if the dual multipliers for this variable bound were successfully extracted from the underlying (MI)LP solver.
      - If Probing is enabled, the remaining bounds can be treated as well by tentatively fixing the respective variable at the bound and re-solving the LBP. However, experience suggests that this often too expensive (at least in the current implementation that blindly applies this to all variables).
      -
      -
    • -
    • 6: Process the incumbent information: If a new incumbent has been found, the ID of the node holding the incumbent is updated. This is mainly done to enable tracking of the incumbent in the B&B algorithm.
      -
      -
    • -
    • 7: Branching: Two new nodes are created and inserted into the B&B tree. Options for selecting the variable to branch on include choosing the one with the largest diameter or with the largest diameter relative to the original one (i.e., the one specified by the user). Once the branching variable has been determined, the point to branch at is chosen as a convex combination between the LBP solution point and the node center. Currently, we always branch in the middle of the interval (this is due to initial testing which gave best results when branching in the middle). If the selected branching variable is binary, the floor or ceil functions are used to push the bounds of the child nodes to the respective integer values.
      -
      -
    • -
    • 8: Heuristic checks: Currently, it is only checked whether additional scaling in the lower bounding solver is needed. If the lower bound does not improve for a given number of iterations, we activate aggressive scaling in the lower bounding solver. It is planned to perform additional checks in this step in the future.
      -
      -
    • -
    • 9: Updating statistics: All information regarding number of iterations, solved upper and lower bounding problems etc. are augmented.
      -
      -
    • -
    • 10: Output: If B&B verbosity is set to anything other than VERB_NONE, output on the solution progress will be printed every BAB_printFreq nodes. Additionally, output will be printed whenever a new (and significantly better) incumbent is found (marked by an asterisk in the first column). Note that LBP_verbosity and UBP_verbosity should only be changed from their default ( VERB_NONE ) for diagnostic reasons since they are very noisy (so is VERB_ALL for BAB_verbosity). By default, the printed output includes:
        -
      • the iteration number
      • -
      • the overall LBD after treating the current node
      • -
      • the current UBD after treating the current node
      • -
      • the number of nodes currently in the B&B tree
      • -
      • the absolute gap defined as UBD-LBD
      • -
      • the relative gap defined as (UBD-LBD)/|UBD|
      • -
      • the CPU time spent so far
        -
        -
      • -
      -
    • -
    -
  • -
  • Step 11: Final Output (afer termination of B&B loop):
      -
    • The incumbent as well as its objective value are returned (if a feasible point has been found) along with a message stating the termination status. Note that the returned solution only corresponds to the global solution if MAiNGO reports regular termination. If it terminated because of surpassed CPU time or node limits, the solution may not even be a local optimum. If it reports the problem to be infeasible, this means it was actually proven to be infeasible through the LBPs and/or range reduction.
    • -
    • Statistics are also given on the total number of nodes treated, the number of LBPs solved, the number of UBPs solved, and the maximum number of nodes held in memory at any point during solution. This values can differ since for a node that is found infeasible during OBBT, neither LBP nor UBP will be solved. If a node is found infeasible during LBP, UBP is omitted.
    • -
    • If additional output variables were specified as part of the problem definition, the value of these variables will be calculated at the solution point and reported at the very end of the solution.
    • -
    • Depending on the value of loggingDestination, a log file may now be written in the background that contains the same content as the screen output, except that the print frequency may be different (set through BAB_logFreq).
    • -
    • If the setting writeResultFile is enabled, a result file is written after a regular termination of the optimization process. The result file contains the value of all variables, the objective and all constraints at the final solution point. A result file is only written if a feasible point was found.
    • -
    • Depending on the value of the settings writeJson and writeCsv, the optimal solution along with some statistics and (in case of the csv) a summary of the B&B iterations is written to corresponding files.
    • -
    • Finally, the overall CPU time is reported.
      -
      -
    • -
    -
  • -
-

-Lower Bounding Solvers

-

MAiNGO currently supports four lower bounding solvers: a MAiNGO internal solver, a solver based on interval arithmetics only, CLP and CPLEX. The MAiNGO internal solver relaxes constraints via natural interval extensions, linearizes the McCormick relaxations of the objective function at the mid point and then solves this very simple linear program. The interval-based solver uses interval arithmetics only in order to solve the lower bounding problem. Both solvers, MAiNGO and interval-based do not support OBBT or multiple-point linearization strategies. CPLEX is the third supported lower bounding solver and supports the full range of options implemented in MAiNGO. Note that the current version of CPLEX cannot work with values >1e19. This is automatically detected within MAiNGO and handled appropriately. CLP is the fourth supported lower bounding solver and supports the full range of options implemented in MAiNGO. Note that while CLP may be faster for small problems than CPLEX, it is more error-prone (all errors are caught by MAiNGO and handled properly). In general, it is recommended to use CPLEX as lower bounding solver to achieve best computational performance.

-

-Upper Bounding Solvers

-

MAiNGO currently supports local solvers found in the NLopt package, IPOPT and Knitro. Additionally, you can optimize without any local solver by the use of simple function evaluations. IPOPT is an interior point optimizer. The NLopt package provides the two derivative free solvers Cobyla and Bobyqa and two gradient-based solvers LBFGS and SLSQP. Knitro is a commercial local (MI)NLP solver consisting of many different algorithms.

-
-
- - - - diff --git a/doc/html/annotated.html b/doc/html/annotated.html deleted file mode 100644 index 08fa753db47414b178151eecb8dc7904534b02d2..0000000000000000000000000000000000000000 --- a/doc/html/annotated.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - -MAiNGO: Class List - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
Class List
-
-
-
Here are the classes, structs, unions and interfaces with brief descriptions:
-
[detail level 123]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 NbabBaseNamespace holding all essentials of the babBase submodule
 CBabLogStruct storing logging information during B&B prodcedure
 CBabNodeClass representing a node in the Branch-and-Bound tree
 CBabNodeWithInfoThis class represents an node in the B&B-Tree with additional information attached that is used in selecting nodes or branching variables
 CBabTreeRepresents the B&B-Tree, manages the way nodes are saved and retrieved and pruned
 CBoundsAuxiliary struct for representing bounds on an optimization variable
 CBranchAndBoundBaseExceptionThis class defines the exceptions thrown by BranchAndBoundBase
 CBrancherThis class contains the logic for branching on nodes in the B&B-Tree and selecting nodes to be processed
 CBranchingHistoryInfoStruct for collecting all information that must be saved about a node, so that after it is retrieved from the tree and processed, pseudocosts can be calculated
 CNodePriorityComparatorFunctor for comparing node priorities
 COptimizationVariableClass for representing an optimization variable specified by the user
 COutVarHelper class that can be used to enforce the caller to explicitly state that the variable he passed may be changed
 CPruningScoreComparatorFunctor for comparing pruning scores
 NmaingoNamespace holding all essentials of MAiNGO
 NbabNamespace holding everything related to the actual branch-and-bound algorithm
 CBranchAndBoundThis class contains the main algorithm, including handling of pre-processing routines and managing the B&B tree as well as the respective sub-solvers
 NlbpNamespace holding all essentials of the lower bounding solver
 CDagObjStruct for storing all needed Directed acyclic Graph objects for the upper bounding solver
 CLbpClpWrapper for handling the lower bounding problems by interfacing CLP
 CLbpCplexWrapper for handling the lower bounding problems by interfacing CPLEX
 CLbpDualInfoContainer for information from the LBP that is needed in DBBT and probing, used for communicating the results via bab
 CLbpIntervalWrapper for handling the lower bounding problems by using interval arithmetics. We currently do a bit too much work, if the subgradient interval heuristic is not used, since we additionally compute the McCormick relaxations
 CLowerBoundingSolverWrapper for handling the lower bounding problems as well as optimization-based bounds tightening (OBBT)
 NubpNamespace holding all essentials of the upper bounding solvers
 CDagObjStruct for storing all needed Directed acyclic Graph objects for the upper bounding solver
 CIpoptProblemClass for representing problems to be solved by IpOpt, providing an interface to the problem definition in problem.h used by MC++
 CKnitroProblemClass for representing problems to be solved by Knitro, providing an interface to the problem definition in problem.h
 CUbpClpWrapper for handling the upper bounding problems by interfacing CLP
 CUbpCplexWrapper for handling the upper bounding problems by interfacing CPLEX
 CUbpIpoptWrapper for handling the upper bounding problems by interfacing Ipopt
 CUbpKnitroWrapper for handling the upper bounding problems by interfacing Knitro
 CUbpNLoptWrapper for handling the upper bounding problems by interfacing NLopt
 CUbpQuadExprStruct used to compute coefficients of linear and quadratic/bilinear terms in (MIQ)Ps. This struct is used to avoid the need of propagating the IloExpr object resulting in HUGE RAM usage
 CUbpStructureStruct for storing structure information for the upper bounding solver
 CUpperBoundingSolverBase class for wrappers for handling the upper bounding problems
 CAleModelThis class provides the interface for a program composed of ALE expressions
 CConstraintStruct for storing information about constraints
 CConstraintContainerContainter for constraint evaluation
 CEvaluationContainerStruct for storing the values returned by model evaluation at the given point "var"
 CLoggerThis class contains all logging and output information
 CMAiNGOThis class is the MAiNGO solver holding the B&B tree, upper bounding solver, lower bounding solver and settings
 CMaingoEvaluatorEvaluates ALE expressions to Var
 CMAiNGOExceptionThis class defines the exceptions thrown by MAiNGO
 CMAiNGOmodelThis class is the base class for models to be solved by MAiNGO
 CMAiNGOmodelEpsConThis class is the base class for implementing bi-objective problems
 CModelFunctionStruct for making work with the EvaluationContainer easier for the user and also to ensure backward compatibility
 COutputVariableStruct for storing additional output variables
 CProgramContainer Class for ALE expressions comprising an optimization problem
 CProgramParserParser specialization for parsing a maingo::Program
 CSettingsStruct for storing settings for MAiNGO
 CVariableListerSerializes a given symbol and lists it into a vector
 NmcNamespace holding forward declaration of McCormick objects. For more info refer to the open-source library MC++
 COp< maingo::ubp::UbpQuadExpr >Specialization of the structure mc::Op for use of the type UbpQuadExpr as a template parameter in other MC++ types
 CPyMAiNGOmodel
-
-
-
- - - - diff --git a/doc/html/annotated_dup.js b/doc/html/annotated_dup.js deleted file mode 100644 index 88ff43767ef8e8fda737402003aab645a4b8e0e7..0000000000000000000000000000000000000000 --- a/doc/html/annotated_dup.js +++ /dev/null @@ -1,7 +0,0 @@ -var annotated_dup = -[ - [ "babBase", "namespacebab_base.html", "namespacebab_base" ], - [ "maingo", "namespacemaingo.html", "namespacemaingo" ], - [ "mc", "namespacemc.html", "namespacemc" ], - [ "PyMAiNGOmodel", "class_py_m_ai_n_g_omodel.html", "class_py_m_ai_n_g_omodel" ] -]; \ No newline at end of file diff --git a/doc/html/applications.png b/doc/html/applications.png deleted file mode 100644 index cc235f46bf6764512b5e708f01b25cf1d764d1cb..0000000000000000000000000000000000000000 Binary files a/doc/html/applications.png and /dev/null differ diff --git a/doc/html/bab_8cpp.html b/doc/html/bab_8cpp.html deleted file mode 100644 index 3a5e682395807697d9f972a49152236d7a3b4a78..0000000000000000000000000000000000000000 --- a/doc/html/bab_8cpp.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/src/bab.cpp File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
bab.cpp File Reference
-
-
-
#include "bab.h"
-#include "MAiNGOException.h"
-#include "getTime.h"
-#include "lbp.h"
-#include "mpiUtilities.h"
-#include "ubp.h"
-#include "utilities.h"
-#include <limits>
-
-
- - - - diff --git a/doc/html/bab_8h.html b/doc/html/bab_8h.html deleted file mode 100644 index 0095a696be19883fb8170602d4a972d2d93dd77e..0000000000000000000000000000000000000000 --- a/doc/html/bab_8h.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/bab.h File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
- -
-
bab.h File Reference
-
-
-
#include "MAiNGOdebug.h"
-#include "logger.h"
-#include "mpiUtilities.h"
-#include "babBrancher.h"
-#include <cmath>
-#include <map>
-#include <memory>
-#include <string>
-#include <vector>
-
-

Go to the source code of this file.

- - - - - -

-Classes

class  maingo::bab::BranchAndBound
 This class contains the main algorithm, including handling of pre-processing routines and managing the B&B tree as well as the respective sub-solvers. More...
 
- - - - - - - - - - - - - -

-Namespaces

 maingo
 namespace holding all essentials of MAiNGO
 
 maingo::lbp
 namespace holding all essentials of the lower bounding solver
 
 maingo::ubp
 namespace holding all essentials of the upper bounding solvers
 
 maingo::bab
 namespace holding everything related to the actual branch-and-bound algorithm
 
-
-
- - - - diff --git a/doc/html/bab_8h_source.html b/doc/html/bab_8h_source.html deleted file mode 100644 index 6027ae9c33aa08dc5adb8bdcfe0c0fc369767c41..0000000000000000000000000000000000000000 --- a/doc/html/bab_8h_source.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/inc/bab.h Source File - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
bab.h
-
-
-Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2019 Process Systems Engineering (AVT.SVT), RWTH Aachen University
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License 2.0 which is available at
6  * http://www.eclipse.org/legal/epl-2.0.
7  *
8  * SPDX-License-Identifier: EPL-2.0
9  *
10  **********************************************************************************/
11 
12 #pragma once
13 
14 #include "MAiNGOdebug.h"
15 #include "logger.h"
16 #include "mpiUtilities.h"
17 #ifdef HAVE_MAiNGO_MPI
18 #include "MAiNGOMpiException.h"
19 #endif
20 
21 #include "babBrancher.h"
22 
23 #include <cmath>
24 #include <map>
25 #include <memory>
26 #include <string>
27 #include <vector>
28 
29 
30 namespace maingo {
31 
32 
33 namespace lbp {
35 struct LbpDualInfo;
36 } // namespace lbp
37 namespace ubp {
39 } // namespace ubp
40 
41 
46 namespace bab {
47 
48 
59 
60  public:
71  BranchAndBound(const std::vector<babBase::OptimizationVariable> &variables, std::shared_ptr<lbp::LowerBoundingSolver> LBSIn, std::shared_ptr<ubp::UpperBoundingSolver> UBSIn,
72  std::shared_ptr<Settings> settingsIn, std::shared_ptr<Logger> loggerIn, const unsigned nvarWOaux);
73 
78 
88  babBase::enums::BAB_RETCODE solve(babBase::BabNode &rootNodeIn, double &solutionValue, std::vector<double> &solutionPoint, const double preprocessTime, double &timePassed);
89 
93  double get_iterations() { return _iterations; }
94 
99 
103  double get_UBP_count() { return _ubdcnt; }
104 
108  double get_LBP_count() { return _lbdcnt; }
109 
113  double get_final_LBD() { return _lbd; }
114 
118  double get_final_abs_gap() { return _ubd - _lbd; }
119 
123  double get_final_rel_gap() { return ((_ubd == 0) ? (get_final_abs_gap()) : ((_ubd - _lbd) / std::fabs(_ubd))); }
124 
128  double get_first_found() { return _firstFound; }
129 
133  double get_nodes_left() { return _nNodesLeft; }
134 
135  private:
144  };
145 
151  std::tuple<bool, bool, int, int, double, std::vector<double>, bool, double, std::vector<double>> _process_node(babBase::BabNode &currentNodeInOut);
152 
159  bool _preprocess_node(babBase::BabNode &currentNodeInOut);
160 
167  std::tuple<bool, bool, double, std::vector<double>, lbp::LbpDualInfo> _solve_LBP(const babBase::BabNode &currentNode);
168 
177  std::tuple<bool, bool, double> _solve_UBP(const babBase::BabNode &currentNode, std::vector<double> &ubpSolutionPoint, const double currentLBD);
178 
187  bool _postprocess_node(babBase::BabNode &currentNodeInOut, const std::vector<double> &lbpSolutionPoint, const lbp::LbpDualInfo &dualInfo);
188 
189 
197  void _update_incumbent_and_fathom(const double solval, const std::vector<double> sol, const unsigned int currentNodeID);
198 
202  void _update_lowest_lbd();
203 
208 
213 
220  void _display_and_log_progress(const double currentNodeLBD, const babBase::BabNode &currentNode);
221 
227  void _print_termination(std::string message);
228 
237  void _print_one_node(const double theLBD, const int ID, const std::vector<double> lowerVarBounds, const std::vector<double> upperVarBounds);
238 
248  void _print_one_node(const double theLBD, const int ID, const std::vector<double> lowerVarBounds, const std::vector<double> upperVarBounds, std::ostream &outstream);
249 
256  void _print_one_node(const double theLBD, const babBase::BabNode &theNode) { _print_one_node(theLBD, theNode.get_ID(), theNode.get_lower_bounds(), theNode.get_upper_bounds()); }
257 
265  void _print_one_node(const double theLBD, const babBase::BabNode &theNode, std::ostream &outstream) { _print_one_node(theLBD, theNode.get_ID(), theNode.get_lower_bounds(), theNode.get_upper_bounds(), outstream); }
266 
267 #ifdef HAVE_MAiNGO_MPI
268 
277  void _communicate_exception_and_throw(const maingo::MAiNGOMpiException &e);
278 
290  void _recv_solved_problem(babBase::BabNode &node, double &lbd, std::vector<double> &lbdSolutionPoint, unsigned &lbdcnt,
291  unsigned &ubdcnt, const COMMUNICATION_TAG status, const int src);
292 
299  void _send_new_problem(const babBase::BabNode &node, const int dest);
300 
307  void _inform_worker_about_event(const BCAST_TAG eventTag, const bool blocking);
319  void _recv_new_problem(babBase::BabNode &node);
320 
328  void _send_incumbent(const double ubd, const std::vector<double> incumbent, const unsigned incumbentID);
329 
340  void _send_solved_problem(const babBase::BabNode node, const double lbd, const std::vector<double> lbdSolutionPoint,
341  const unsigned lbdcnt, const unsigned ubdcnt, const COMMUNICATION_TAG status);
342 
348  void _sync_with_master(MPI_Request &req);
349 
356  void _sync_with_master(MPI_Request &req, bool &terminate);
358 #endif
359 
360  std::unique_ptr<babBase::Brancher> _brancher;
361  std::shared_ptr<ubp::UpperBoundingSolver> _UBS;
362  std::shared_ptr<lbp::LowerBoundingSolver> _LBS;
364  std::shared_ptr<Settings> _maingoSettings;
370  std::vector<babBase::OptimizationVariable> _originalVariables;
371  const unsigned _nvar;
372  const unsigned _nvarWOaux;
373  std::vector<double> _lowerVarBoundsOrig;
374  std::vector<double> _upperVarBoundsOrig;
381  std::vector<double> _incumbent;
382  std::vector<double> _initialPoint;
383  double _ubd;
384  double _lbd;
386  bool _foundFeas;
387  unsigned _firstFound;
388  unsigned _incumbentNodeId;
396  double _lbdOld;
397  unsigned _lbdNotChanged;
405  unsigned _nNodesTotal;
406  unsigned _nNodesLeft;
408  unsigned _nNodesDeleted;
409  unsigned _nNodesFathomed;
416  unsigned _lbdcnt;
417  unsigned _ubdcnt;
418  double _timePassed;
420  unsigned _daysPassed;
427  unsigned _linesprinted;
428  unsigned _iterations;
429  unsigned _iterationsgap;
432  std::shared_ptr<Logger> _logger;
435 #ifdef HAVE_MAiNGO_MPI
436 
440  int _rank;
441  int _nProcs;
442  BCAST_TAG _bcastTag;
443  MPI_Request _bcastReq;
450  std::vector<bool> _informedWorkerAboutIncumbent;
451  bool _checkForNodeWithIncumbent;
452  bool _confirmedTermination;
453  unsigned _workCount;
454  std::vector<std::pair<bool, double>> _nodesGivenToWorkers;
461  bool _pendingIncumbentUpdate;
462  MPI_Request _incumbentReq;
465 #endif
466 };
467 
468 
469 } // end namespace bab
470 
471 
472 } // end namespace maingo
Wrapper for handling the lower bounding problems as well as optimization-based bounds tightening (OBB...
Definition: lbp.h:65
-
void _print_termination(std::string message)
Function printing a termination message.
Definition: bab.cpp:1232
-
void _display_and_log_progress(const double currentNodeLBD, const babBase::BabNode &currentNode)
Function for printing the current progress on the screen and appending it to the internal log to be w...
Definition: bab.cpp:897
-
std::vector< double > _lowerVarBoundsOrig
Definition: bab.h:373
-
int get_ID() const
Function for querying the node ID.
Definition: babNode.h:100
-
This class contains the main algorithm, including handling of pre-processing routines and managing th...
Definition: bab.h:58
-
BAB_RETCODE
Enum for representing the return codes returned by the B&B solver.
Definition: babUtils.h:126
-
bool _foundFeas
Definition: bab.h:386
-
unsigned _lbdNotChanged
Definition: bab.h:397
-
Class representing a node in the Branch-and-Bound tree.
Definition: babNode.h:35
-
std::tuple< bool, bool, int, int, double, std::vector< double >, bool, double, std::vector< double > > _process_node(babBase::BabNode &currentNodeInOut)
Function processing the current node.
Definition: bab.cpp:535
-
std::unique_ptr< babBase::Brancher > _brancher
Definition: bab.h:360
-
BranchAndBound(const std::vector< babBase::OptimizationVariable > &variables, std::shared_ptr< lbp::LowerBoundingSolver > LBSIn, std::shared_ptr< ubp::UpperBoundingSolver > UBSIn, std::shared_ptr< Settings > settingsIn, std::shared_ptr< Logger > loggerIn, const unsigned nvarWOaux)
Constructor, stores information on problem and settings.
Definition: bab.cpp:28
-
double _timePassed
Definition: bab.h:418
-
unsigned _ubdcnt
Definition: bab.h:417
-
File containing definition of the Branch-and-Bound brancher class.
-
unsigned _writeToLogEverySec
Definition: bab.h:431
-
std::vector< babBase::OptimizationVariable > _originalVariables
Definition: bab.h:370
-
void _update_incumbent_and_fathom(const double solval, const std::vector< double > sol, const unsigned int currentNodeID)
Function for updating the incumbent and fathoming accordingly.
Definition: bab.cpp:792
- -
double get_iterations()
Function returning the number of iterations.
Definition: bab.h:93
-
double get_first_found()
Function returning the ID of the node where the incumbent was first found.
Definition: bab.h:128
-
double get_UBP_count()
Function returning number of UBD problems solved.
Definition: bab.h:103
-
double _bestLbdFathomed
Definition: bab.h:385
- -
std::tuple< bool, bool, double, std::vector< double >, lbp::LbpDualInfo > _solve_LBP(const babBase::BabNode &currentNode)
Function invoking the LBS to solve the lower bounding problem.
Definition: bab.cpp:658
-
bool _moreScalingActivated
Definition: bab.h:398
-
bool _preprocess_node(babBase::BabNode &currentNodeInOut)
Function for pre-processing the current node. Includes bound tightening and OBBT. ...
Definition: bab.cpp:602
-
babBase::enums::BAB_RETCODE _status
Definition: bab.h:389
-
_TERMINATION_TYPE _check_termination()
Function for checking if the B&B algorithm terminated.
Definition: bab.cpp:1047
-
std::vector< double > get_lower_bounds() const
Function for querying the lower bounds on the optimization variables within this node.
Definition: babNode.h:90
-
std::vector< double > _upperVarBoundsOrig
Definition: bab.h:374
-
const unsigned _nvarWOaux
Definition: bab.h:372
-
double get_final_rel_gap()
Function returning the final relative gap.
Definition: bab.h:123
-
bool _postprocess_node(babBase::BabNode &currentNodeInOut, const std::vector< double > &lbpSolutionPoint, const lbp::LbpDualInfo &dualInfo)
Function for post-processing the current node. Includes bound DBBT and probing.
Definition: bab.cpp:763
-
unsigned _iterationsgap
Definition: bab.h:429
-
babBase::enums::BAB_RETCODE solve(babBase::BabNode &rootNodeIn, double &solutionValue, std::vector< double > &solutionPoint, const double preprocessTime, double &timePassed)
Main function to solve the optimization problem.
Definition: bab.cpp:109
-
double _lbdOld
Definition: bab.h:396
-
unsigned _nNodesMaxInMemory
Definition: bab.h:407
-
Base class for wrappers for handling the upper bounding problems.
Definition: ubp.h:44
-
unsigned _linesprinted
Definition: bab.h:427
-
unsigned _nNodesFathomed
Definition: bab.h:409
-
void _print_one_node(const double theLBD, const babBase::BabNode &theNode, std::ostream &outstream)
Function printing one node.
Definition: bab.h:265
- -
double _ubd
Definition: bab.h:383
-
namespace holding all essentials of MAiNGO
Definition: aleModel.h:25
-
unsigned _nNodesTotal
Definition: bab.h:405
-
void _update_lowest_lbd()
Function for updating the global lower bound.
Definition: bab.cpp:835
-
double get_final_abs_gap()
Function returning the final absolute gap.
Definition: bab.h:118
-
unsigned _iterations
Definition: bab.h:428
-
std::vector< double > _incumbent
Definition: bab.h:381
-
std::shared_ptr< lbp::LowerBoundingSolver > _LBS
Definition: bab.h:362
-
std::shared_ptr< Logger > _logger
Definition: bab.h:432
-
unsigned _lbdcnt
Definition: bab.h:416
-
double get_nodes_left()
Function returning the number of nodes left after termination of B&B.
Definition: bab.h:133
-
bool _printNewIncumbent
Definition: bab.h:430
-
double _lbd
Definition: bab.h:384
-
unsigned _firstFound
Definition: bab.h:387
-
void _print_one_node(const double theLBD, const babBase::BabNode &theNode)
Function printing one node.
Definition: bab.h:256
-
unsigned _nNodesDeleted
Definition: bab.h:408
- -
double get_final_LBD()
Function returning the final LBD.
Definition: bab.h:113
- -
void _print_one_node(const double theLBD, const int ID, const std::vector< double > lowerVarBounds, const std::vector< double > upperVarBounds)
Function printing one node.
Definition: bab.cpp:1019
-
double _timePreprocess
Definition: bab.h:419
-
std::shared_ptr< ubp::UpperBoundingSolver > _UBS
Definition: bab.h:361
-
unsigned _daysPassed
Definition: bab.h:420
-
std::vector< double > get_upper_bounds() const
Function for querying the upper bounds on the optimization variables within this node.
Definition: babNode.h:95
-
void _check_if_more_scaling_needed()
Function which checks whether it is necessary to activate scaling within the LBD solver. This is a heuristic approach, which does not affect any deterministic optimization assumptions.
Definition: bab.cpp:867
- - -
std::vector< double > _initialPoint
Definition: bab.h:382
-
Container for information from the LBP that is needed in DBBT and probing, used for communicating the...
Definition: lbp.h:52
-
const unsigned _nvar
Definition: bab.h:371
-
unsigned _nNodesLeft
Definition: bab.h:406
-
_TERMINATION_TYPE
Enum for representing different termination types in B&B.
Definition: bab.h:140
-
std::shared_ptr< Settings > _maingoSettings
Definition: bab.h:364
-
double get_max_nodes_in_memory()
Function returning the maximum number of nodes in memory.
Definition: bab.h:98
-
unsigned _incumbentNodeId
Definition: bab.h:388
-
double get_LBP_count()
Function returning number of LBD problems solved.
Definition: bab.h:108
-
~BranchAndBound()
Destructor.
Definition: bab.h:77
-
std::tuple< bool, bool, double > _solve_UBP(const babBase::BabNode &currentNode, std::vector< double > &ubpSolutionPoint, const double currentLBD)
Function invoking the UBS to solve the upper bounding problem.
Definition: bab.cpp:703
-
-
- - - - diff --git a/doc/html/bab_bounds_8h.html b/doc/html/bab_bounds_8h.html deleted file mode 100644 index 4fe92aad23048220ed95d2d68c6495190112b5ce..0000000000000000000000000000000000000000 --- a/doc/html/bab_bounds_8h.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/dep/babbase/inc/babBounds.h File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
- -
-
babBounds.h File Reference
-
-
-
#include <iostream>
-
-

Go to the source code of this file.

- - - - - -

-Classes

struct  babBase::Bounds
 Auxiliary struct for representing bounds on an optimization variable. More...
 
- - - - -

-Namespaces

 babBase
 namespace holding all essentials of the babBase submodule
 
- - - - - - - - - - -

-Functions

std::ostream & babBase::operator<< (std::ostream &os, const Bounds &b)
 Overloaded outstream operator for nicer output. More...
 
bool babBase::operator== (const Bounds &b1, const Bounds &b2)
 Equality operator for checking if two bound objects are equal. More...
 
bool babBase::operator!= (const Bounds &b1, const Bounds &b2)
 Inequality operator for checking if two bound objects differ from each other. More...
 
-
-
- - - - diff --git a/doc/html/bab_bounds_8h.js b/doc/html/bab_bounds_8h.js deleted file mode 100644 index 4042aca7d7c270ec3140c934b17d1292b42d548d..0000000000000000000000000000000000000000 --- a/doc/html/bab_bounds_8h.js +++ /dev/null @@ -1,7 +0,0 @@ -var bab_bounds_8h = -[ - [ "Bounds", "structbab_base_1_1_bounds.html", "structbab_base_1_1_bounds" ], - [ "operator!=", "bab_bounds_8h.html#a6d2be1c108f096eff60042aa02e3781e", null ], - [ "operator<<", "bab_bounds_8h.html#ace0cd5136bac463b84cdd69b51be9f49", null ], - [ "operator==", "bab_bounds_8h.html#aa4d99f78f3dad3b027ca3cf5f9cf4478", null ] -]; \ No newline at end of file diff --git a/doc/html/bab_bounds_8h_source.html b/doc/html/bab_bounds_8h_source.html deleted file mode 100644 index 4f0099c10d505d7d8f213ff4ecb2d51579d643b2..0000000000000000000000000000000000000000 --- a/doc/html/bab_bounds_8h_source.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/dep/babbase/inc/babBounds.h Source File - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
babBounds.h
-
-
-Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2019 Process Systems Engineering (AVT.SVT), RWTH Aachen University
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License 2.0 which is available at
6  * http://www.eclipse.org/legal/epl-2.0.
7  *
8  * SPDX-License-Identifier: EPL-2.0
9  *
10  * @file babBounds.h
11  *
12  * @brief File containing definition of Bounds struct for storing bounds on optimization variables.
13  *
14  **********************************************************************************/
15 
16 #pragma once
17 
18 #include <iostream>
19 
20 
25 namespace babBase {
26 
27 
32 struct Bounds {
33 
34  public:
41  Bounds(const double lowerIn, const double upperIn):
42  lower(lowerIn), upper(upperIn) {}
43 
47  bool are_consistent() const
48  {
49  return (lower <= upper);
50  }
51 
52  double lower;
53  double upper;
54 };
55 
56 
63 inline std::ostream &operator<<(std::ostream &os, const Bounds &b)
64 {
65  os << "Lower:" << b.lower << " , Upper:" << b.upper;
66  return os;
67 };
68 
69 
76 inline bool operator==(const Bounds &b1, const Bounds &b2)
77 {
78  return ( (b1.lower == b2.lower) && (b1.upper == b2.upper) );
79 };
80 
81 
88 inline bool operator!=(const Bounds &b1, const Bounds &b2)
89 {
90  return ( (b1.lower != b2.lower) || (b1.upper != b2.upper) );
91 };
92 
93 
94 } // namespace babBase
std::ostream & operator<<(std::ostream &os, const Bounds &b)
Overloaded outstream operator for nicer output.
Definition: babBounds.h:63
-
Auxiliary struct for representing bounds on an optimization variable.
Definition: babBounds.h:32
-
namespace holding all essentials of the babBase submodule
-
bool operator==(const Bounds &b1, const Bounds &b2)
Equality operator for checking if two bound objects are equal.
Definition: babBounds.h:76
-
double lower
Definition: babBounds.h:52
-
Bounds(const double lowerIn, const double upperIn)
Constructor.
Definition: babBounds.h:41
-
double upper
Definition: babBounds.h:53
-
bool are_consistent() const
Function for querying whether the lower bound is less than or equal to the upper bound.
Definition: babBounds.h:47
-
bool operator!=(const Bounds &b1, const Bounds &b2)
Inequality operator for checking if two bound objects differ from each other.
Definition: babBounds.h:88
-
-
- - - - diff --git a/doc/html/bab_brancher_8cpp.html b/doc/html/bab_brancher_8cpp.html deleted file mode 100644 index 157c86c3f036d258cbd8ea6240a1f5b605723b05..0000000000000000000000000000000000000000 --- a/doc/html/bab_brancher_8cpp.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/dep/babbase/src/babBrancher.cpp File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
babBrancher.cpp File Reference
-
-
-
#include "babBrancher.h"
-
-
- - - - diff --git a/doc/html/bab_brancher_8h.html b/doc/html/bab_brancher_8h.html deleted file mode 100644 index 54ca85796f563841c25bee3f9655b67268687d29..0000000000000000000000000000000000000000 --- a/doc/html/bab_brancher_8h.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/dep/babbase/inc/babBrancher.h File Reference - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
- -
-
babBrancher.h File Reference
-
-
- -

File containing definition of the Branch-and-Bound brancher class. -More...

-
#include "babException.h"
-#include "babNode.h"
-#include "babOptVar.h"
-#include "babTree.h"
-#include "babUtils.h"
-#include <functional>
-
-

Go to the source code of this file.

- - - - - -

-Classes

class  babBase::Brancher
 This class contains the logic for branching on nodes in the B&B-Tree and selecting nodes to be processed. More...
 
- - - - -

-Namespaces

 babBase
 namespace holding all essentials of the babBase submodule
 
- - - - - - - - - - - - - - - - - - - - - - -

-Functions

unsigned babBase::select_branching_dimension_absdiam (const BabNode &parentNode, const std::vector< double > &relaxationSolutionPoint, const double relaxationSolutionObjValue, const std::vector< OptimizationVariable > &globalOptimizationVars)
 Function for selecting the variable to branch on by choosing the one with the largest diameter. More...
 
unsigned babBase::select_branching_dimension_reldiam (const BabNode &parentNode, const std::vector< double > &relaxationSolutionPoint, const double relaxationSolutionObjValue, const std::vector< OptimizationVariable > &globalOptimizationVars)
 Function for selecting the variable to branch on by choosing the one with the largest diameter relative to the original one. More...
 
double babBase::relative_distance_to_closest_bound (double pointValue, double bound1, double bound2, const babBase::OptimizationVariable &variable)
 Helper function for tiebracking in branching (akin to most fractional although this is only as good as random) More...
 
double babBase::low_pruning_score_first (const BabNode &candidate, const std::vector< OptimizationVariable > &globalVars)
 Function for BFS or lowPruning Score First (default), possible choice for calculating the node selection score. More...
 
double babBase::low_id_first (const BabNode &candidate, const std::vector< OptimizationVariable > &globalVars)
 Function for Breadth-First-Search possible choice for calculating the node selection score. More...
 
double babBase::high_id_first (const BabNode &candidate, const std::vector< OptimizationVariable > &globalVars)
 Function for DFS, possible choice for calculating the node selection score. More...
 
std::pair< double, double > babBase::calculate_pseudocost_multipliers_minus_and_plus (enums::VT varType, double lowerBound, double upperBound, double branchingPoint, double relaxationSolutionPoint)
 Calculate the multiplier for calculation of pseudocosts. More...
 
-

Detailed Description

-

File containing definition of the Branch-and-Bound brancher class.

-

==============================================================================
-© Aachener Verfahrenstechnik-Systemverfahrenstechnik, RWTH Aachen University
-==============================================================================
-

Author
Aron Zingler, Dominik Bongartz, Jaromil Najman, Susanne Sass, Alexander Mitsos
-
Date
07.02.2019
-
-
- - - - diff --git a/doc/html/bab_brancher_8h.js b/doc/html/bab_brancher_8h.js deleted file mode 100644 index 332312802458b2b108f7419304d83b20bc60a7ef..0000000000000000000000000000000000000000 --- a/doc/html/bab_brancher_8h.js +++ /dev/null @@ -1,11 +0,0 @@ -var bab_brancher_8h = -[ - [ "Brancher", "classbab_base_1_1_brancher.html", "classbab_base_1_1_brancher" ], - [ "calculate_pseudocost_multipliers_minus_and_plus", "bab_brancher_8h.html#ad18c8a7d403193113c3d6c4ecef067c3", null ], - [ "high_id_first", "bab_brancher_8h.html#a22201bd682ee96c743674a020b372d58", null ], - [ "low_id_first", "bab_brancher_8h.html#ab8f1d614e5625322fd3e196bd4d985b4", null ], - [ "low_pruning_score_first", "bab_brancher_8h.html#ab748ef40ab06d5cfe2a2280d66f19bb9", null ], - [ "relative_distance_to_closest_bound", "bab_brancher_8h.html#a4d2b6b4a6ab2a3676a6a1ec734be6b6b", null ], - [ "select_branching_dimension_absdiam", "bab_brancher_8h.html#aa9bc767e7e3b13c80b9c529eb5764592", null ], - [ "select_branching_dimension_reldiam", "bab_brancher_8h.html#a53c20e34bcd16e8a49612ee4ff5e6f11", null ] -]; \ No newline at end of file diff --git a/doc/html/bab_brancher_8h_source.html b/doc/html/bab_brancher_8h_source.html deleted file mode 100644 index 5128a389ae308f50aaf5cc8a95d811a61bb8f780..0000000000000000000000000000000000000000 --- a/doc/html/bab_brancher_8h_source.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - -MAiNGO: C:/dobo01/maingo/dep/babbase/inc/babBrancher.h Source File - - - - - - - - - - - - - - -
-
- - - - - - - -
-
MAiNGO -
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
babBrancher.h
-
-
-Go to the documentation of this file.
1 
14  /**********************************************************************************
15  * Copyright (c) 2019 Process Systems Engineering (AVT.SVT), RWTH Aachen University
16  *
17  * This program and the accompanying materials are made available under the
18  * terms of the Eclipse Public License 2.0 which is available at
19  * http://www.eclipse.org/legal/epl-2.0.
20  *
21  * SPDX-License-Identifier: EPL-2.0
22  *
23  * @file babBrancher.h
24  *
25  * @brief File containing definition of the Branch-and-Bound brancher class.
26  *
27  **********************************************************************************/
28 
29 #pragma once
30 
31 #include "babException.h"
32 #include "babNode.h"
33 #include "babOptVar.h"
34 #include "babTree.h"
35 #include "babUtils.h"
36 
37 #include <functional>
38 
39 
40 namespace babBase {
41 
42 
62 class Brancher {
63 
64  public:
68  Brancher(const std::vector<OptimizationVariable>& variables);
69  // Virtual Destructor for the case of inheritance. However, the compiler now will not autogenarate the other constructors. So we tell it to:
70  virtual ~Brancher() = default;
71  Brancher(const Brancher&) = default;
72  Brancher& operator=(Brancher&) = default;
73  Brancher(Brancher&&) = default;
74  Brancher& operator=(Brancher&&) = default;
80  void set_branching_dimension_selection_strategy(const enums::BV branchingVarStratSelection);
81 
89  void set_node_selection_strategy(const enums::NS nodeSelectionStratType);
90 
98  void set_node_selection_score_function(std::function<double(const BabNode&, const std::vector<OptimizationVariable>&)> newNodeScoreFunction);
99 
111  void register_node_change(const int Id, const BabNode& nodeAfterProcessing);
112 
118  void insert_root_node(const BabNode& rootNode);
119 
139  std::pair<bool /*isFixed*/, bool /*canBeConsideredFixed*/> branch_on_node(const BabNode& parentNode, const std::vector<double>& relaxationSolutionPoint, double relaxationSolutionObjValue, unsigned& incumbentNodeId, double relNodeSizeTol = 0.0);
140 
145 
152 
157  void set_new_incumbent_point(std::vector<double> incumbentPoint)
158  {
159  this->_incumbentSolutionPoint = incumbentPoint;
161  } /* pruning_score may be LB but Threshold should be UB (!) thus the following would not work: _internalBranchAndBoundTree.decrease_pruning_score_threshold_to(incumbentIn.get_pruning_score());*/
162 
167 
172 
177  double decrease_pruning_score_threshold_to(const double newThreshold);
178 
184 
191 
195  std::vector<BabNode> get_all_nodes_from_strong_branching(const BabNode& parentNode, const std::vector<double>& relaxationSolutionPoint);
196 
197  private:
205  BabNodeWithInfo _create_node_with_info_from_node(BabNode normalNode, unsigned branchedVariable, BranchingHistoryInfo::BranchStatus branchStatus, double variableRelaxationSolutionPoint, double parentLowerBound, double parentUpperBound) const;
206 
207 
211  double _calculate_branching_point(double lowerBound, double upperBound, double relaxationValue) const;
215  std::pair<BabNodeWithInfo, BabNodeWithInfo> _create_children(unsigned branchVar, const BabNode& parentNode, double branchVariableRelaxSolutionPoint);
216 
225  unsigned _select_branching_dimension_pseudo_costs(const BabNode& parentNode, const std::vector<double>& relaxationSolutionPoint, const double relaxationSolutionObjValue, const std::vector<OptimizationVariable>& globalOptimizationVars) const;
226 
227 
228  std::function<double(const BabNode&, const std::vector<OptimizationVariable>&)> _node_score_calculating_function;
229  std::function<unsigned(const BabNode& parentNode, const std::vector<double>& relaxationSolutionPoint, double relaxationSolutionObjValue, const std::vector<OptimizationVariable>& globalOptimizationVars)> _select_branching_dimension;
231  std::vector<OptimizationVariable> _globalOptimizationVariables;
232  std::vector<double> _pseudocosts_up;
233  std::vector<double> _pseudocosts_down;
234  std::vector<int> _number_of_trials_up;
235  std::vector<int> _number_of_trials_down;
236  std::vector<std::tuple<unsigned /* id*/, double /*parentPruningScore*/, BranchingHistoryInfo>> _nodesWaitingForResponse;
237  std::vector<double> _incumbentSolutionPoint;
238 };
239 
248 unsigned select_branching_dimension_absdiam(const BabNode& parentNode, const std::vector<double>& relaxationSolutionPoint, const double relaxationSolutionObjValue, const std::vector<OptimizationVariable>& globalOptimizationVars);
249 
258 unsigned select_branching_dimension_reldiam(const BabNode& parentNode, const std::vector<double>& relaxationSolutionPoint, const double relaxationSolutionObjValue, const std::vector<OptimizationVariable>& globalOptimizationVars);
262 double relative_distance_to_closest_bound(double pointValue, double bound1, double bound2, const babBase::OptimizationVariable& variable);
263 
267 double low_pruning_score_first(const BabNode& candidate, const std::vector<OptimizationVariable>& globalVars);
271 double low_id_first(const BabNode& candidate, const std::vector<OptimizationVariable>& globalVars);
272 
276 double high_id_first(const BabNode& candidate, const std::vector<OptimizationVariable>& globalVars);
280 std::pair<double, double> calculate_pseudocost_multipliers_minus_and_plus(enums::VT varType, double lowerBound, double upperBound, double branchingPoint, double relaxationSolutionPoint);
281 
282 
283 } //end namespace babBase