Skip to content

Commit c1658a5

Browse files
committed
Remove printf
1 parent 751abcb commit c1658a5

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

highs/ipm/hipo/factorhighs/CliqueStack.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ CliqueStack::CliqueStack(Int stack_size) {
1212
worksize_ = 0;
1313
}
1414

15-
double* CliqueStack::setup(Int clique_size) {
15+
double* CliqueStack::setup(Int clique_size, bool& reallocation) {
1616
// Clear workspace
1717

1818
assert(!workspace_ && !worksize_);
19+
reallocation = false;
1920

2021
// This should not trigger reallocation, because the reserve in init is done
2122
// with the maximum possible size of a clique.
2223
if (top_ + clique_size > stack_.size()) {
23-
printf("=== Warning, reallocation of workspace\n");
24+
reallocation = true;
2425
stack_.resize(top_ + clique_size, 0.0);
2526
}
2627

highs/ipm/hipo/factorhighs/CliqueStack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class CliqueStack {
4040

4141
public:
4242
CliqueStack(Int size);
43-
double* setup(Int clique_size);
43+
double* setup(Int clique_size, bool& reallocation);
4444
const double* getChild(Int& child_sn) const;
4545
void popChild();
4646
void pushWork(Int sn);

highs/ipm/hipo/factorhighs/Factorise.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,11 @@ void Factorise::processSupernode(Int sn, CliqueStack* cliquestack,
244244
const Int sn_size = sn_end - sn_begin;
245245

246246
double* clique_ptr = nullptr;
247-
if (cliquestack) clique_ptr = cliquestack->setup(S_.cliqueSize(sn));
247+
if (cliquestack) {
248+
bool reallocation = false;
249+
clique_ptr = cliquestack->setup(S_.cliqueSize(sn), reallocation);
250+
if (reallocation && log_) log_->printw("Reallocation of CliqueStack\n");
251+
}
248252

249253
// initialise the format handler
250254
// this also allocates space for the frontal matrix and schur complement

0 commit comments

Comments
 (0)