Skip to content

Commit 1cbe637

Browse files
committed
Merge remote-tracking branch 'origin/v10-minor'
2 parents 72ec2a0 + 7488e7f commit 1cbe637

File tree

12 files changed

+43
-53
lines changed

12 files changed

+43
-53
lines changed

CHANGELOG

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1978,7 +1978,7 @@ Constraint handlers for NLP:
19781978
- removed SCIPincludeQuadconsUpgrade()
19791979
- removed SCIPcreateConsQuadratic2(), SCIPcreateConsBasicQuadratic2()
19801980
- deprecated SCIPcreateConsBasicQuadratic(), use SCIPcreateConsBasicQuadraticNonlinear() instead
1981-
- deprecated SCIPcreateConsBasicQuadratic(), use SCIPcreateConsQuadraticNonlinear() instead
1981+
- deprecated SCIPcreateConsQuadratic(), use SCIPcreateConsQuadraticNonlinear() instead
19821982
- deprecated SCIPaddConstantQuadratic(), use SCIPgetLhsNonlinear() and SCIPgetRhsNonlinear() instead
19831983
- deprecated SCIPaddLinearVarQuadratic(), use SCIPaddLinearVarNonlinear() instead
19841984
- deprecated SCIPaddQuadVarQuadratic(), use SCIPaddLinearVarNonlinear() and SCIPaddExprNonlinear() instead

src/lpi/lpi_glop.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ SCIP_RETCODE SCIPlpiAddCols(
396396
const ColIndex col = lpi->linear_program->CreateNewVariable();
397397
lpi->linear_program->SetVariableBounds(col, lb[i], ub[i]);
398398
lpi->linear_program->SetObjectiveCoefficient(col, obj[i]);
399-
const int end = (nnonz == 0 || i == ncols - 1) ? nnonz : beg[i + 1];
399+
const int end = (i == ncols - 1) ? nnonz : beg[i + 1];
400400
while ( nz < end )
401401
{
402402
lpi->linear_program->SetCoefficient(RowIndex(ind[nz]), col, val[nz]);
@@ -530,7 +530,7 @@ SCIP_RETCODE SCIPlpiAddRows(
530530
{
531531
const RowIndex row = lpi->linear_program->CreateNewConstraint();
532532
lpi->linear_program->SetConstraintBounds(row, lhs[i], rhs[i]);
533-
const int end = (nnonz == 0 || i == nrows - 1) ? nnonz : beg[i + 1];
533+
const int end = (i == nrows - 1) ? nnonz : beg[i + 1];
534534
while ( nz < end )
535535
{
536536
lpi->linear_program->SetCoefficient(row, ColIndex(ind[nz]), val[nz]);
@@ -805,11 +805,11 @@ SCIP_RETCODE SCIPlpiScaleRow(
805805
SCIP_Real scaleval /**< scaling multiplier */
806806
)
807807
{
808-
SCIP_Real* vals;
808+
SCIP_Real* vals = NULL;
809809
SCIP_Real lhs;
810810
SCIP_Real rhs;
811811
int nnonz;
812-
int* inds;
812+
int* inds = NULL;
813813
int beg;
814814

815815
assert( lpi != NULL );
@@ -868,12 +868,12 @@ SCIP_RETCODE SCIPlpiScaleCol(
868868
SCIP_Real scaleval /**< scaling multiplier */
869869
)
870870
{
871-
SCIP_Real* vals;
871+
SCIP_Real* vals = NULL;
872872
SCIP_Real lb;
873873
SCIP_Real ub;
874874
SCIP_Real obj;
875875
int nnonz;
876-
int* inds;
876+
int* inds = NULL;
877877
int beg;
878878

879879
assert( lpi != NULL );
@@ -1655,7 +1655,7 @@ SCIP_RETCODE strongbranch(
16551655
/** performs strong branching iterations on one @b fractional candidate */
16561656
SCIP_RETCODE SCIPlpiStrongbranchFrac(
16571657
SCIP_LPI* lpi, /**< LP interface structure */
1658-
int col_index, /**< column to apply strong branching on */
1658+
int col, /**< column to apply strong branching on */
16591659
SCIP_Real psol, /**< fractional current primal solution value of column */
16601660
int itlim, /**< iteration limit for strong branchings */
16611661
SCIP_Real* down, /**< stores dual bound after branching column down */
@@ -1674,9 +1674,9 @@ SCIP_RETCODE SCIPlpiStrongbranchFrac(
16741674
assert( downvalid != NULL );
16751675
assert( upvalid != NULL );
16761676

1677-
SCIPdebugMessage("calling strongbranching on fractional variable %d (%d iterations)\n", col_index, itlim);
1677+
SCIPdebugMessage("calling strongbranching on fractional variable %d (%d iterations)\n", col, itlim);
16781678

1679-
SCIP_CALL( strongbranch(lpi, col_index, psol, itlim, down, up, downvalid, upvalid, iter) );
1679+
SCIP_CALL( strongbranch(lpi, col, psol, itlim, down, up, downvalid, upvalid, iter) );
16801680

16811681
return SCIP_OKAY;
16821682
}

src/lpi/lpi_grb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,7 +1736,7 @@ SCIP_RETCODE SCIPlpiDelCols(
17361736
SCIPdebugMessage("deleting %d columns from Gurobi\n", ndelcols);
17371737

17381738
/* handle empty range */
1739-
if( ndelcols <= 0 )
1739+
if( ndelcols <= 0 ) /* cppcheck-suppress knownConditionTrueFalse */
17401740
return SCIP_OKAY;
17411741

17421742
invalidateSolution(lpi);
@@ -1917,7 +1917,7 @@ SCIP_RETCODE SCIPlpiDelRows(
19171917
SCIPdebugMessage("deleting %d rows from Gurobi\n", ndelrows);
19181918

19191919
/* handle empty range */
1920-
if( ndelrows <= 0 )
1920+
if( ndelrows <= 0 ) /* cppcheck-suppress knownConditionTrueFalse */
19211921
return SCIP_OKAY;
19221922

19231923
invalidateSolution(lpi);

src/lpi/lpi_highs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class HighsSCIP : public Highs
135135

136136
public:
137137

138-
HighsSCIP(
138+
explicit HighsSCIP(
139139
SCIP_MESSAGEHDLR* messagehdlr = NULL, /**< message handler */
140140
const char* probname = NULL /**< name of problem */
141141
)

src/lpi/lpi_msk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4469,7 +4469,7 @@ SCIP_RETCODE SCIPlpiGetBInvCol(
44694469
*/
44704470
SCIP_RETCODE SCIPlpiGetBInvARow(
44714471
SCIP_LPI* lpi, /**< LP interface structure */
4472-
int row, /**< row number */
4472+
int r, /**< row number */
44734473
const SCIP_Real* binvrow, /**< row in (A_B)^-1 from prior call to SCIPlpiGetBInvRow(), or NULL */
44744474
SCIP_Real* coef, /**< vector to return coefficients of the row */
44754475
int* inds, /**< array to store the non-zero indices, or NULL */
@@ -4511,7 +4511,7 @@ SCIP_RETCODE SCIPlpiGetBInvARow(
45114511

45124512
/* get dense vector */
45134513
SCIP_ALLOC( BMSallocMemoryArray(&binv, nrows) );
4514-
SCIP_CALL( SCIPlpiGetBInvRow(lpi, row, binv, NULL, NULL) );
4514+
SCIP_CALL( SCIPlpiGetBInvRow(lpi, r, binv, NULL, NULL) );
45154515
}
45164516
else
45174517
binv = (SCIP_Real*)binvrow;

src/lpi/lpi_spx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class SPxSCIP : public SoPlex
230230
SCIP_MESSAGEHDLR* _messagehdlr; /**< messagehdlr handler for printing messages, or NULL */
231231

232232
public:
233-
SPxSCIP(
233+
explicit SPxSCIP(
234234
SCIP_MESSAGEHDLR* messagehdlr = NULL, /**< message handler */
235235
const char* probname = NULL /**< name of problem */
236236
)

src/lpi/lpi_xprs.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,17 +1344,17 @@ SCIP_RETCODE SCIPlpiChgCoef(
13441344
/** changes the objective sense */
13451345
SCIP_RETCODE SCIPlpiChgObjsen(
13461346
SCIP_LPI* lpi, /**< LP interface structure */
1347-
SCIP_OBJSEN objsense /**< new objective sense */
1347+
SCIP_OBJSEN objsen /**< new objective sense */
13481348
)
13491349
{
13501350
assert(lpi != NULL);
13511351
assert(lpi->xprslp != NULL);
13521352

1353-
SCIPdebugMessage("changing objective sense in Xpress to %d\n", objsense);
1353+
SCIPdebugMessage("changing objective sense in Xpress to %d\n", objsen);
13541354

13551355
invalidateSolution(lpi);
13561356

1357-
CHECK_ZERO( lpi->messagehdlr, XPRSchgobjsense(lpi->xprslp, xprsObjsen(objsense)) );
1357+
CHECK_ZERO( lpi->messagehdlr, XPRSchgobjsense(lpi->xprslp, xprsObjsen(objsen)) );
13581358

13591359
return SCIP_OKAY;
13601360
}
@@ -1629,25 +1629,25 @@ SCIP_RETCODE SCIPlpiGetRows(
16291629
SCIP_LPI* lpi, /**< LP interface structure */
16301630
int firstrow, /**< first row to get from LP */
16311631
int lastrow, /**< last row to get from LP */
1632-
SCIP_Real* lhss, /**< buffer to store left hand side vector, or NULL */
1633-
SCIP_Real* rhss, /**< buffer to store right hand side vector, or NULL */
1632+
SCIP_Real* lhs, /**< buffer to store left hand side vector, or NULL */
1633+
SCIP_Real* rhs, /**< buffer to store right hand side vector, or NULL */
16341634
int* nnonz, /**< pointer to store the number of nonzero elements returned, or NULL */
16351635
int* beg, /**< buffer to store start index of each row in ind- and val-array, or NULL */
16361636
int* ind, /**< buffer to store column indices of constraint matrix entries, or NULL */
16371637
SCIP_Real* val /**< buffer to store values of constraint matrix entries, or NULL */
16381638
)
16391639
{
1640-
assert((lhss != NULL && rhss != NULL) || (lhss == NULL && rhss == NULL));
1640+
assert((lhs != NULL && rhs != NULL) || (lhs == NULL && rhs == NULL));
16411641
assert((nnonz != NULL && beg != NULL && ind != NULL && val != NULL) || (nnonz == NULL && beg == NULL && ind == NULL && val == NULL));
16421642

16431643
debugCheckRowrang(lpi, firstrow, lastrow);
16441644

16451645
SCIPdebugMessage("getting rows %d to %d\n", firstrow, lastrow);
16461646

1647-
if( lhss != NULL )
1647+
if( lhs != NULL )
16481648
{
16491649
/* get left and right sides */
1650-
SCIP_CALL( SCIPlpiGetSides(lpi, firstrow, lastrow, lhss, rhss) );
1650+
SCIP_CALL( SCIPlpiGetSides(lpi, firstrow, lastrow, lhs, rhs) );
16511651
}
16521652

16531653
if( nnonz != NULL )
@@ -3001,7 +3001,7 @@ SCIP_RETCODE SCIPlpiGetBasisInd(
30013001
*/
30023002
SCIP_RETCODE SCIPlpiGetBInvRow(
30033003
SCIP_LPI* lpi, /**< LP interface structure */
3004-
int row, /**< row number */
3004+
int r, /**< row number */
30053005
SCIP_Real* coef, /**< pointer to store the coefficients of the row */
30063006
int* inds, /**< array to store the non-zero indices, or NULL */
30073007
int* ninds /**< pointer to store the number of non-zero indices, or NULL
@@ -3015,15 +3015,15 @@ SCIP_RETCODE SCIPlpiGetBInvRow(
30153015
assert(coef != NULL);
30163016
SCIP_UNUSED(inds);
30173017

3018-
SCIPdebugMessage("getting binv-row %d\n", row);
3018+
SCIPdebugMessage("getting binv-row %d\n", r);
30193019

30203020
/* can only return dense result */
30213021
if ( ninds != NULL )
30223022
*ninds = -1;
30233023

30243024
CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_ROWS, &nrows) );
30253025
BMSclearMemoryArray(coef, nrows);
3026-
coef[row] = 1.0;
3026+
coef[r] = 1.0;
30273027
CHECK_ZERO( lpi->messagehdlr, XPRSbtran(lpi->xprslp, coef) );
30283028

30293029
return SCIP_OKAY;

src/lpiexact/lpiexact_qsoex.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,12 @@ void printGMP(
156156
{
157157
char* buffer;
158158
buffer = (char*) malloc(mpz_sizeinbase(mpq_numref(val), 10) + mpz_sizeinbase(mpq_denref(val), 10) + 3);
159-
(void)mpq_get_str(buffer, 10, val);
160-
printf("%s \n", buffer);
161-
free(buffer);
159+
if( buffer != NULL )
160+
{
161+
(void)mpq_get_str(buffer, 10, val);
162+
printf("%s \n", buffer);
163+
free(buffer);
164+
}
162165
}
163166

164167
/** returns the number of packets needed to store column packet information */

src/lpiexact/lpiexact_spx.cpp

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ class SPxexSCIP : public SoPlex
268268
SCIP_MESSAGEHDLR* _messagehdlr; /**< messagehdlr handler for printing messages, or NULL */
269269

270270
public:
271-
SPxexSCIP(
271+
explicit SPxexSCIP(
272272
SCIP_MESSAGEHDLR* messagehdlr = NULL, /**< message handler */
273273
const char* probname = NULL /**< name of problem */
274274
)
@@ -1645,26 +1645,13 @@ SCIP_RETCODE SCIPlpiExactGetCols(
16451645

16461646
if( lb != NULL )
16471647
{
1648-
if( lpi->spx->boolParam(SoPlex::PERSISTENTSCALING) )
1649-
{
1650-
const VectorRational& lbvec = lpi->spx->lowerRational();
1651-
const VectorRational& ubvec = lpi->spx->upperRational();
1648+
const VectorRational& lbvec = lpi->spx->lowerRational();
1649+
const VectorRational& ubvec = lpi->spx->upperRational();
16521650

1653-
for( i = firstcol; i <= lastcol; ++i )
1654-
{
1655-
RsetSpxR(lpi, lb[i-firstcol], lbvec[i]);
1656-
RsetSpxR(lpi, ub[i-firstcol], ubvec[i]);
1657-
}
1658-
}
1659-
else
1651+
for( i = firstcol; i <= lastcol; ++i )
16601652
{
1661-
const VectorRational& lbvec = lpi->spx->lowerRational();
1662-
const VectorRational& ubvec = lpi->spx->upperRational();
1663-
for( i = firstcol; i <= lastcol; ++i )
1664-
{
1665-
RsetSpxR(lpi, lb[i-firstcol], lbvec[i]);
1666-
RsetSpxR(lpi, ub[i-firstcol], ubvec[i]);
1667-
}
1653+
RsetSpxR(lpi, lb[i-firstcol], lbvec[i]);
1654+
RsetSpxR(lpi, ub[i-firstcol], ubvec[i]);
16681655
}
16691656
}
16701657

src/scip/cons_xor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ SCIP_RETCODE applyFixings(
10221022
if( intoffsetconst >= 1 || intoffsetvals[1] != -1.0 || intoffsetnvars > 2 ) /*lint !e777*/
10231023
{
10241024
SCIP_Real lb = -(double)intoffsetconst;
1025-
SCIP_Real ub = -(double)intoffsetconst;
1025+
SCIP_Real ub = lb;
10261026
SCIP_Bool aggregated;
10271027
SCIP_Bool infeasible = FALSE;
10281028
SCIP_Bool redundant = FALSE;

0 commit comments

Comments
 (0)