Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
linear_constraint.h File Reference
#include <algorithm>
#include <memory>
#include <ostream>
#include <string>
#include <utility>
#include <vector>
#include "absl/base/attributes.h"
#include "absl/strings/str_cat.h"
#include "absl/types/span.h"
#include "ortools/base/strong_vector.h"
#include "ortools/sat/integer.h"
#include "ortools/sat/model.h"
#include "ortools/sat/sat_base.h"
#include "ortools/util/strong_integers.h"

Go to the source code of this file.

Classes

struct  operations_research::sat::LinearConstraint
 
struct  operations_research::sat::LinearExpression
 
class  operations_research::sat::LinearConstraintBuilder
 

Namespaces

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

Functions

std::ostream & operations_research::sat::operator<< (std::ostream &os, const LinearConstraint &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)
 
double operations_research::sat::ComputeActivity (const LinearConstraint &constraint, const util_intops::StrongVector< IntegerVariable, double > &values)
 
bool operations_research::sat::PossibleOverflow (const IntegerTrail &integer_trail, const LinearConstraint &constraint)
 
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.
 
void operations_research::sat::CleanTermsAndFillConstraint (std::vector< std::pair< IntegerVariable, IntegerValue > > *terms, LinearExpression *output)
 
void operations_research::sat::CleanTermsAndFillConstraint (std::vector< std::pair< IntegerVariable, IntegerValue > > *terms, LinearConstraint *output)