20#include "absl/memory/memory.h"
21#include "absl/strings/match.h"
22#include "absl/strings/str_format.h"
34#ifndef __PORTABLE_PLATFORM__
39 "Tells whether do dump the problem to a protobuf file.");
41 "Whether the proto dump file is compressed.");
43 "Whether the proto dump file is binary.");
45 "Number for the dump file, in the form name-000048.pb. "
46 "If < 0, the file is automatically numbered from the number of "
47 "calls to LPSolver::Solve().");
49 "Directory where dump files are written.");
51 "Base name for dump files. LinearProgram::name_ is used if "
52 "lp_dump_file_basename is empty. If LinearProgram::name_ is "
53 "empty, \"linear_program_dump_file\" is used.");
55 "Override any user parameters with the value of this flag. This is "
56 "interpreted as a GlopParameters proto in text format.");
69void DumpLinearProgramIfRequiredByFlags(
const LinearProgram& linear_program,
71 if (!absl::GetFlag(FLAGS_lp_dump_to_proto_file))
return;
72#ifdef __PORTABLE_PLATFORM__
73 LOG(
WARNING) <<
"DumpLinearProgramIfRequiredByFlags(linear_program, num) "
74 "requested for linear_program.name()='"
75 << linear_program.name() <<
"', num=" << num
76 <<
" but is not implemented for this platform.";
78 std::string filename = absl::GetFlag(FLAGS_lp_dump_file_basename);
79 if (filename.empty()) {
80 if (linear_program.name().empty()) {
81 filename =
"linear_program_dump";
83 filename = linear_program.name();
86 const int file_num = absl::GetFlag(FLAGS_lp_dump_file_number) >= 0
87 ? absl::GetFlag(FLAGS_lp_dump_file_number)
89 absl::StrAppendFormat(&filename,
"-%06d.pb", file_num);
90 const std::string filespec =
91 absl::StrCat(absl::GetFlag(FLAGS_lp_dump_dir),
"/", filename);
94 const ProtoWriteFormat write_format = absl::GetFlag(FLAGS_lp_dump_binary_file)
98 absl::GetFlag(FLAGS_lp_dump_compressed_file))) {
99 LOG(DFATAL) <<
"Could not write " << filespec;
114#ifndef __PORTABLE_PLATFORM__
115 if (!absl::GetFlag(FLAGS_glop_params).empty()) {
116 GlopParameters flag_params;
117 CHECK(google::protobuf::TextFormat::ParseFromString(
118 absl::GetFlag(FLAGS_glop_params), &flag_params));
119 parameters_.MergeFrom(flag_params);
139 LOG(DFATAL) <<
"SolveWithTimeLimit() called with a nullptr time_limit.";
143 num_revised_simplex_iterations_ = 0;
144 DumpLinearProgramIfRequiredByFlags(lp, num_solves_);
148 <<
"\n******************************************************************"
149 "\n* WARNING: Glop will be very slow because it will use DCHECKs *"
150 "\n* to verify the results and the precision of the solver. *"
151 "\n* You can gain at least an order of magnitude speedup by *"
152 "\n* compiling with optimizations enabled and by defining NDEBUG. *"
153 "\n******************************************************************";
158 if (!parameters_.log_search_progress() &&
VLOG_IS_ON(1)) {
173 LOG(DFATAL) <<
"The columns of the given linear program should be ordered "
174 <<
"by row and contain no zero coefficients. Call CleanUp() "
175 <<
"on it before calling Solve().";
183 if (!lp.
IsValid(parameters_.max_valid_magnitude())) {
185 "The given linear program is invalid. It contains NaNs, "
186 "coefficients too large or invalid bounds specification.");
199 const bool postsolve_is_needed =
preprocessor.Run(¤t_linear_program_);
221 RunRevisedSimplexIfNeeded(&solution,
time_limit);
223 if (postsolve_is_needed)
preprocessor.DestructiveRecoverSolution(&solution);
240 ResizeSolution(RowIndex(0), ColIndex(0));
241 revised_simplex_.reset(
nullptr);
271 if (revised_simplex_ ==
nullptr) {
272 revised_simplex_ = absl::make_unique<RevisedSimplex>();
273 revised_simplex_->SetLogger(&logger_);
275 revised_simplex_->LoadStateForNextSolve(state);
276 if (parameters_.use_preprocessing()) {
277 LOG(
WARNING) <<
"In GLOP, SetInitialBasis() was called but the parameter "
278 "use_preprocessing is true, this will likely not result in "
302 SOLVER_LOG(&logger_,
"Final unscaled solution:");
304 if (!IsProblemSolutionConsistent(lp, solution)) {
305 SOLVER_LOG(&logger_,
"Inconsistency detected in the solution.");
320 ComputeReducedCosts(lp);
321 const Fractional primal_objective_value = ComputeObjective(lp);
322 const Fractional dual_objective_value = ComputeDualObjective(lp);
323 SOLVER_LOG(&logger_,
"Primal objective (before moving primal/dual values) = ",
325 "%.15E", ProblemObjectiveValue(lp, primal_objective_value)));
326 SOLVER_LOG(&logger_,
"Dual objective (before moving primal/dual values) = ",
327 absl::StrFormat(
"%.15E",
328 ProblemObjectiveValue(lp, dual_objective_value)));
332 parameters_.provide_strong_optimal_guarantee()) {
333 MovePrimalValuesWithinBounds(lp);
334 MoveDualValuesWithinBounds(lp);
338 problem_objective_value_ = ProblemObjectiveValue(lp, ComputeObjective(lp));
339 SOLVER_LOG(&logger_,
"Primal objective (after moving primal/dual values) = ",
340 absl::StrFormat(
"%.15E", problem_objective_value_));
342 ComputeReducedCosts(lp);
343 ComputeConstraintActivities(lp);
353 bool rhs_perturbation_is_too_large =
false;
354 bool cost_perturbation_is_too_large =
false;
355 bool primal_infeasibility_is_too_large =
false;
356 bool dual_infeasibility_is_too_large =
false;
357 bool primal_residual_is_too_large =
false;
358 bool dual_residual_is_too_large =
false;
361 ComputeMaxRhsPerturbationToEnforceOptimality(lp,
362 &rhs_perturbation_is_too_large);
363 ComputeMaxCostPerturbationToEnforceOptimality(
364 lp, &cost_perturbation_is_too_large);
365 const double primal_infeasibility =
366 ComputePrimalValueInfeasibility(lp, &primal_infeasibility_is_too_large);
367 const double dual_infeasibility =
368 ComputeDualValueInfeasibility(lp, &dual_infeasibility_is_too_large);
369 const double primal_residual =
370 ComputeActivityInfeasibility(lp, &primal_residual_is_too_large);
371 const double dual_residual =
372 ComputeReducedCostInfeasibility(lp, &dual_residual_is_too_large);
377 max_absolute_primal_infeasibility_ =
378 std::max(primal_infeasibility, primal_residual);
379 max_absolute_dual_infeasibility_ =
380 std::max(dual_infeasibility, dual_residual);
381 SOLVER_LOG(&logger_,
"Max. primal infeasibility = ",
382 max_absolute_primal_infeasibility_);
384 "Max. dual infeasibility = ", max_absolute_dual_infeasibility_);
389 const double objective_error_ub = ComputeMaxExpectedObjectiveError(lp);
390 SOLVER_LOG(&logger_,
"Objective error <= ", objective_error_ub);
393 parameters_.provide_strong_optimal_guarantee()) {
396 if (primal_infeasibility != 0.0 || dual_infeasibility != 0.0) {
397 LOG(
ERROR) <<
"Primal/dual values have been moved to their bounds. "
398 <<
"Therefore the primal/dual infeasibilities should be "
399 <<
"exactly zero (but not the residuals). If this message "
400 <<
"appears, there is probably a bug in "
401 <<
"MovePrimalValuesWithinBounds() or in "
402 <<
"MoveDualValuesWithinBounds().";
404 if (rhs_perturbation_is_too_large) {
405 SOLVER_LOG(&logger_,
"The needed rhs perturbation is too large !!");
406 if (parameters_.change_status_to_imprecise()) {
410 if (cost_perturbation_is_too_large) {
411 SOLVER_LOG(&logger_,
"The needed cost perturbation is too large !!");
412 if (parameters_.change_status_to_imprecise()) {
422 if (std::abs(primal_objective_value - dual_objective_value) >
423 objective_error_ub) {
425 "The objective gap of the final solution is too large.");
426 if (parameters_.change_status_to_imprecise()) {
433 (primal_residual_is_too_large || primal_infeasibility_is_too_large)) {
435 "The primal infeasibility of the final solution is too large.");
436 if (parameters_.change_status_to_imprecise()) {
442 (dual_residual_is_too_large || dual_infeasibility_is_too_large)) {
444 "The dual infeasibility of the final solution is too large.");
445 if (parameters_.change_status_to_imprecise()) {
450 may_have_multiple_solutions_ =
455bool LPSolver::IsOptimalSolutionOnFacet(
const LinearProgram& lp) {
460 const double kReducedCostTolerance = 1e-9;
461 const double kBoundTolerance = 1e-7;
463 for (ColIndex
col(0);
col < num_cols; ++
col) {
469 kReducedCostTolerance) &&
476 for (RowIndex
row(0);
row < num_rows; ++
row) {
482 kReducedCostTolerance) &&
492 return problem_objective_value_;
496 return max_absolute_primal_infeasibility_;
500 return max_absolute_dual_infeasibility_;
504 return may_have_multiple_solutions_;
508 return num_revised_simplex_iterations_;
512 return revised_simplex_ ==
nullptr ? 0.0
513 : revised_simplex_->DeterministicTime();
516void LPSolver::MovePrimalValuesWithinBounds(
const LinearProgram& lp) {
520 for (ColIndex
col(0);
col < num_cols; ++
col) {
530 SOLVER_LOG(&logger_,
"Max. primal values move = ", error);
533void LPSolver::MoveDualValuesWithinBounds(
const LinearProgram& lp) {
534 const RowIndex num_rows = lp.num_constraints();
536 const Fractional optimization_sign = lp.IsMaximizationProblem() ? -1.0 : 1.0;
538 for (RowIndex
row(0);
row < num_rows; ++
row) {
543 Fractional minimization_dual_value = optimization_sign * dual_values_[
row];
545 error =
std::max(error, minimization_dual_value);
546 minimization_dual_value = 0.0;
549 error =
std::max(error, -minimization_dual_value);
550 minimization_dual_value = 0.0;
552 dual_values_[
row] = optimization_sign * minimization_dual_value;
554 SOLVER_LOG(&logger_,
"Max. dual values move = ", error);
557void LPSolver::ResizeSolution(RowIndex num_rows, ColIndex num_cols) {
558 primal_values_.
resize(num_cols, 0.0);
559 reduced_costs_.
resize(num_cols, 0.0);
562 dual_values_.resize(num_rows, 0.0);
563 constraint_activities_.
resize(num_rows, 0.0);
567void LPSolver::RunRevisedSimplexIfNeeded(ProblemSolution* solution,
578 if (revised_simplex_ ==
nullptr) {
579 revised_simplex_ = absl::make_unique<RevisedSimplex>();
580 revised_simplex_->SetLogger(&logger_);
582 revised_simplex_->SetParameters(parameters_);
583 if (revised_simplex_->Solve(current_linear_program_,
time_limit).ok()) {
584 num_revised_simplex_iterations_ = revised_simplex_->GetNumberOfIterations();
585 solution->status = revised_simplex_->GetProblemStatus();
588 const ColIndex num_cols = solution->primal_values.size();
589 DCHECK_LE(num_cols, revised_simplex_->GetProblemNumCols());
590 for (ColIndex
col(0);
col < num_cols; ++
col) {
591 solution->primal_values[
col] = revised_simplex_->GetVariableValue(
col);
592 solution->variable_statuses[
col] =
593 revised_simplex_->GetVariableStatus(
col);
595 const RowIndex num_rows = revised_simplex_->GetProblemNumRows();
596 DCHECK_EQ(solution->dual_values.size(), num_rows);
597 for (RowIndex
row(0);
row < num_rows; ++
row) {
598 solution->dual_values[
row] = revised_simplex_->GetDualValue(
row);
599 solution->constraint_statuses[
row] =
600 revised_simplex_->GetConstraintStatus(
row);
602 if (!parameters_.use_preprocessing() && !parameters_.use_scaling()) {
604 primal_ray_ = revised_simplex_->GetPrimalRay();
606 primal_ray_.
resize(num_cols);
608 constraints_dual_ray_ = revised_simplex_->GetDualRay();
609 variable_bounds_dual_ray_ =
610 revised_simplex_->GetDualRayRowCombination();
612 variable_bounds_dual_ray_.
resize(num_cols);
631 SOLVER_LOG(&logger_,
"Error during the revised simplex algorithm.");
641 VLOG(1) <<
"Variable " <<
col <<
" status is "
643 <<
" and its bounds are [" << lb <<
", " << ub <<
"].";
648 VLOG(1) <<
"Constraint " <<
row <<
" status is "
650 <<
", " << ub <<
"].";
655bool LPSolver::IsProblemSolutionConsistent(
656 const LinearProgram& lp,
const ProblemSolution& solution)
const {
657 const RowIndex num_rows = lp.num_constraints();
658 const ColIndex num_cols = lp.num_variables();
659 if (solution.variable_statuses.size() != num_cols)
return false;
660 if (solution.constraint_statuses.size() != num_rows)
return false;
661 if (solution.primal_values.size() != num_cols)
return false;
662 if (solution.dual_values.size() != num_rows)
return false;
671 RowIndex num_basic_variables(0);
672 for (ColIndex
col(0);
col < num_cols; ++
col) {
677 switch (solution.variable_statuses[
col]) {
681 ++num_basic_variables;
699 if (
value != lb || lb == ub) {
720 for (RowIndex
row(0);
row < num_rows; ++
row) {
731 if (dual_value != 0.0) {
732 VLOG(1) <<
"Constraint " <<
row <<
" is BASIC, but its dual value is "
733 << dual_value <<
" instead of 0.";
736 ++num_basic_variables;
742 if (ub - lb > 1e-12) {
743 LogConstraintStatusError(
row,
status, lb, ub);
749 LogConstraintStatusError(
row,
status, lb, ub);
755 LogConstraintStatusError(
row,
status, lb, ub);
760 if (dual_value != 0.0) {
761 VLOG(1) <<
"Constraint " <<
row <<
" is FREE, but its dual value is "
762 << dual_value <<
" instead of 0.";
766 LogConstraintStatusError(
row,
status, lb, ub);
775 if (num_basic_variables != num_rows) {
776 VLOG(1) <<
"Wrong number of basic variables: " << num_basic_variables;
786Fractional LPSolver::ComputeMaxCostPerturbationToEnforceOptimality(
787 const LinearProgram& lp,
bool* is_too_large) {
789 const ColIndex num_cols = lp.num_variables();
790 const Fractional optimization_sign = lp.IsMaximizationProblem() ? -1.0 : 1.0;
791 const Fractional tolerance = parameters_.solution_feasibility_tolerance();
792 for (ColIndex
col(0);
col < num_cols; ++
col) {
796 const Fractional reduced_cost = optimization_sign * reduced_costs_[
col];
801 max_cost_correction =
802 std::max(max_cost_correction, std::abs(reduced_cost));
804 std::abs(reduced_cost) >
805 AllowedError(tolerance, lp.objective_coefficients()[
col]);
808 SOLVER_LOG(&logger_,
"Max. cost perturbation = ", max_cost_correction);
809 return max_cost_correction;
814Fractional LPSolver::ComputeMaxRhsPerturbationToEnforceOptimality(
815 const LinearProgram& lp,
bool* is_too_large) {
817 const RowIndex num_rows = lp.num_constraints();
818 const Fractional tolerance = parameters_.solution_feasibility_tolerance();
819 for (RowIndex
row(0);
row < num_rows; ++
row) {
829 allowed_error = AllowedError(tolerance,
lower_bound);
833 allowed_error = AllowedError(tolerance,
upper_bound);
835 max_rhs_correction =
std::max(max_rhs_correction, rhs_error);
836 *is_too_large |= rhs_error > allowed_error;
838 SOLVER_LOG(&logger_,
"Max. rhs perturbation = ", max_rhs_correction);
839 return max_rhs_correction;
842void LPSolver::ComputeConstraintActivities(
const LinearProgram& lp) {
843 const RowIndex num_rows = lp.num_constraints();
844 const ColIndex num_cols = lp.num_variables();
846 constraint_activities_.
assign(num_rows, 0.0);
847 for (ColIndex
col(0);
col < num_cols; ++
col) {
848 lp.GetSparseColumn(
col).AddMultipleToDenseVector(primal_values_[
col],
849 &constraint_activities_);
853void LPSolver::ComputeReducedCosts(
const LinearProgram& lp) {
854 const RowIndex num_rows = lp.num_constraints();
855 const ColIndex num_cols = lp.num_variables();
856 DCHECK_EQ(num_rows, dual_values_.size());
857 reduced_costs_.resize(num_cols, 0.0);
858 for (ColIndex
col(0);
col < num_cols; ++
col) {
859 reduced_costs_[
col] = lp.objective_coefficients()[
col] -
864double LPSolver::ComputeObjective(
const LinearProgram& lp) {
865 const ColIndex num_cols = lp.num_variables();
868 for (ColIndex
col(0);
col < num_cols; ++
col) {
869 sum.
Add(lp.objective_coefficients()[
col] * primal_values_[
col]);
890double LPSolver::ComputeDualObjective(
const LinearProgram& lp) {
894 const RowIndex num_rows = lp.num_constraints();
895 const Fractional optimization_sign = lp.IsMaximizationProblem() ? -1.0 : 1.0;
896 for (RowIndex
row(0);
row < num_rows; ++
row) {
901 const Fractional corrected_value = optimization_sign * dual_values_[
row];
926 const ColIndex num_cols = lp.num_variables();
927 for (ColIndex
col(0);
col < num_cols; ++
col) {
933 const Fractional reduced_cost = optimization_sign * reduced_costs_[
col];
939 reduced_cost > 0.0) {
942 reduced_cost < 0.0) {
948 dual_objective.Add(optimization_sign * correction);
950 return dual_objective.Value();
953double LPSolver::ComputeMaxExpectedObjectiveError(
const LinearProgram& lp) {
954 const ColIndex num_cols = lp.num_variables();
956 const Fractional tolerance = parameters_.solution_feasibility_tolerance();
958 for (ColIndex
col(0);
col < num_cols; ++
col) {
962 primal_objective_error += std::abs(lp.objective_coefficients()[
col]) *
963 AllowedError(tolerance, primal_values_[
col]);
965 return primal_objective_error;
968double LPSolver::ComputePrimalValueInfeasibility(
const LinearProgram& lp,
969 bool* is_too_large) {
970 double infeasibility = 0.0;
971 const Fractional tolerance = parameters_.solution_feasibility_tolerance();
972 const ColIndex num_cols = lp.num_variables();
973 for (ColIndex
col(0);
col < num_cols; ++
col) {
980 infeasibility =
std::max(infeasibility, error);
981 *is_too_large |= error > AllowedError(tolerance,
upper_bound);
986 infeasibility =
std::max(infeasibility, error);
987 *is_too_large |= error > AllowedError(tolerance,
upper_bound);
991 infeasibility =
std::max(infeasibility, error);
992 *is_too_large |= error > AllowedError(tolerance,
lower_bound);
995 return infeasibility;
998double LPSolver::ComputeActivityInfeasibility(
const LinearProgram& lp,
999 bool* is_too_large) {
1000 double infeasibility = 0.0;
1001 int num_problematic_rows(0);
1002 const RowIndex num_rows = lp.num_constraints();
1003 const Fractional tolerance = parameters_.solution_feasibility_tolerance();
1004 for (RowIndex
row(0);
row < num_rows; ++
row) {
1013 VLOG(2) <<
"Row " <<
row.value() <<
" has activity " << activity
1014 <<
" which is different from " <<
upper_bound <<
" by "
1016 ++num_problematic_rows;
1023 if (row_excess > AllowedError(tolerance,
upper_bound)) {
1024 VLOG(2) <<
"Row " <<
row.value() <<
" has activity " << activity
1025 <<
", exceeding its upper bound " <<
upper_bound <<
" by "
1027 ++num_problematic_rows;
1029 infeasibility =
std::max(infeasibility, row_excess);
1033 if (row_deficit > AllowedError(tolerance,
lower_bound)) {
1034 VLOG(2) <<
"Row " <<
row.value() <<
" has activity " << activity
1035 <<
", below its lower bound " <<
lower_bound <<
" by "
1037 ++num_problematic_rows;
1039 infeasibility =
std::max(infeasibility, row_deficit);
1042 if (num_problematic_rows > 0) {
1043 *is_too_large =
true;
1044 VLOG(1) <<
"Number of infeasible rows = " << num_problematic_rows;
1046 return infeasibility;
1049double LPSolver::ComputeDualValueInfeasibility(
const LinearProgram& lp,
1050 bool* is_too_large) {
1051 const Fractional allowed_error = parameters_.solution_feasibility_tolerance();
1052 const Fractional optimization_sign = lp.IsMaximizationProblem() ? -1.0 : 1.0;
1053 double infeasibility = 0.0;
1054 const RowIndex num_rows = lp.num_constraints();
1055 for (RowIndex
row(0);
row < num_rows; ++
row) {
1060 const Fractional minimization_dual_value = optimization_sign * dual_value;
1062 *is_too_large |= minimization_dual_value > allowed_error;
1063 infeasibility =
std::max(infeasibility, minimization_dual_value);
1066 *is_too_large |= -minimization_dual_value > allowed_error;
1067 infeasibility =
std::max(infeasibility, -minimization_dual_value);
1070 return infeasibility;
1073double LPSolver::ComputeReducedCostInfeasibility(
const LinearProgram& lp,
1074 bool* is_too_large) {
1075 const Fractional optimization_sign = lp.IsMaximizationProblem() ? -1.0 : 1.0;
1076 double infeasibility = 0.0;
1077 const ColIndex num_cols = lp.num_variables();
1078 const Fractional tolerance = parameters_.solution_feasibility_tolerance();
1079 for (ColIndex
col(0);
col < num_cols; ++
col) {
1085 optimization_sign * reduced_cost;
1087 AllowedError(tolerance, lp.objective_coefficients()[
col]);
1089 *is_too_large |= minimization_reduced_cost > allowed_error;
1090 infeasibility =
std::max(infeasibility, minimization_reduced_cost);
1093 *is_too_large |= -minimization_reduced_cost > allowed_error;
1094 infeasibility =
std::max(infeasibility, -minimization_reduced_cost);
1097 return infeasibility;
#define DCHECK_LE(val1, val2)
#define DCHECK(condition)
#define DCHECK_EQ(val1, val2)
#define VLOG(verboselevel)
void push_back(const value_type &x)
void Add(const FpNumber &value)
void SetLogToStdOut(bool enable)
bool LoggingIsEnabled() const
void EnableLogging(bool enable)
A simple class to enforce both an elapsed time limit and a deterministic time limit in the same threa...
static std::unique_ptr< TimeLimit > FromParameters(const Parameters ¶meters)
Creates a time limit object initialized from an object that provides methods max_time_in_seconds() an...
const GlopParameters & GetParameters() const
SolverLogger & GetSolverLogger()
void SetInitialBasis(const VariableStatusRow &variable_statuses, const ConstraintStatusColumn &constraint_statuses)
bool MayHaveMultipleOptimalSolutions() const
const VariableStatusRow & variable_statuses() const
GlopParameters * GetMutableParameters()
Fractional GetMaximumDualInfeasibility() const
const ConstraintStatusColumn & constraint_statuses() const
Fractional GetMaximumPrimalInfeasibility() const
Fractional GetObjectiveValue() const
ProblemStatus LoadAndVerifySolution(const LinearProgram &lp, const ProblemSolution &solution)
ABSL_MUST_USE_RESULT ProblemStatus Solve(const LinearProgram &lp)
ABSL_MUST_USE_RESULT ProblemStatus SolveWithTimeLimit(const LinearProgram &lp, TimeLimit *time_limit)
void SetParameters(const GlopParameters ¶meters)
double DeterministicTime() const
int GetNumberOfSimplexIterations() const
std::string GetObjectiveStatsString() const
void PopulateFromLinearProgram(const LinearProgram &linear_program)
void ClearTransposeMatrix()
std::string GetBoundsStatsString() const
bool IsValid(Fractional max_valid_magnitude=kInfinity) const
const DenseColumn & constraint_lower_bounds() const
const DenseRow & variable_upper_bounds() const
Fractional objective_offset() const
const DenseColumn & constraint_upper_bounds() const
bool IsMaximizationProblem() const
ColIndex num_variables() const
const DenseRow & variable_lower_bounds() const
std::string GetDimensionString() const
Fractional objective_scaling_factor() const
RowIndex num_constraints() const
void resize(IntType size)
void assign(IntType size, const T &v)
ModelSharedTimeLimit * time_limit
ABSL_FLAG(bool, lp_dump_to_proto_file, false, "Tells whether do dump the problem to a protobuf file.")
AccurateSum< Fractional > KahanSum
Fractional ScalarProduct(const DenseRowOrColumn1 &u, const DenseRowOrColumn2 &v)
std::string GetProblemStatusString(ProblemStatus problem_status)
std::string GetConstraintStatusString(ConstraintStatus status)
void LinearProgramToMPModelProto(const LinearProgram &input, MPModelProto *output)
bool IsFinite(Fractional value)
void ChangeSign(StrictITIVector< IndexType, Fractional > *data)
std::string GetVariableStatusString(VariableStatus status)
Collection of objects used to extend the Constraint Solver library.
bool WriteProtoToFile(absl::string_view filename, const google::protobuf::Message &proto, ProtoWriteFormat proto_write_format, bool gzipped, bool append_extension_to_file_name)
bool AreWithinAbsoluteTolerance(FloatType x, FloatType y, FloatType absolute_tolerance)
glop::MainLpPreprocessor preprocessor
VariableStatusRow statuses
VariableStatusRow variable_statuses
ConstraintStatusColumn constraint_statuses
#define SOLVER_LOG(logger,...)
#define VLOG_IS_ON(verboselevel)