Lines Matching defs:direction

186 bool signMatchesDirection(const DynamicAPInt &elem, Direction direction) {
188 return direction == Direction::Up ? elem > 0 : elem < 0;
191 Direction flippedDirection(Direction direction) {
192 return direction == Direction::Up ? Direction::Down : Simplex::Direction::Up;
875 /// direction. The returned pivot row will involve `row` if and only if the
876 /// unknown is unbounded in the specified direction.
887 Simplex::findPivot(int row, Direction direction) const {
895 !signMatchesDirection(elem, direction))
905 tableau(row, *col) < 0 ? flippedDirection(direction) : direction;
1009 /// Find a row that can be used to pivot the column in the specified direction.
1011 /// specified direction (ignoring skipRow, if skipRow is set).
1019 /// If the direction is up (resp. down) and a restricted row has a negative
1023 /// change in sample value (in the specified direction). (note that c is
1032 Direction direction,
1048 if (signMatchesDirection(elem, direction))
1061 (diff != 0 && !signMatchesDirection(diff, direction))) {
1190 // If no pivot row is found in either direction, then the unknown is
1345 MaybeOptimum<Fraction> Simplex::computeRowOptimum(Direction direction,
1347 // Keep trying to find a pivot for the row in the specified direction.
1348 while (std::optional<Pivot> maybePivot = findPivot(row, direction)) {
1362 /// Compute the optimum of the specified expression in the specified direction,
1364 MaybeOptimum<Fraction> Simplex::computeOptimum(Direction direction,
1372 return computeRowOptimum(direction, row);
1375 MaybeOptimum<Fraction> Simplex::computeOptimum(Direction direction,
1381 std::optional<unsigned> pivotRow = findPivotRow({}, direction, column);
1383 // direction.
1390 MaybeOptimum<Fraction> optimum = computeRowOptimum(direction, row);
1391 if (u.restricted && direction == Direction::Down &&
1400 assert(!empty && "It is not meaningful to ask whether a direction is bounded "
1681 /// the direction equalities to `dual`.
1773 /// Reduce the basis to try and find a direction in which the polytope is
1976 /// follows. Compute the minimum and maximum rational values of this direction.
1982 /// this direction in the first value in this range and "recurse" to the next
1983 /// level. If we fail to find a sample, we try assigning the direction the next
2005 // The snapshot just before constraining a direction to a value at each level.
2007 // The maximum value in the range of the direction for each level.