Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
linear_constraint.cc File Reference
#include "ortools/sat/linear_constraint.h"
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <string>
#include <utility>
#include <vector>
#include "absl/base/attributes.h"
#include "absl/container/flat_hash_set.h"
#include "absl/log/check.h"
#include "absl/strings/str_cat.h"
#include "absl/types/span.h"
#include "ortools/base/mathutil.h"
#include "ortools/base/strong_vector.h"
#include "ortools/sat/integer.h"
#include "ortools/sat/sat_base.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

double operations_research::sat::ComputeActivity (const LinearConstraint &constraint, const util_intops::StrongVector< IntegerVariable, double > &values)
 
double operations_research::sat::ComputeL2Norm (const LinearConstraint &constraint)
 Returns sqrt(sum square(coeff)).
 
IntegerValue operations_research::sat::ComputeInfinityNorm (const LinearConstraint &constraint)
 Returns the maximum absolute value of the coefficients.
 
double operations_research::sat::ScalarProduct (const LinearConstraint &ct1, const LinearConstraint &ct2)
 
void operations_research::sat::DivideByGCD (LinearConstraint *constraint)
 
void operations_research::sat::RemoveZeroTerms (LinearConstraint *constraint)
 Removes the entries with a coefficient of zero.
 
void operations_research::sat::MakeAllCoefficientsPositive (LinearConstraint *constraint)
 Makes all coefficients positive by transforming a variable to its negation.
 
void operations_research::sat::MakeAllVariablesPositive (LinearConstraint *constraint)
 Makes all variables "positive" by transforming a variable to its negation.
 
bool operations_research::sat::NoDuplicateVariable (const LinearConstraint &ct)
 Returns false if duplicate variables are found in ct.
 
LinearExpression operations_research::sat::CanonicalizeExpr (const LinearExpression &expr)
 
bool operations_research::sat::ValidateLinearConstraintForOverflow (const LinearConstraint &constraint, const IntegerTrail &integer_trail)
 
LinearExpression operations_research::sat::NegationOf (const LinearExpression &expr)
 Preserves canonicality.
 
LinearExpression operations_research::sat::PositiveVarExpr (const LinearExpression &expr)
 Returns the same expression with positive variables.
 
IntegerValue operations_research::sat::GetCoefficient (const IntegerVariable var, const LinearExpression &expr)
 
IntegerValue operations_research::sat::GetCoefficientOfPositiveVar (const IntegerVariable var, const LinearExpression &expr)
 
bool operations_research::sat::PossibleOverflow (const IntegerTrail &integer_trail, const LinearConstraint &constraint)