Skip to content

Commit 47786e3

Browse files
committed
Reintroduce parallel layer, with changes; compute stack size in serial and parallel; correct reordering of children
1 parent 071a819 commit 47786e3

File tree

8 files changed

+341
-113
lines changed

8 files changed

+341
-113
lines changed

highs/ipm/hipo/auxiliary/Auxiliary.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ void processEdge(Int j, Int i, const std::vector<Int>& first,
250250
prevleaf[i] = j;
251251
}
252252

253-
double getDiagStart(Int n, Int k, Int nb, Int n_blocks, std::vector<Int>& start,
254-
bool triang) {
253+
int64_t getDiagStart(Int n, Int k, Int nb, Int n_blocks,
254+
std::vector<Int>& start, bool triang) {
255255
// start position of diagonal blocks for blocked dense formats
256256
start.assign(n_blocks, 0);
257257
for (Int i = 1; i < n_blocks; ++i) {
@@ -260,8 +260,9 @@ double getDiagStart(Int n, Int k, Int nb, Int n_blocks, std::vector<Int>& start,
260260
}
261261

262262
Int jb = std::min(nb, k - (n_blocks - 1) * nb);
263-
double result = (double)start.back() + (double)(n - (n_blocks - 1) * nb) * jb;
264-
if (triang) result -= (double)jb * (jb - 1) / 2;
263+
int64_t result =
264+
(int64_t)start.back() + (int64_t)(n - (n_blocks - 1) * nb) * jb;
265+
if (triang) result -= (int64_t)jb * (jb - 1) / 2;
265266
return result;
266267
}
267268

highs/ipm/hipo/auxiliary/Auxiliary.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ void dfsPostorder(Int node, Int& start, std::vector<Int>& head,
3535
void processEdge(Int j, Int i, const std::vector<Int>& first,
3636
std::vector<Int>& maxfirst, std::vector<Int>& delta,
3737
std::vector<Int>& prevleaf, std::vector<Int>& ancestor);
38-
double getDiagStart(Int n, Int k, Int nb, Int n_blocks, std::vector<Int>& start,
39-
bool triang = false);
38+
int64_t getDiagStart(Int n, Int k, Int nb, Int n_blocks,
39+
std::vector<Int>& start, bool triang = false);
4040
void firstDescendant(const std::vector<Int>& parent, std::vector<Int>& first);
4141

4242
template <typename T>

0 commit comments

Comments
 (0)