Skip to content

Commit 869cbd4

Browse files
authored
Merge pull request #2613 from ERGO-Code/fix-compiler-warnings-etc
fix some compiler warnings and removes a debug printf from 1.12.0
2 parents 755a8e0 + 710aaa3 commit 869cbd4

File tree

12 files changed

+31
-28
lines changed

12 files changed

+31
-28
lines changed

highs/ipm/IpxWrapper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12
/* */
23
/* This file is part of the HiGHS linear optimization suite */
34
/* */

highs/ipm/hipo/auxiliary/KrylovMethods.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
namespace hipo {
1010

11-
void applyRotation(double& x, double& y, double c, double s) {
11+
static void applyRotation(double& x, double& y, double c, double s) {
1212
double t = c * x + s * y;
1313
y = -s * x + c * y;
1414
x = t;
1515
}
16-
void getRotation(double x, double y, double& c, double& s) {
16+
static void getRotation(double x, double y, double& c, double& s) {
1717
if (y == 0.0) {
1818
c = 1.0;
1919
s = 0.0;
@@ -27,8 +27,8 @@ void getRotation(double x, double y, double& c, double& s) {
2727
s = t * c;
2828
}
2929
}
30-
void update(std::vector<double>& x, Int k, std::vector<double>& H, Int ldh,
31-
std::vector<double>& s, std::vector<std::vector<double>>& V) {
30+
static void update(std::vector<double>& x, Int k, std::vector<double>& H, Int ldh,
31+
std::vector<double>& s, std::vector<std::vector<double>>& V) {
3232
// Solve H * y = s
3333
std::vector<double> y = s;
3434
for (Int i = k; i >= 0; --i) {

highs/ipm/hipo/factorhighs/Analyse.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,8 @@ Int Analyse::run(Symbolic& S) {
14151415

14161416
#if HIPO_TIMING_LEVEL >= 1
14171417
data_.sumTime(kTimeAnalyse, clock_total.stop());
1418+
#else
1419+
(void)data_; // to avoid an unused-private-field warning
14181420
#endif
14191421

14201422
return kRetOk;

highs/ipm/hipo/factorhighs/DenseFact.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef FACTORHIGHS_DENSE_FACT_H
22
#define FACTORHIGHS_DENSE_FACT_H
33

4+
#include "DataCollector.h"
45
#include "FactorHiGHSSettings.h"
56
#include "ipm/hipo/auxiliary/IntConfig.h"
67

highs/ipm/hipo/factorhighs/DenseFactKernel.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "DenseFact.h"
12
#include "CallAndTimeBlas.h"
23
#include "DataCollector.h"
34
#include "FactorHiGHSSettings.h"
@@ -11,7 +12,7 @@ namespace hipo {
1112

1213
// Dense Factorisation kernel
1314

14-
std::pair<Int, double> maxInCol(Int j, Int n, Int m, double* A, Int lda) {
15+
static std::pair<Int, double> maxInCol(Int j, Int n, Int m, double* A, Int lda) {
1516
// Given the symemtric matrix A, of size nxn, accessed with leading dimension
1617
// lda, in upper triangular format, ignoring rows 0:j-1, find the maximum in
1718
// row/col m.
@@ -37,7 +38,7 @@ std::pair<Int, double> maxInCol(Int j, Int n, Int m, double* A, Int lda) {
3738
return {r, maxval};
3839
}
3940

40-
void staticReg(double& pivot, Int sign, const Regul& regval, double& totalreg) {
41+
static void staticReg(double& pivot, Int sign, const Regul& regval, double& totalreg) {
4142
// apply static regularisation
4243

4344
double old_pivot = pivot;
@@ -48,9 +49,9 @@ void staticReg(double& pivot, Int sign, const Regul& regval, double& totalreg) {
4849
totalreg = pivot - old_pivot;
4950
}
5051

51-
bool blockBunchKaufman(Int j, Int n, double* A, Int lda, Int* swaps, Int* sign,
52-
double thresh, const Regul& regval, double* totalreg,
53-
DataCollector& data) {
52+
static bool blockBunchKaufman(Int j, Int n, double* A, Int lda, Int* swaps, Int* sign,
53+
double thresh, const Regul& regval, double* totalreg,
54+
DataCollector& data) {
5455
// Perform Bunch-Kaufman pivoting within a block of the supernode (see Schenk,
5556
// Gartner, ETNA 2006).
5657
// It works only for upper triangular A.

highs/ipm/hipo/factorhighs/Swaps.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "Swaps.h"
12
#include "CallAndTimeBlas.h"
23
#include "DataCollector.h"
34

highs/ipm/hipo/factorhighs/SymScaling.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
namespace hipo {
99

10-
void product(const std::vector<double>& x, std::vector<double>& y,
11-
const std::vector<Int>& ptr, const std::vector<Int>& rows,
12-
const std::vector<double>& N) {
10+
static void product(const std::vector<double>& x, std::vector<double>& y,
11+
const std::vector<Int>& ptr, const std::vector<Int>& rows,
12+
const std::vector<double>& N) {
1313
// Multiply by matrix E, i.e. matrix A with all entries equal to one, in lower
1414
// triangular form, and sum component-wise product of N with x.
1515
// E * x + N .* x= y
@@ -30,10 +30,10 @@ void product(const std::vector<double>& x, std::vector<double>& y,
3030
// multiply by N
3131
for (Int i = 0; i < n; ++i) y[i] += N[i] * x[i];
3232
}
33-
void CG_for_CR_scaling(const std::vector<double>& b, std::vector<double>& x,
34-
const std::vector<double>& N,
35-
const std::vector<Int>& ptr,
36-
const std::vector<Int>& rows) {
33+
static void CG_for_CR_scaling(const std::vector<double>& b, std::vector<double>& x,
34+
const std::vector<double>& N,
35+
const std::vector<Int>& ptr,
36+
const std::vector<Int>& rows) {
3737
Int n = N.size();
3838

3939
// initial residual

highs/ipm/hipo/factorhighs/Symbolic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const std::vector<Int>& Symbolic::snParent() const { return sn_parent_; }
4545
const std::vector<Int>& Symbolic::snStart() const { return sn_start_; }
4646
const std::vector<Int>& Symbolic::pivotSign() const { return pivot_sign_; }
4747

48-
std::string memoryString(double mem) {
48+
static std::string memoryString(double mem) {
4949
std::stringstream ss;
5050

5151
if (mem < 1024)

highs/ipm/hipo/ipm/CurtisReidScaling.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
namespace hipo {
99

10-
void product(const double* x, std::vector<double>& y,
11-
const std::vector<Int>& ptr, const std::vector<Int>& rows) {
10+
static void product(const double* x, std::vector<double>& y,
11+
const std::vector<Int>& ptr, const std::vector<Int>& rows) {
1212
// Multiply by matrix E, i.e. matrix A with all entries equal to one
1313
// E * x = y
1414
Int n = ptr.size() - 1;
@@ -19,9 +19,9 @@ void product(const double* x, std::vector<double>& y,
1919
}
2020
}
2121

22-
void product_transpose(const double* x, std::vector<double>& y,
23-
const std::vector<Int>& ptr,
24-
const std::vector<Int>& rows) {
22+
static void product_transpose(const double* x, std::vector<double>& y,
23+
const std::vector<Int>& ptr,
24+
const std::vector<Int>& rows) {
2525
// Multiply by matrix E^T, i.e. matrix A^T with all entries equal to one
2626
// E^T * x = y
2727
Int n = ptr.size() - 1;

highs/ipm/hipo/ipm/FactorHiGHSSolver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ void FactorHiGHSSolver::clear() {
2525
FH_.newIter();
2626
}
2727

28-
Int getASstructure(const HighsSparseMatrix& A, std::vector<Int>& ptr,
29-
std::vector<Int>& rows) {
28+
static Int getASstructure(const HighsSparseMatrix& A, std::vector<Int>& ptr,
29+
std::vector<Int>& rows) {
3030
// Augmented system structure
3131

3232
Int nA = A.num_col_;

0 commit comments

Comments
 (0)