Lines Matching defs:sample
197 /// basis transform, and then return the sample value. If the tableau becomes
211 /// the tableau to be consistent we must have non-negative sample values not
243 /// Given a row that has a non-integer sample value, add an inequality such
244 /// that this fractional sample value is cut away from the polytope. The added
257 /// later compute the sample value from a different expression based on a
262 /// Moreover, this function is only called when the symbolic part of the sample,
296 // If the sample value is of the form (a/d)M + b/d, we need b to be
311 // Then, if the sample value is integral, we are done.
313 // Otherwise, for the variable whose row has a non-integral sample value,
319 // non-integral sample values.
329 MaybeOptimum<SmallVector<Fraction, 8>> sample = getRationalSample();
330 assert(!sample.isEmpty() && "If we reached here the sample should exist!");
331 if (sample.isUnbounded())
334 llvm::map_range(*sample, std::mem_fn(&Fraction::getAsInteger)));
349 SmallVector<DynamicAPInt, 8> sample;
350 sample.reserve(nSymbol + 1);
352 sample.emplace_back(tableau(row, col));
353 sample.emplace_back(tableau(row, 1));
354 return sample;
359 SmallVector<DynamicAPInt, 8> sample = getSymbolicSampleNumerator(row);
361 normalizeRange(sample);
362 return sample;
386 /// has a symbolic sample value with fractional coefficients.
465 // M + u has a sample value of zero so u has a sample value of -M, i.e,
473 // M + u has a sample value of fM + something, where f < 1, so
482 SmallVector<DynamicAPInt, 8> sample = getSymbolicSampleNumerator(u.pos);
483 for (DynamicAPInt &elem : sample) {
487 output.appendExtraRow(sample);
632 // Now we look for non-integral sample values and add cuts for them.
716 // of the basis transform. The sample value of the row must be non-positive.
721 // where d is the denominator, s is the sample value and the c_i are the basis
728 // pivot element that makes the lexicographically smallest change to the sample
739 // Similarly, s is the column for the sample value.
763 // If s_i == 0, then the sample value remains unchanged. Otherwise, if s_i < 0,
764 // the change in sample value when pivoting with column a is lexicographically
776 // minimizes the change in sample value.
809 // Let the sample value of the pivot row be s = pM + b before the pivot. Since
812 // If the variable is a non-pivot column, its sample value is zero before and
815 // If the variable is the pivot column, then its sample value goes from 0 to
816 // (-p/a)M + (-b/a), i.e. 0 to -(pM + b)/a. Thus the change in the sample
819 // If the variable is the pivot row, its sample value goes from s to 0, for a
822 // If the variable is a non-pivot row, its sample value changes from
823 // qM + d to qM + d + (-pc/a)M + (-bc/a). Thus the change in sample value
826 // Thus the change in sample value is either 0, -s/a, -s, or -sc/a. Here -s is
835 // of M, so long as the sample value s is negative. Note that this is not
837 // symbols too. The caller ensure that the sample value s is negative for
874 /// Find a pivot to change the sample value of the row in the specified
882 /// we cannot decrease the sample value of restricted columns.
990 /// Perform pivots until the unknown has a non-negative sample value or until
992 /// bring the row to a non-negative sample value, and failure otherwise.
1021 /// much the sample value of the column can change. Such a row with constant
1023 /// change in sample value (in the specified direction). (note that c is
1027 /// stringent bound, since pivoting with a row changes the row's sample value to
1108 /// sample value non-negative. If this is not possible, the tableau has become
1356 // The row has reached its optimal sample value, which we return.
1357 // The sample value is the entry in the constant column divided by the common
1436 // negative sample values. If it can, it's not redundant. Otherwise, it is.
1460 // Constraint is unbounded below or can attain negative sample values and
1575 SmallVector<Fraction, 8> sample;
1576 sample.reserve(var.size());
1577 // Push the sample value for each variable into the vector.
1580 // If the variable is in column position, its sample value is zero.
1581 sample.emplace_back(0, 1);
1583 // If the variable is in row position, its sample value is the
1586 sample.emplace_back(tableau(u.pos, 1), denom);
1589 return sample;
1600 SmallVector<Fraction, 8> sample;
1601 sample.reserve(var.size());
1602 // Push the sample value for each variable into the vector.
1605 // as M + x, so its sample value is finite if and only if it is of the
1606 // form 1*M + c. If the coefficient of M is not one then the sample value
1610 // If the variable is in column position, the sample value of M + x is
1615 // If the variable is in row position, its sample value is the
1621 sample.emplace_back(tableau(u.pos, 1), denom);
1623 return sample;
1628 // If the tableau is empty, no sample point exists.
1637 // If the sample is non-integral, return std::nullopt.
1969 /// Search for an integer sample point using a branch and bound algorithm.
1983 /// level. If we fail to find a sample, we try assigning the direction the next
1986 /// If no integer sample is found from any of the assignments, or if the range
1992 /// already, then we simply return the current sample point if it is integral,
2017 // We've assigned values to all variables. Return if we have a sample,
2052 // Heuristic: if the sample point is integral at this point, just return