Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/bugfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
scip-ci committed Dec 15, 2023
2 parents 6d9a5d4 + be258f1 commit 946b3c7
Show file tree
Hide file tree
Showing 15 changed files with 281 additions and 327 deletions.
22 changes: 7 additions & 15 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@page RN Release notes for SCIP NEXT
@page RN90 Release notes for SCIP 9

@section RNNEXT SCIP NEXT
@section RN900 SCIP 9.0.0
*************************

Features
Expand Down Expand Up @@ -116,6 +116,7 @@ Interface changes
- SCIPestimateRoot() computes estimators for roots with exponent in [0,1]
- SCIPincludeCutselDynamic(), SCIPselectCutsDynamic() to include cutsel_dynamic or use the selection algorithm
- SCIPincludeSepaLagromory() to include the new Lagromory separator
- SCIPconsCompCheck() to compare two constraints based on their check priority

### Command line interface

Expand Down Expand Up @@ -231,6 +232,7 @@ Fixed bugs
separation was enabled for "maxruns + 1" number of runs, i.e., separation was enabled even when "maxruns = 0" was set.
- add safeguard for number of selected cuts
- use double double precision for delta in activity updates of cons_linear.c
- sort constraints in checkSolOrig() to keep the logic of constraint handlers intact

Miscellaneous
-------------
Expand All @@ -241,19 +243,7 @@ Miscellaneous
Known bugs
----------

@page RN80 Release notes for SCIP 8.0

@section RN811 SCIP 8.1.1
*************************

Fixed bugs
----------

Build system
------------

Miscellaneous
-------------
@page RN80 Release notes for SCIP 8.1

@section RN805 SCIP 8.1.0
*************************
Expand Down Expand Up @@ -327,6 +317,8 @@ Miscellaneous

- the parameter change callback is no longer called at the moment a parameter is created

@page RN80 Release notes for SCIP 8.0

@section RN804 SCIP 8.0.4
*************************

Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ endif()
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_RELEASE}")

set(SCIP_VERSION_MAJOR 8)
set(SCIP_VERSION_MINOR 1)
set(SCIP_VERSION_MAJOR 9)
set(SCIP_VERSION_MINOR 0)
set(SCIP_VERSION_PATCH 0)
set(SCIP_VERSION_SUB 5)
set(SCIP_VERSION_API 113)
set(SCIP_VERSION_API 114)

project(SCIP
VERSION ${SCIP_VERSION_MAJOR}.${SCIP_VERSION_MINOR}.${SCIP_VERSION_PATCH}.${SCIP_VERSION_SUB}
Expand Down
2 changes: 1 addition & 1 deletion doc/xternal.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
*
* \verbinclude output.log
*
* @version 8.1.0
* @version 9.0.0
*
* \image html scippy.png
*/
Expand Down
6 changes: 3 additions & 3 deletions make/make.project
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ EMPHBENCHMARK = true
CLOCKTYPE = 1

# set SCIP version here for external projects
SCIP_VERSION_MAJOR = 8
SCIP_VERSION_MINOR = 1
SCIP_VERSION_MAJOR = 9
SCIP_VERSION_MINOR = 0
SCIP_VERSION_PATCH = 0
SCIP_VERSION_SUB = 5
SCIP_VERSION_API = 113
SCIP_VERSION_API = 114
SCIP_VERSION = $(SCIP_VERSION_MAJOR).$(SCIP_VERSION_MINOR).$(SCIP_VERSION_PATCH).$(SCIP_VERSION_SUB)

# compiling and linking parameters
Expand Down
2 changes: 1 addition & 1 deletion scripts/makedist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# For release versions, only use VERSION="x.x.x".
# For development versions, use VERSION="x.x.x.x" with subversion number.

VERSION="8.1.0"
VERSION="9.0.0"
NAME="scip-$VERSION"
if test ! -e release
then
Expand Down
12 changes: 9 additions & 3 deletions src/scip/cons.c
Original file line number Diff line number Diff line change
Expand Up @@ -1952,24 +1952,30 @@ SCIP_RETCODE conshdlrAddUpdateCons(
return SCIP_OKAY;
}

/** compares two constraint handlers w. r. to their separation priority */
/** compares two constraint handlers w.r.t. their separation priority */
SCIP_DECL_SORTPTRCOMP(SCIPconshdlrCompSepa)
{ /*lint --e{715}*/
return ((SCIP_CONSHDLR*)elem2)->sepapriority - ((SCIP_CONSHDLR*)elem1)->sepapriority;
}

/** compares two constraint handlers w. r. to their enforcing priority */
/** compares two constraint handlers w.r.t. their enforcing priority */
SCIP_DECL_SORTPTRCOMP(SCIPconshdlrCompEnfo)
{ /*lint --e{715}*/
return ((SCIP_CONSHDLR*)elem2)->enfopriority - ((SCIP_CONSHDLR*)elem1)->enfopriority;
}

/** compares two constraint handlers w. r. to their feasibility check priority */
/** compares two constraint handlers w.r.t. their feasibility check priority */
SCIP_DECL_SORTPTRCOMP(SCIPconshdlrCompCheck)
{ /*lint --e{715}*/
return ((SCIP_CONSHDLR*)elem2)->checkpriority - ((SCIP_CONSHDLR*)elem1)->checkpriority;
}

/** compares two constraints w.r.t. their feasibility check priority */
SCIP_DECL_SORTPTRCOMP(SCIPconsCompCheck)
{ /*lint --e{715}*/
return ((SCIP_CONS*)elem2)->conshdlr->checkpriority - ((SCIP_CONS*)elem1)->conshdlr->checkpriority;
}

/** copies the given constraint handler to a new scip */
SCIP_RETCODE SCIPconshdlrCopyInclude(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
Expand Down
40 changes: 40 additions & 0 deletions src/scip/prob.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ SCIP_RETCODE probEnsureConssMem(

newsize = SCIPsetCalcMemGrowSize(set, num);
SCIP_ALLOC( BMSreallocMemoryArray(&prob->conss, newsize) );
/* resize sorted original constraints if they exist */
if( prob->origcheckconss != NULL )
{
SCIP_ALLOC( BMSreallocMemoryArray(&prob->origcheckconss, newsize) );
}
prob->consssize = newsize;
}
assert(num <= prob->consssize);
Expand Down Expand Up @@ -321,6 +326,7 @@ SCIP_RETCODE SCIPprobCreate(
else
(*prob)->consnames = NULL;
(*prob)->conss = NULL;
(*prob)->origcheckconss = NULL;
(*prob)->consssize = 0;
(*prob)->nconss = 0;
(*prob)->maxnconss = 0;
Expand All @@ -335,6 +341,7 @@ SCIP_RETCODE SCIPprobCreate(
(*prob)->transformed = transformed;
(*prob)->nlpenabled = FALSE;
(*prob)->permuted = FALSE;
(*prob)->consschecksorted = FALSE;
(*prob)->conscompression = FALSE;

return SCIP_OKAY;
Expand Down Expand Up @@ -449,6 +456,7 @@ SCIP_RETCODE SCIPprobFree(
}

/* free constraint array */
BMSfreeMemoryArrayNull(&(*prob)->origcheckconss);
BMSfreeMemoryArrayNull(&(*prob)->conss);

/* free user problem data */
Expand Down Expand Up @@ -703,6 +711,30 @@ void SCIPprobResortVars(
}
}

/** possibly create and sort the constraints according to check priorties */
SCIP_RETCODE SCIPprobSortConssCheck(
SCIP_PROB* prob /**< problem data */
)
{
if( prob->consschecksorted || prob->transformed )
return SCIP_OKAY;

if( prob->nconss > 0 )
{
/* possibly create and copy constraints */
if( prob->origcheckconss == NULL )
{
SCIP_ALLOC( BMSduplicateMemoryArray(&prob->origcheckconss, prob->conss, prob->consssize) );
}
assert( prob->origcheckconss != NULL );

/* sort original constraint according to check priority */
SCIPsortPtr((void**)prob->origcheckconss, SCIPconsCompCheck, prob->nconss);
}
prob->consschecksorted = TRUE;

return SCIP_OKAY;
}


/*
Expand Down Expand Up @@ -1314,8 +1346,11 @@ SCIP_RETCODE SCIPprobAddCons(
/* add the constraint to the problem's constraint array */
SCIP_CALL( probEnsureConssMem(prob, set, prob->nconss+1) );
prob->conss[prob->nconss] = cons;
if( prob->origcheckconss != NULL )
prob->origcheckconss[prob->nconss] = cons;
prob->nconss++;
prob->maxnconss = MAX(prob->maxnconss, prob->nconss);
prob->consschecksorted = FALSE;
stat->nactiveconssadded++;

/* undelete constraint, if it was globally deleted in the past */
Expand Down Expand Up @@ -1398,6 +1433,11 @@ SCIP_RETCODE SCIPprobDelCons(
assert(prob->conss[arraypos]->addconssetchg == NULL);
prob->conss[arraypos]->addarraypos = arraypos;
prob->nconss--;
prob->consschecksorted = FALSE;

/* if we delete constraints then delete array origcheckconss to be sure */
if( prob->origcheckconss != NULL )
BMSfreeMemoryArray(&prob->origcheckconss);

/* mark the constraint to be no longer in the problem */
cons->addarraypos = -1;
Expand Down
4 changes: 4 additions & 0 deletions src/scip/prob.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ void SCIPprobResortVars(
SCIP_PROB* prob /**< problem data */
);

/** possibly create and sort the constraints according to check priorties */
SCIP_RETCODE SCIPprobSortConssCheck(
SCIP_PROB* prob /**< problem data */
);

/*
* problem modification
Expand Down
10 changes: 7 additions & 3 deletions src/scip/pub_cons.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,22 @@ extern "C" {
* @{
*/

/** compares two constraint handlers w. r. to their separation priority */
/** compares two constraint handlers w.r.t. their separation priority */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPconshdlrCompSepa);

/** compares two constraint handlers w. r. to their enforcing priority */
/** compares two constraint handlers w.r.t. their enforcing priority */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPconshdlrCompEnfo);

/** compares two constraint handlers w. r. to their feasibility check priority */
/** compares two constraint handlers w.r.t. their feasibility check priority */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPconshdlrCompCheck);

/** compares two constraints w.r.t. their feasibility check priority */
SCIP_EXPORT
SCIP_DECL_SORTPTRCOMP(SCIPconsCompCheck);

/** gets name of constraint handler */
SCIP_EXPORT
const char* SCIPconshdlrGetName(
Expand Down
Loading

0 comments on commit 946b3c7

Please sign in to comment.