From 0592b6d86aad189dc99298227a1562773cb6d41f Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 1 Apr 2022 13:14:40 +0200 Subject: [PATCH] Small opt in pivot. --- libsolutil/LP.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libsolutil/LP.cpp b/libsolutil/LP.cpp index 36deb7bc9..fceac6fac 100644 --- a/libsolutil/LP.cpp +++ b/libsolutil/LP.cpp @@ -203,6 +203,8 @@ void performPivot(Tableau& _tableau, size_t _pivotRow, size_t _pivotColumn) auto subtractMultipleOfPivotRow = [&](LinearExpression& _row) { if (_row[_pivotColumn] == rational{1}) _row -= _pivotRowData; + else if (_row[_pivotColumn] == rational{-1}) + _row += _pivotRowData; else if (_row[_pivotColumn]) _row -= _row[_pivotColumn] * _pivotRowData; };