Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
lp_utils.cc File Reference
#include "ortools/sat/lp_utils.h"
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <limits>
#include <string>
#include <utility>
#include <vector>
#include "absl/log/check.h"
#include "absl/strings/str_cat.h"
#include "absl/types/span.h"
#include "ortools/base/logging.h"
#include "ortools/base/strong_vector.h"
#include "ortools/glop/lp_solver.h"
#include "ortools/glop/parameters.pb.h"
#include "ortools/linear_solver/linear_solver.pb.h"
#include "ortools/lp_data/lp_data.h"
#include "ortools/lp_data/lp_types.h"
#include "ortools/port/proto_utils.h"
#include "ortools/sat/boolean_problem.h"
#include "ortools/sat/boolean_problem.pb.h"
#include "ortools/sat/cp_model.pb.h"
#include "ortools/sat/cp_model_utils.h"
#include "ortools/sat/integer.h"
#include "ortools/sat/sat_parameters.pb.h"
#include "ortools/util/fp_utils.h"
#include "ortools/util/logging.h"
#include "ortools/util/saturated_arithmetic.h"
#include "ortools/util/strong_integers.h"

Go to the source code of this file.

Namespaces

namespace  operations_research
 In SWIG mode, we don't want anything besides these top-level includes.
 
namespace  operations_research::sat
 

Functions

std::vector< double > operations_research::sat::ScaleContinuousVariables (double scaling, double max_bound, MPModelProto *mp_model)
 
int64_t operations_research::sat::FindRationalFactor (double x, int64_t limit, double tolerance)
 
bool operations_research::sat::MakeBoundsOfIntegerVariablesInteger (const SatParameters &params, MPModelProto *mp_model, SolverLogger *logger)
 
void operations_research::sat::ChangeLargeBoundsToInfinity (double max_magnitude, MPModelProto *mp_model, SolverLogger *logger)
 
void operations_research::sat::RemoveNearZeroTerms (const SatParameters &params, MPModelProto *mp_model, SolverLogger *logger)
 
bool operations_research::sat::MPModelProtoValidationBeforeConversion (const SatParameters &params, const MPModelProto &mp_model, SolverLogger *logger)
 
std::vector< double > operations_research::sat::DetectImpliedIntegers (MPModelProto *mp_model, SolverLogger *logger)
 
double operations_research::sat::FindBestScalingAndComputeErrors (const std::vector< double > &coefficients, absl::Span< const double > lower_bounds, absl::Span< const double > upper_bounds, int64_t max_absolute_activity, double wanted_absolute_activity_precision, double *relative_coeff_error, double *scaled_sum_error)
 
bool operations_research::sat::ConvertMPModelProtoToCpModelProto (const SatParameters &params, const MPModelProto &mp_model, CpModelProto *cp_model, SolverLogger *logger)
 
bool operations_research::sat::ConvertCpModelProtoToMPModelProto (const CpModelProto &input, MPModelProto *output)
 
bool operations_research::sat::ScaleAndSetObjective (const SatParameters &params, const std::vector< std::pair< int, double > > &objective, double objective_offset, bool maximize, CpModelProto *cp_model, SolverLogger *logger)
 
bool operations_research::sat::ConvertBinaryMPModelProtoToBooleanProblem (const MPModelProto &mp_model, LinearBooleanProblem *problem)
 
void operations_research::sat::ConvertBooleanProblemToLinearProgram (const LinearBooleanProblem &problem, glop::LinearProgram *lp)
 Converts a Boolean optimization problem to its lp formulation.
 
double operations_research::sat::ComputeTrueObjectiveLowerBound (const CpModelProto &model_proto_with_floating_point_objective, const CpObjectiveProto &integer_objective, const int64_t inner_integer_objective_lower_bound)
 

Variable Documentation

◆ coefficients

std::vector<double> coefficients

Definition at line 745 of file lp_utils.cc.

◆ keep_names

bool keep_names = false

Definition at line 736 of file lp_utils.cc.

◆ lower_bounds

std::vector<double> lower_bounds

Definition at line 746 of file lp_utils.cc.

◆ max_absolute_rhs_error

double max_absolute_rhs_error = 0.0

Definition at line 738 of file lp_utils.cc.

◆ max_relative_coeff_error

double max_relative_coeff_error = 0.0

Definition at line 737 of file lp_utils.cc.

◆ max_scaling_factor

double max_scaling_factor = 0.0

Definition at line 739 of file lp_utils.cc.

◆ min_scaling_factor

double min_scaling_factor = std::numeric_limits<double>::infinity()

Definition at line 740 of file lp_utils.cc.

◆ scaling_target

int64_t scaling_target = int64_t{1} << 50

Definition at line 743 of file lp_utils.cc.

◆ upper_bounds

std::vector<double> upper_bounds

Definition at line 747 of file lp_utils.cc.

◆ var_indices

std::vector<int> var_indices

Definition at line 744 of file lp_utils.cc.

◆ wanted_precision

double wanted_precision = 1e-6

Definition at line 742 of file lp_utils.cc.