Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Google.OrTools.Sat.LinearBooleanConstraint Class Referencesealed

A linear Boolean constraint which is a bounded sum of linear terms. Each term beeing a literal times an integer coefficient. If we assume that a literal takes the value 1 if it is true and 0 otherwise, the constraint is: lower_bound <= ... + coefficients[i] * literals[i] + ... <= upper_bound. More...

Inheritance diagram for Google.OrTools.Sat.LinearBooleanConstraint:

Public Member Functions

 LinearBooleanConstraint ()
 
 LinearBooleanConstraint (LinearBooleanConstraint other)
 
LinearBooleanConstraint Clone ()
 
void ClearLowerBound ()
 Clears the value of the "lower_bound" field.
 
void ClearUpperBound ()
 Clears the value of the "upper_bound" field.
 
void ClearName ()
 Clears the value of the "name" field.
 
override bool Equals (object other)
 
bool Equals (LinearBooleanConstraint other)
 
override int GetHashCode ()
 
override string ToString ()
 
void WriteTo (pb::CodedOutputStream output)
 
int CalculateSize ()
 
void MergeFrom (LinearBooleanConstraint other)
 
void MergeFrom (pb::CodedInputStream input)
 

Static Public Attributes

const int LiteralsFieldNumber = 1
 Field number for the "literals" field.
 
const int CoefficientsFieldNumber = 2
 Field number for the "coefficients" field.
 
const int LowerBoundFieldNumber = 3
 Field number for the "lower_bound" field.
 
const int UpperBoundFieldNumber = 4
 Field number for the "upper_bound" field.
 
const int NameFieldNumber = 5
 Field number for the "name" field.
 

Properties

static pb::MessageParser< LinearBooleanConstraintParser [get]
 
static pbr::MessageDescriptor Descriptor [get]
 
pbc::RepeatedField< int > Literals [get]
 Linear terms involved in this constraint.
 
pbc::RepeatedField< long > Coefficients [get]
 
long LowerBound [get, set]
 Optional lower (resp. upper) bound of the constraint. If not present, it means that the constraint is not bounded in this direction. The bounds are INCLUSIVE.
 
bool HasLowerBound [get]
 Gets whether the "lower_bound" field is set.
 
long UpperBound [get, set]
 
bool HasUpperBound [get]
 Gets whether the "upper_bound" field is set.
 
string Name [get, set]
 The name of this constraint.
 
bool HasName [get]
 Gets whether the "name" field is set.
 

Detailed Description

A linear Boolean constraint which is a bounded sum of linear terms. Each term beeing a literal times an integer coefficient. If we assume that a literal takes the value 1 if it is true and 0 otherwise, the constraint is: lower_bound <= ... + coefficients[i] * literals[i] + ... <= upper_bound.

Definition at line 63 of file BooleanProblem.pb.cs.

Constructor & Destructor Documentation

◆ LinearBooleanConstraint() [1/2]

Google.OrTools.Sat.LinearBooleanConstraint.LinearBooleanConstraint ( )
inline

Definition at line 89 of file BooleanProblem.pb.cs.

◆ LinearBooleanConstraint() [2/2]

Google.OrTools.Sat.LinearBooleanConstraint.LinearBooleanConstraint ( LinearBooleanConstraint other)
inline

Definition at line 97 of file BooleanProblem.pb.cs.

Member Function Documentation

◆ CalculateSize()

int Google.OrTools.Sat.LinearBooleanConstraint.CalculateSize ( )
inline

Definition at line 332 of file BooleanProblem.pb.cs.

◆ ClearLowerBound()

void Google.OrTools.Sat.LinearBooleanConstraint.ClearLowerBound ( )
inline

Clears the value of the "lower_bound" field.

Definition at line 176 of file BooleanProblem.pb.cs.

◆ ClearName()

void Google.OrTools.Sat.LinearBooleanConstraint.ClearName ( )
inline

Clears the value of the "name" field.

Definition at line 232 of file BooleanProblem.pb.cs.

◆ ClearUpperBound()

void Google.OrTools.Sat.LinearBooleanConstraint.ClearUpperBound ( )
inline

Clears the value of the "upper_bound" field.

Definition at line 203 of file BooleanProblem.pb.cs.

◆ Clone()

LinearBooleanConstraint Google.OrTools.Sat.LinearBooleanConstraint.Clone ( )
inline

Definition at line 109 of file BooleanProblem.pb.cs.

◆ Equals() [1/2]

bool Google.OrTools.Sat.LinearBooleanConstraint.Equals ( LinearBooleanConstraint other)
inline

Definition at line 244 of file BooleanProblem.pb.cs.

◆ Equals() [2/2]

override bool Google.OrTools.Sat.LinearBooleanConstraint.Equals ( object other)
inline

Definition at line 238 of file BooleanProblem.pb.cs.

◆ GetHashCode()

override int Google.OrTools.Sat.LinearBooleanConstraint.GetHashCode ( )
inline

Definition at line 261 of file BooleanProblem.pb.cs.

◆ MergeFrom() [1/2]

void Google.OrTools.Sat.LinearBooleanConstraint.MergeFrom ( LinearBooleanConstraint other)
inline

Definition at line 353 of file BooleanProblem.pb.cs.

◆ MergeFrom() [2/2]

void Google.OrTools.Sat.LinearBooleanConstraint.MergeFrom ( pb::CodedInputStream input)
inline

Definition at line 373 of file BooleanProblem.pb.cs.

◆ ToString()

override string Google.OrTools.Sat.LinearBooleanConstraint.ToString ( )
inline

Definition at line 276 of file BooleanProblem.pb.cs.

◆ WriteTo()

void Google.OrTools.Sat.LinearBooleanConstraint.WriteTo ( pb::CodedOutputStream output)
inline

Definition at line 282 of file BooleanProblem.pb.cs.

Member Data Documentation

◆ CoefficientsFieldNumber

const int Google.OrTools.Sat.LinearBooleanConstraint.CoefficientsFieldNumber = 2
static

Field number for the "coefficients" field.

Definition at line 138 of file BooleanProblem.pb.cs.

◆ LiteralsFieldNumber

const int Google.OrTools.Sat.LinearBooleanConstraint.LiteralsFieldNumber = 1
static

Field number for the "literals" field.

Definition at line 114 of file BooleanProblem.pb.cs.

◆ LowerBoundFieldNumber

const int Google.OrTools.Sat.LinearBooleanConstraint.LowerBoundFieldNumber = 3
static

Field number for the "lower_bound" field.

Definition at line 149 of file BooleanProblem.pb.cs.

◆ NameFieldNumber

const int Google.OrTools.Sat.LinearBooleanConstraint.NameFieldNumber = 5
static

Field number for the "name" field.

Definition at line 208 of file BooleanProblem.pb.cs.

◆ UpperBoundFieldNumber

const int Google.OrTools.Sat.LinearBooleanConstraint.UpperBoundFieldNumber = 4
static

Field number for the "upper_bound" field.

Definition at line 181 of file BooleanProblem.pb.cs.

Property Documentation

◆ Coefficients

pbc.RepeatedField<long> Google.OrTools.Sat.LinearBooleanConstraint.Coefficients
get

Definition at line 144 of file BooleanProblem.pb.cs.

◆ Descriptor

pbr.MessageDescriptor Google.OrTools.Sat.LinearBooleanConstraint.Descriptor
staticget

Definition at line 77 of file BooleanProblem.pb.cs.

◆ HasLowerBound

bool Google.OrTools.Sat.LinearBooleanConstraint.HasLowerBound
get

Gets whether the "lower_bound" field is set.

Definition at line 170 of file BooleanProblem.pb.cs.

◆ HasName

bool Google.OrTools.Sat.LinearBooleanConstraint.HasName
get

Gets whether the "name" field is set.

Definition at line 226 of file BooleanProblem.pb.cs.

◆ HasUpperBound

bool Google.OrTools.Sat.LinearBooleanConstraint.HasUpperBound
get

Gets whether the "upper_bound" field is set.

Definition at line 197 of file BooleanProblem.pb.cs.

◆ Literals

pbc.RepeatedField<int> Google.OrTools.Sat.LinearBooleanConstraint.Literals
get

Linear terms involved in this constraint.

literals[i] is the signed representation of the i-th literal of the constraint and coefficients[i] its coefficients. The signed representation is as follow: for a 0-based variable index x, (x + 1) represents the variable x and -(x + 1) represents its negation.

Note
the same variable shouldn't appear twice and that zero coefficients are not allowed.

Definition at line 133 of file BooleanProblem.pb.cs.

◆ LowerBound

long Google.OrTools.Sat.LinearBooleanConstraint.LowerBound
getset

Optional lower (resp. upper) bound of the constraint. If not present, it means that the constraint is not bounded in this direction. The bounds are INCLUSIVE.

Definition at line 160 of file BooleanProblem.pb.cs.

◆ Name

string Google.OrTools.Sat.LinearBooleanConstraint.Name
getset

The name of this constraint.

Definition at line 217 of file BooleanProblem.pb.cs.

◆ Parser

pb.MessageParser<LinearBooleanConstraint> Google.OrTools.Sat.LinearBooleanConstraint.Parser
staticget

Definition at line 73 of file BooleanProblem.pb.cs.

◆ UpperBound

long Google.OrTools.Sat.LinearBooleanConstraint.UpperBound
getset

Definition at line 187 of file BooleanProblem.pb.cs.


The documentation for this class was generated from the following file: