Lines Matching defs:col
82 const Simplex::Unknown &SimplexBase::unknownFromColumn(unsigned col) const {
83 assert(col < getNumColumns() && "Invalid column");
84 return unknownFromIndex(colUnknown[col]);
97 Simplex::Unknown &SimplexBase::unknownFromColumn(unsigned col) {
98 assert(col < getNumColumns() && "Invalid column");
99 return unknownFromIndex(colUnknown[col]);
160 // If a variable is in column position at column col, then we just add the
175 for (unsigned col = 1, e = getNumColumns(); col < e; ++col)
176 tableau(newRow, col) =
177 nRowCoeff * tableau(newRow, col) + idxRowCoeff * tableau(pos, col);
287 for (unsigned col = 3 + nSymbol, e = getNumColumns(); col < e; ++col)
288 tableau(cutRow, col) = mod(tableau(row, col), d); // b_i%d.
351 for (unsigned col = 3; col < 3 + nSymbol; ++col)
352 sample.emplace_back(tableau(row, col));
431 for (unsigned col = 3; col < 3 + nSymbol; ++col)
432 divCoeffs.emplace_back(mod(-tableau(row, col), divDenom)); // (-a_i%d)s_i
448 for (unsigned col = 3; col < 3 + nSymbol - 1; ++col)
449 tableau(cutRow, col) = -mod(-tableau(row, col), d); // -(-a_i%d)s_i.
452 for (unsigned col = 3 + nSymbol, e = getNumColumns(); col < e; ++col)
453 tableau(cutRow, col) = mod(tableau(row, col), d); // (b_i%d)y_i.
750 // pivot col other col pivot col other col
759 // B'.col(j) = B.col(j) / B(i,j)
760 // B'.col(k) = B.col(k) - B(i,k) * B.col(j) / B(i,j) for k != j
761 // and similarly, s' = s - s_i * B.col(j) / B(i,j).
765 // smaller than that when pivoting with column b iff B.col(a) / B(i, a) is
766 // lexicographically smaller than B.col(b) / B(i, b).
770 // For the other columns, suppose C.col(k) is not lexicopositive.
774 // which is in contradiction to the fact that B.col(j) / B(i,j) must be
775 // lexicographically smaller than B.col(k) / B(i,k), since it lexicographically
779 for (unsigned col = 3 + nSymbol, e = getNumColumns(); col < e; ++col) {
780 if (tableau(row, col) <= 0)
783 !maybeColumn ? col : getLexMinPivotColumn(row, *maybeColumn, col);
799 // pivot col big M col const col
805 // pivot col big M col const col
839 auto getSampleChangeCoeffForVar = [this, row](unsigned col,
841 DynamicAPInt a = tableau(row, col);
844 if (u.pos == col)
856 DynamicAPInt c = tableau(u.pos, col);
888 std::optional<unsigned> col;
897 if (!col || colUnknown[j] < colUnknown[*col])
898 col = j;
901 if (!col)
905 tableau(row, *col) < 0 ? flippedDirection(direction) : direction;
906 std::optional<unsigned> maybePivotRow = findPivotRow(row, newDirection, *col);
907 return Pivot{maybePivotRow.value_or(row), *col};
914 void SimplexBase::swapRowWithCol(unsigned row, unsigned col) {
915 std::swap(rowUnknown[row], colUnknown[col]);
916 Unknown &uCol = unknownFromColumn(col);
920 uCol.pos = col;
928 /// Let R be the pivot row unknown and let C be the pivot col unknown.
938 /// pivot col other col pivot col other col
944 /// pivot col other col pivot col other col
964 for (unsigned col = 1, e = getNumColumns(); col < e; ++col) {
965 if (col == pivotCol)
967 tableau(pivotRow, col) = -tableau(pivotRow, col);
978 for (unsigned col = 1, numCols = getNumColumns(); col < numCols; ++col) {
979 if (col == pivotCol)
982 tableau(row, col) = tableau(row, col) * tableau(pivotRow, 0) +
983 tableau(row, pivotCol) * tableau(pivotRow, col);
1033 unsigned col) const {
1043 DynamicAPInt elem = tableau(row, col);
1175 std::optional<unsigned> SimplexBase::findAnyPivotRow(unsigned col) {
1177 if (tableau(row, col) != 0)
1270 for (unsigned col = getNumFixedCols(), e = getNumColumns(); col < e;
1271 col++) {
1272 assert(colUnknown[col] != nullIndex &&
1274 if (llvm::is_contained(basis, colUnknown[col]))
1276 if (tableau(u.pos, col) == 0)
1278 pivot(u.pos, col);
1536 for (unsigned col = 0, e = a.getNumColumns(); col < e; ++col)
1537 result.tableau(resultRow, col) = a.tableau(row, col);
1551 for (unsigned col = 2, e = b.getNumColumns(); col < e; ++col)
1552 result.tableau(resultRow, offset + col) = b.tableau(row, col);
2153 for (unsigned col = 2, e = getNumColumns(); col < e; ++col)
2154 os << ", c" << col << ": " << colUnknown[col];
2158 for (unsigned col = 0, numCols = getNumColumns(); col < numCols; ++col)
2159 updatePrintMetrics<DynamicAPInt>(tableau(row, col), ptm);
2162 for (unsigned col = 0, numCols = getNumColumns(); col < numCols; ++col) {
2163 printWithPrintMetrics<DynamicAPInt>(os, tableau(row, col), MIN_SPACING,