Skip to content

Commit

Permalink
Merge branch 'latest' into fix-1423
Browse files Browse the repository at this point in the history
  • Loading branch information
jajhall committed Dec 2, 2024
2 parents ebdeb9a + dcd8bcc commit e1b9cf6
Show file tree
Hide file tree
Showing 67 changed files with 2,162 additions and 393 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-nuget-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.8.0
run: dotnet pack -c Release /p:Version=1.8.1

- uses: actions/upload-artifact@v4
with:
Expand Down
128 changes: 128 additions & 0 deletions .github/workflows/build-unit-tests-external.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: build-unit-tests-external

on: [push, pull_request]

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

steps:
- uses: actions/checkout@v4

- name: Clone extra unit tests repo
shell: bash
working-directory: ${{runner.workspace}}
run: |
git clone https://github.com/galabovaa/highs-unit-tests.git
- name: Create symlink
shell: bash
working-directory: ${{runner.workspace}}
run: ln -s ${{runner.workspace}}/highs-unit-tests $GITHUB_WORKSPACE/check

- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Configure CMake All
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DBUILD_EXTRA_UNIT_TESTS=ON -DBUILD_EXTRA_UNIT_ONLY=ON -DBUILD_CXX=OFF

- name: Build All
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
cmake --build . --parallel
- name: Test Extra Only
working-directory: ${{runner.workspace}}/build
shell: bash
run: ctest --parallel --timeout 300 --output-on-failure

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

steps:
- uses: actions/checkout@v4

- name: Clone extra unit tests repo
shell: bash
working-directory: ${{runner.workspace}}
run: |
git clone https://github.com/galabovaa/highs-unit-tests.git
- name: Create symlink
shell: bash
working-directory: ${{runner.workspace}}
run: ln -s ${{runner.workspace}}/highs-unit-tests $GITHUB_WORKSPACE/check

- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Configure CMake All
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DALL_TESTS=ON -DBUILD_EXTRA_UNIT_TESTS=ON

- name: Build All
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
cmake --build . --parallel
- name: Test All
working-directory: ${{runner.workspace}}/build
shell: bash
run: ctest --parallel --timeout 300 --output-on-failure

# release__windows_extra_unit_tests:
# runs-on: windows-2019

# steps:
# - uses: actions/checkout@v4

# - name: Create Build Environment
# run: cmake -E make_directory ${{runner.workspace}}/build

# - name: Clone extra unit tests repo
# working-directory: ${{runner.workspace}}/build
# run: git clone https://github.com/galabovaa/highs-unit-tests.git

# - name: Create symlink
# shell: bash
# working-directory: $GITHUB_WORKSPACE/check
# run: mklink /d highs-unit-tests ${{runner.workspace}}/highs-unit-tests

# - name: Configure CMake
# # Use a bash shell so we can use the same syntax for environment variable
# # access regardless of the host operating system
# shell: bash
# working-directory: ${{runner.workspace}}/build
# # Note the current convention is to use the -S and -B options here to specify source
# # and build directories, but this is only available with CMake 3.13 and higher.
# # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
# run: cmake $GITHUB_WORKSPACE -DALL_TESTS=ON -DBUILD_EXTRA_UNIT_TESTS=ON

# - name: Build
# working-directory: ${{runner.workspace}}/build
# shell: bash
# # Execute the build. You can specify a specific target with "--target <NAME>"
# run: cmake --build . --config Release --parallel

# - name: Unit Test Extra
# working-directory: ${{runner.workspace}}/build
# shell: bash
# run: ./bin/Release/unit_tests.exe highs-names-extra

# - name: Test
# working-directory: ${{runner.workspace}}/build
# shell: bash
# # Execute tests defined by the CMake configuration.
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest --timeout 300 --output-on-failure -C Release
4 changes: 2 additions & 2 deletions .github/workflows/test-nuget-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.8.0
run: dotnet pack -c Release /p:Version=1.8.1

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.8.0
run: dotnet pack -c Release /p:Version=1.8.1

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-nuget-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.8.0
run: dotnet pack -c Release /p:Version=1.8.1

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.8.0
run: dotnet pack -c Release /p:Version=1.8.1

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.8.0
run: dotnet pack -c Release /p:Version=1.8.1

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.8.0
run: dotnet pack -c Release /p:Version=1.8.1

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets
Expand Down Expand Up @@ -212,7 +212,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.8.0
run: dotnet pack -c Release /p:Version=1.8.1

- name: Add local feed
run: dotnet nuget add source -n name ${{runner.workspace}}\nugets
Expand All @@ -228,5 +228,5 @@ jobs:
dotnet new console
rm Program.cs
cp ${{runner.workspace}}\HiGHS\examples\call_highs_from_csharp.cs .
dotnet add package Highs.Native -v 1.8.0 -s ${{runner.workspace}}\nugets
dotnet add package Highs.Native -v 1.8.1 -s ${{runner.workspace}}\nugets
dotnet run
4 changes: 2 additions & 2 deletions .github/workflows/test-nuget-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.8.0
run: dotnet pack -c Release /p:Version=1.8.1

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.8.0
run: dotnet pack -c Release /p:Version=1.8.1

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-nuget-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.8.0
run: dotnet pack -c Release /p:Version=1.8.1

- name: Add local feed
run: dotnet nuget add source -n name ${{runner.workspace}}\nugets
Expand All @@ -49,5 +49,5 @@ jobs:
dotnet new console
rm Program.cs
cp ${{runner.workspace}}\HiGHS\examples\call_highs_from_csharp.cs .
dotnet add package Highs.Native -v 1.8.0 -s ${{runner.workspace}}\nugets
dotnet add package Highs.Native -v 1.8.1 -s ${{runner.workspace}}\nugets
dotnet run
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,7 @@ CMakeSettings.json
# Nix
.direnv/
result

# Extra unit tests
highs-unit-tests
highs-problem-set
29 changes: 22 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ cmake_minimum_required(VERSION 3.15...3.27)
# set preference for clang compiler and intel compiler over gcc and other compilers
include(Platform/${CMAKE_SYSTEM_NAME}-Determine-C OPTIONAL)
include(Platform/${CMAKE_SYSTEM_NAME}-C OPTIONAL)
set(CMAKE_C_COMPILER_NAMES clang icc cc ${CMAKE_C_COMPILER_NAMES})
set(CMAKE_C_COMPILER_NAMES clang gcc icx cc ${CMAKE_C_COMPILER_NAMES})

include(Platform/${CMAKE_SYSTEM_NAME}-Determine-CXX OPTIONAL)
include(Platform/${CMAKE_SYSTEM_NAME}-CXX OPTIONAL)
set(CMAKE_CXX_COMPILER_NAMES clang++ icpc c++ ${CMAKE_CXX_COMPILER_NAMES})
set(CMAKE_CXX_COMPILER_NAMES clang++ g++ icpx c++ ${CMAKE_CXX_COMPILER_NAMES})

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

Expand Down Expand Up @@ -82,6 +82,21 @@ include(CMakeDependentOption)
CMAKE_DEPENDENT_OPTION(ALL_TESTS "Build all tests" OFF "BUILD_TESTING;BUILD_CXX" OFF)
message(STATUS "Build all tests: ${ALL_TESTS}")

option(BUILD_EXTRA_UNIT_TESTS "Build extra unit tests" OFF)
if (BUILD_EXTRA_UNIT_TESTS)
message(STATUS "Build extra unit tests: ON")
endif()

CMAKE_DEPENDENT_OPTION(BUILD_EXTRA_UNIT_ONLY "Build extra unit tests ONLY" OFF "BUILD_EXTRA_UNIT_TESTS" OFF)
if (BUILD_EXTRA_UNIT_ONLY)
message(STATUS "Build only extra unit tests: ON")
endif()

CMAKE_DEPENDENT_OPTION(BUILD_EXTRA_PROBLEM_SET "Build extra instance tests" OFF "BUILD_TESTING" OFF)
if (BUILD_EXTRA_PROBLEM_SET)
message(STATUS "Build extra instance tests: ON")
endif()

option(ZLIB "ZLIB" ON)
message(STATUS "ZLIB: ${ZLIB}")
if (PYTHON_BUILD_SETUP)
Expand Down Expand Up @@ -582,14 +597,14 @@ else(FAST_BUILD)

if(BUILD_CXX)
add_subdirectory(app)
if(BUILD_TESTING)
enable_testing()
add_subdirectory(check)
endif()
# Add tests in examples/tests
add_subdirectory(examples)
endif()

if(BUILD_TESTING)
enable_testing()
add_subdirectory(check)
endif()

include(python-highs)

option(USE_DOTNET_STD_21 "Use .Net Standard 2.1 support" ON)
Expand Down
16 changes: 4 additions & 12 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +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 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



2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module(
name = "highs",
version = "1.8.0",
version = "1.8.1",
)

bazel_dep(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ The nuget package Highs.Native is on https://www.nuget.org, at https://www.nuget
It can be added to your C# project with `dotnet`

```shell
dotnet add package Highs.Native --version 1.8.0
dotnet add package Highs.Native --version 1.8.1
```

The nuget package contains runtime libraries for
Expand Down
2 changes: 1 addition & 1 deletion Version.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HIGHS_MAJOR=1
HIGHS_MINOR=8
HIGHS_PATCH=0
HIGHS_PATCH=1
#PRE_RELEASE=YES
Loading

0 comments on commit e1b9cf6

Please sign in to comment.