Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/coin-or/Clp
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhforrest committed Mar 25, 2024
2 parents d54f1d2 + 555b17b commit 9f4b5a8
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 37 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ jobs:
download_requirements: brew install metis bash
- os: macos-13
build_static: false
flags: CC=gcc-13 CXX=g++-13 OSX=13
flags: CC=gcc-13 CXX=g++-13 OSX=13 ADD_CXXFLAGS=-Wl,-ld_classic
download_requirements: brew install metis bash
steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ${{ github.event.repository.name }}
- name: Install required packages from package manager
run: ${{ matrix.download_requirements }}
- name: Checkout coinbrew
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: coin-or/coinbrew
path: coinbrew
Expand All @@ -66,7 +66,7 @@ jobs:
cp ${{ github.event.repository.name }}/LICENSE dist/
tar -czvf release.tar.gz -C dist .
- name: Checkout package name generation script
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: coin-or-tools/platform-analysis-tools
path: tools
Expand All @@ -81,9 +81,9 @@ jobs:
echo "platform_string=${platform_str}" >> $GITHUB_ENV
- name: Upload Artifact
if: ${{ github.event_name == 'pull_request'}}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-${{ github.head_ref }}-${{ env.platform_string }}.tar.gz
name: ${{ github.event.repository.name }}-${{ env.platform_string }}.tar.gz
path: release.tar.gz
if-no-files-found: error
- name: Upload package to release
Expand Down
27 changes: 11 additions & 16 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,17 @@ jobs:
include: [
{ os: windows-2019, arch: x86_64, msystem: mingw64, debug: true, suffix: "-dbg" },
{ os: windows-2019, arch: x86_64, msystem: mingw64, debug: false, suffix: "" },
{ os: windows-2019, arch: i686, msystem: mingw32, debug: true, suffix: "-dbg" },
{ os: windows-2019, arch: i686, msystem: mingw32, debug: false, suffix: "" },
{ os: windows-2019, arch: msvc, msystem: mingw64, debug: false, suffix: "-md" },
{ os: windows-2022, arch: msvc, msystem: mingw64, debug: false, suffix: "-md" },
{ os: windows-2022, arch: msvs, msystem: mingw64, debug: false, suffix: "" },
]
steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ${{ github.event.repository.name }}
- name: Checkout coinbrew
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: coin-or/coinbrew
path: coinbrew
Expand All @@ -43,7 +41,7 @@ jobs:
uses: ilammy/msvc-dev-cmd@v1
- name: Set up for msvs
if: ${{ matrix.arch == 'msvs' }}
uses: microsoft/setup-msbuild@v1.1
uses: microsoft/setup-msbuild@v2
- name: Set correct host flag and install requirements
if: ${{ matrix.arch != 'msvc' && matrix.arch != 'msvs' }}
run: |
Expand Down Expand Up @@ -90,14 +88,11 @@ jobs:
copy ${{ github.event.repository.name }}\AUTHORS.* dist\.
copy ${{ github.event.repository.name }}\LICENSE.* dist\.
mkdir dist\bin
copy ${{ github.event.repository.name }}\MSVisualStudio\v17\x64\Release\*.exe dist\bin\.
mkdir dist\include\coin
copy ${{ github.event.repository.name }}\src\*.h dist\include\coin\.
copy ${{ github.event.repository.name }}\src\*.hpp dist\include\coin\.
mkdir dist\lib
copy ${{ github.event.repository.name }}\MSVisualStudio\v17\x64\Release\*.lib dist\lib\.
mkdir dist\share\coin\Data
xcopy Data dist\share\coin\Data\. /s /e
copy ${{ github.event.repository.name }}\MSVisualStudio\v17\x64\Release\*.exe dist\bin\
mkdir dist\share
if exist .\Data\Sample xcopy .\Data\Sample dist\share\coin-or-sample /i
if exist .\Data\Netlib xcopy .\Data\Netlib dist\share\coin-or-netlib /i
if exist .\Data\Miplib3 xcopy .\Data\Miplib3 dist\share\coin-or-miplib3 /i
- name: Build project using coinbrew
if: ${{ matrix.arch != 'msvs' }}
run: |
Expand All @@ -115,7 +110,7 @@ jobs:
cp ${{ github.event.repository.name }}/LICENSE dist/
shell: msys2 {0}
- name: Upload failed build directory
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.os}}-{{ matrix.arch }}-debug=${{ matrix.debug }}-failedbuild
Expand All @@ -133,9 +128,9 @@ jobs:
if: ${{ matrix.arch != 'msvc' }}
- name: Upload artifact
if: ${{ github.event_name == 'pull_request'}}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-${{ github.head_ref }}-${{ env.package_suffix }}
name: ${{ github.event.repository.name }}-${{ env.package_suffix }}
path: dist
if-no-files-found: error
- name: Zip up dist contents for release
Expand Down
17 changes: 13 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@

# Ignore VS files
*.suo
*.db
*.bak
*.user
**/.vs/
**/MSVisualStudio/**/Release/
**/MSVisualStudio/**/ReleaseParallel/
**/MSVisualStudio/**/Debug/

# Ignore files created during unit tests
/MSVisualStudio/v17/*.mps
/MSVisualStudio/v17/*.lp
/MSVisualStudio/v17/*.out
**/MSVisualStudio/**/*.mps
**/MSVisualStudio/**/*.lp
**/MSVisualStudio/**/*.out
4 changes: 2 additions & 2 deletions src/ClpSimplex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11454,7 +11454,7 @@ int ClpSimplex::fathom(void *stuff)
int *whichColumn = new int[2 * numberColumns_];
int nBound;
bool tightenBounds = ((specialOptions_ & 64) == 0) ? false : true;
//numberRows_=-numberRows_;//!! flag to say do more work (if test in crunch)
numberRows_=-numberRows_;//!! flag to say do more work (if test in crunch)
ClpSimplex *small = static_cast< ClpSimplexOther * >(this)->crunch(rhs, whichRow, whichColumn,
nBound, false, tightenBounds);
if (small) {
Expand Down Expand Up @@ -12177,7 +12177,7 @@ int ClpSimplex::fathomMany(void *stuff)
int *whichRow = new int[3 * numberRows_];
int *whichColumn = new int[2 * numberColumns_];
int nBound;
//numberRows_=-numberRows_;//!! flag to say do more work (if test in crunch)
numberRows_=-numberRows_;//!! flag to say do more work (if test in crunch)
bool tightenBounds = ((specialOptions_ & 64) == 0) ? false : true;
ClpSimplex *small = static_cast< ClpSimplexOther * >(this)->crunch(rhs, whichRow, whichColumn,
nBound, false, tightenBounds);
Expand Down
8 changes: 4 additions & 4 deletions src/ClpSimplexOther.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,7 @@ ClpSimplex *
ClpSimplexOther::crunch(double *rhs, int *whichRow, int *whichColumn,
int &nBound, bool moreBounds, bool tightenBounds)
{
#if 0
#if 1
/* If you only want to find redundant rows before fathom then
use this and set numberRows_ negative before this call (in ClpSimplex.cpp)
*/
Expand Down Expand Up @@ -1807,9 +1807,9 @@ ClpSimplexOther::crunch(double *rhs, int *whichRow, int *whichColumn,
const int *row = matrix_->getIndices();
const CoinBigIndex *columnStart = matrix_->getVectorStarts();
const int *columnLength = matrix_->getVectorLengths();
char * flags;
double * maxdown;
double * maxup;
char * flags = NULL;
double * maxdown = NULL;
double * maxup = NULL;
if (takeOutSome) {
flags = new char [numberRows_];
maxdown = new double [2*numberRows_];
Expand Down
4 changes: 3 additions & 1 deletion src/ClpSolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3850,7 +3850,9 @@ int ClpSimplex::initialSolve(ClpSolve &options)
int savePerturbation = perturbation();
if (savePerturbation == 50)
setPerturbation(51); // small
if (!finalStatus || finalStatus == 2 || (moreSpecialOptions_ & 2) == 0 || fabs(sumDual) + fabs(sumPrimal) < 1.0e-3) {
if ((finalStatus>=0 && finalStatus <= 2) ||
(moreSpecialOptions_ & 2) == 0 ||
fabs(sumDual) + fabs(sumPrimal) < 1.0e-3) {
if (finalStatus == 2) {
if (sumDual > 1.0e-4) {
// unbounded - get feasible first
Expand Down
16 changes: 12 additions & 4 deletions src/OsiClp/OsiClpSolverInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7939,9 +7939,14 @@ void OsiClpSolverInterface::crunch()
small = static_cast< ClpSimplexOther * >(modelPtr_)->crunch(rhs, whichRow, whichColumn,
nBound, moreBounds, tightenBounds);
#ifndef NDEBUG
int nCopy = 3 * numberRows + 2 * numberColumns;
for (int i = 0; i < nCopy; i++)
assert(whichRow[i] >= -CoinMax(numberRows, numberColumns) && whichRow[i] < CoinMax(numberRows, numberColumns));
if (small) {
int nCopy = 3 * numberRows + 2 * numberColumns;
for (int i = 0; i < nCopy; i++) {
if (i>=small->getNumRows()&&i<numberRows)
continue; // row was removed so doesn't matter
assert(whichRow[i] >= -CoinMax(numberRows, numberColumns) && whichRow[i] < CoinMax(numberRows, numberColumns));
}
}
#endif
smallModel_ = small;
spareArrays_ = spareArrays;
Expand All @@ -7953,8 +7958,11 @@ void OsiClpSolverInterface::crunch()
int nCopy = 3 * numberRows + 2 * numberColumns;
nBound = whichRow[nCopy];
#ifndef NDEBUG
for (int i = 0; i < nCopy; i++)
for (int i = 0; i < nCopy; i++) {
if (i>=smallModel_->getNumRows()&&i<numberRows)
continue; // row was removed so doesn't matter
assert(whichRow[i] >= -CoinMax(numberRows, numberColumns) && whichRow[i] < CoinMax(numberRows, numberColumns));
}
#endif
small = smallModel_;
}
Expand Down

0 comments on commit 9f4b5a8

Please sign in to comment.