Skip to content

Commit

Permalink
merge with latest
Browse files Browse the repository at this point in the history
  • Loading branch information
galabovaa committed Dec 20, 2024
2 parents e68b9f8 + efa50c5 commit f35d8f4
Show file tree
Hide file tree
Showing 64 changed files with 2,167 additions and 791 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/build-bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: bazelbuild/setup-bazelisk@v2

- name: Mount bazel cache # Optional
uses: actions/cache@v3
with:
path: "~/.cache/bazel"
key: bazel
- uses: bazelbuild/setup-bazelisk@v3

- name: bazel clean
run: bazel clean

- name: build bazel
run: |
bazel build //...
run: bazel build --enable_bzlmod //...

- name: test
- name: test all
run: bazel test --enable_bzlmod //...

- name: test example
run: ./bazel-bin/call-highs-example
3 changes: 2 additions & 1 deletion .github/workflows/build-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master

- name: Build sdist
run: |
Expand Down Expand Up @@ -194,7 +195,7 @@ jobs:
python -m pip install pytest
python -m pytest
build_wheel_windows:
build_wheel_windows_313:
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/build-python-sdist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: build-python-sdist

on: [push, pull_request]

jobs:
build_sdist_ubuntu:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master

- name: Build sdist
shell: bash
run: pipx run build --sdist

- name: check metadata
run: pipx run twine check dist/*

- name: install highspy
run: |
python3 -m pip install dist/*.tar.gz --user
- name: Test Python Examples
run: |
python3 ./examples/call_highs_from_python_highspy.py
python3 ./examples/call_highs_from_python_mps.py
python3 ./examples/call_highs_from_python.py
python3 ./examples/minimal.py
build_sdist_mac:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]

steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master

- name: Build sdist
shell: bash
run: pipx run build --sdist

- name: check metadata
run: pipx run twine check dist/*

- name: install highspy
run: |
python3 -m venv path/to/venv
source path/to/venv/bin/activate
python3 -m pip install dist/*.tar.gz
- name: Test Python Examples
run: |
source path/to/venv/bin/activate
python3 ./examples/call_highs_from_python_highspy.py
python3 ./examples/call_highs_from_python_mps.py
python3 ./examples/call_highs_from_python.py
python3 ./examples/minimal.py
build_sdist_win:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Build sdist
shell: bash
run: pipx run build --sdist

- name: check metadata
run: pipx run twine check dist/*

- name: install highspy
run: |
$item = Get-ChildItem dist
python -m pip install "$item"
- name: Test Python Examples
run: |
python ./examples/call_highs_from_python_highspy.py
python ./examples/call_highs_from_python_mps.py
python ./examples/call_highs_from_python.py
python ./examples/minimal.py
10 changes: 6 additions & 4 deletions .github/workflows/build-wheels-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
shell: bash
run: pipx run build --sdist

# - name: check metadata
# run: pipx run twine check python/dist/*
- name: check metadata
run: pipx run twine check dist/*

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: python/dist/*.tar.gz
path: dist/*.tar.gz

build_wheels:
name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }}
Expand Down Expand Up @@ -86,13 +86,14 @@ jobs:
# Publish highspy to TestPyPI
# runs-on: ubuntu-latest
# needs: [build_wheels, build_sdist]
# # needs: [build_sdist]

# # upload to PyPI on every tag starting with 'v'
# # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')

# environment:
# name: testpypi
# url: https://testpypi.org/p/highspy
# url: https://test.pypi.org/p/highspy

# permissions:
# id-token: write # IMPORTANT: mandatory for trusted publishing
Expand All @@ -107,6 +108,7 @@ jobs:
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/
# verbose: true

upload_pypi:
name: >-
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
shell: bash
run: pipx run build --sdist

- name: check metadata
run: pipx run twine check dist/*

build_wheels:
name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }}
runs-on: ${{ matrix.buildplat[0] }}
Expand Down
2 changes: 0 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ cc_library(
name = "highs",
srcs = glob([
"extern/filereaderlp/*.cpp",
"extern/zlib/*.cpp",
"src/interfaces/highs_c_api.cpp",
"src/io/*.cpp",
"src/ipm/*.cpp",
Expand All @@ -37,7 +36,6 @@ cc_library(
"src/util/*.cpp",
]),
hdrs = glob([
"HConfig.h",
"**/*.h",
"src/qpsolver/*.hpp",
"src/Highs.h",
Expand Down
19 changes: 10 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -346,16 +346,17 @@ if(NOT FAST_BUILD)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${HIGHS_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
endif()

if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86\_64|i686)")
if (WIN32)
message("FLAG_MPOPCNT_SUPPORTED is not available on this architecture")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt")
endif()
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(ppc64|powerpc64)" AND NOT APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcntd")
include(CheckCXXCompilerFlag)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(ppc64|powerpc64)" AND NOT APPLE)
check_cxx_compiler_flag("-mpopcntd" COMPILER_SUPPORTS_POPCNTD)
if(COMPILER_SUPPORTS_POPCNTD)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcntd")
endif()
else()
message("FLAG_MPOPCNT_SUPPORTED is not available on this architecture")
check_cxx_compiler_flag("-mpopcnt" COMPILER_SUPPORTS_POPCNT)
if(COMPILER_SUPPORTS_POPCNT)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt")
endif()
endif()

option(DEBUGSOL "check the debug solution" OFF)
Expand Down
34 changes: 4 additions & 30 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,13 @@

## Code changes

When primal infeasiblity is detected in presolve, no dual ray is available so, previously, the `has_dual_ray` parameter of `Highs::getDualRay` returned false and that was it. Now, if a null pointer is not passed for `dual_ray_value`, `Highs::getDualRay` will compute a dual ray - at the cost of solving the feasiblility LP without presolve. The same is now true for `Highs::getPrimalRay`. `Highs::getDualUnboundednessDirection` has been introduced to determine the product between the constraint matrix and the dual ray, forcing the calculation of the latter if necessary. Once a dual ray is known for the incumbent model in HiGHS, subsequent calls to `Highs::getDualRay` and `Highs::getDualUnboundednessDirection` will be vastly cheaper

The method `Highs::getDualObjectiveValue` now exitsts to compute the dual objective value, returning `HighsStatus::kError` if it is not possible.

The method `Highs::getStandardFormLp` now exists to return the incumbent LP in standard form - overlooking any integrality or Hessian. To determine the sizes of the vectors of data, the method is called without specifying pointers to the data arrays.

Added documentation on the use of presolve when solving an incumbent model, and clarifying the use of the method `Highs::presolve`.

HiGHS will now read a `MIPLIB` solution file

Added time limit check to `HPresolve::strengthenInequalities`

Added `getColIntegrality` to `highspy`

Now computing the primal-dual integral, reporting it, and making it available as `HighsInfo::primal_dual_integral`

Trivial primal heuristics "all zero", "all lower bound", "all upper bound", and "lock point" added to the MIP solver

# Build changes

Added wheels for Python 3.13

Updated command line options and moved them out of the library and into the executable







HiGHS now handles multiple linear objectives by either blending using weights, or performing lexicographic optimization: see https://ergo-code.github.io/HiGHS/stable/guide/further/#guide-multi-objective-optimization

Fixed minor bug in bound checking in presolve

Fixed bug in `floor(HighsCDouble x)` and `ceil(HighsCDouble x)` when argument is small

Added some sanity checks to Highs::writeLocalModel to prevent segfaults if called directly by a user



10 changes: 7 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
"""highs module
"""
module(
name = "highs",
version = "1.8.1",
)

bazel_dep(
name = "bazel_skylib",
version = "1.6.1",
version = "1.7.1",
)

bazel_dep(
name = "rules_cc",
version = "0.0.9",
version = "0.0.16",
)

bazel_dep(
name = "zlib",
version = "1.3.1.bcr.1",
version = "1.3.1.bcr.3",
)
23 changes: 10 additions & 13 deletions check/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY))
TestBasis.cpp
TestBasisSolves.cpp
TestCrossover.cpp
TestHighsCDouble.cpp
TestHighsHash.cpp
TestHighsIntegers.cpp
TestHighsParallel.cpp
Expand All @@ -79,6 +80,7 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY))
TestLpModification.cpp
TestLpOrientation.cpp
TestModelProperties.cpp
TestMultiObjective.cpp
TestPdlp.cpp
TestPresolve.cpp
TestQpSolver.cpp
Expand All @@ -88,16 +90,10 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY))
TestThrow.cpp
TestTspSolver.cpp
TestUserScale.cpp
Avgas.cpp)

# todo: IG
if (NOT APPLE)
# Bug with updated IPX code and gas11. Maybe somehow related to the rpath on
# macOS (Lukas). Only triggered by gas11 with no presolve which is strange.
# may be an interface related issue which will pop up soon.
# works OK on linux. The test was added to doctest for macOS but still hanging.
set(TEST_SOURCES ${TEST_SOURCES} TestSpecialLps.cpp TestLpSolvers.cpp TestMipSolver.cpp)
endif()
Avgas.cpp
TestSpecialLps.cpp
TestLpSolvers.cpp
TestMipSolver.cpp)

if (BUILD_EXTRA_UNIT_TESTS)
list(APPEND CMAKE_MODULE_PATH "${HIGHS_SOURCE_DIR}/check/highs-unit-tests")
Expand Down Expand Up @@ -276,9 +272,10 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY))
"standgub\; 1.25769949\;"
)
elseif(WIN32)
# on windows e226 model status is unknown, rel gap e00
# on windows e226 model status is unknown
# on windows 25fv47 model status can be unknown, with objective 5.5018458957e+03
set(pdlpInstances
"25fv47\; 5.50184588\;"
"25fv47\; 5.5018458\;"
"adlittle\; 2.25494963\;"
"afiro\;-4.64753142\;"
"avgas\;-7.749999999\;"
Expand Down Expand Up @@ -487,4 +484,4 @@ if (BUILD_EXTRA_UNIT_TESTS AND BUILD_EXTRA_UNIT_ONLY)
target_link_libraries(cublas_gpu_start ${CUDA_LIBRARY})
endif()

endif()
endif()
Loading

0 comments on commit f35d8f4

Please sign in to comment.