Skip to content

Commit

Permalink
Skip some clock reads when diagnostics are disabled (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Aug 17, 2024
1 parent 7f6501d commit 7a0b15c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/optimization/solver/InteriorPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,16 @@ void InteriorPoint(std::span<Variable> decisionVariables,
// Error estimate
double E_0 = std::numeric_limits<double>::infinity();

iterationsStartTime = std::chrono::system_clock::now();
if (config.diagnostics) {
iterationsStartTime = std::chrono::system_clock::now();
}

while (E_0 > config.tolerance &&
acceptableIterCounter < config.maxAcceptableIterations) {
auto innerIterStartTime = std::chrono::system_clock::now();
std::chrono::system_clock::time_point innerIterStartTime;
if (config.diagnostics) {
innerIterStartTime = std::chrono::system_clock::now();
}

// Check for local equality constraint infeasibility
if (IsEqualityLocallyInfeasible(A_e, c_e)) {
Expand Down

0 comments on commit 7a0b15c

Please sign in to comment.