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

An integer variable. More...

Inheritance diagram for Google.OrTools.Sat.IntegerVariableProto:

Public Member Functions

 IntegerVariableProto ()
 
 IntegerVariableProto (IntegerVariableProto other)
 
IntegerVariableProto Clone ()
 
override bool Equals (object other)
 
bool Equals (IntegerVariableProto other)
 
override int GetHashCode ()
 
override string ToString ()
 
void WriteTo (pb::CodedOutputStream output)
 
int CalculateSize ()
 
void MergeFrom (IntegerVariableProto other)
 
void MergeFrom (pb::CodedInputStream input)
 

Static Public Attributes

const int NameFieldNumber = 1
 Field number for the "name" field.
 
const int DomainFieldNumber = 2
 Field number for the "domain" field.
 

Properties

static pb::MessageParser< IntegerVariableProtoParser [get]
 
static pbr::MessageDescriptor Descriptor [get]
 
string Name [get, set]
 For debug/logging only. Can be empty.
 
pbc::RepeatedField< long > Domain [get]
 The variable domain given as a sorted list of n disjoint intervals [min, max] and encoded as [min_0, max_0, ..., min_{n-1}, max_{n-1}].
 

Detailed Description

An integer variable.

It will be referred to by an int32 corresponding to its index in a CpModelProto variables field. Depending on the context, a reference to a variable whose domain is in [0, 1] can also be seen as a Boolean that will be true if the variable value is 1 and false if it is 0. When used in this context, the field name will always contain the word "literal". Negative reference (advanced usage): to simplify the creation of a model and for efficiency reasons, all the "literal" or "variable" fields can also contain a negative index. A negative index i will refer to the negation of the integer variable at index -i -1 or to NOT the literal at the same index. Ex: A variable index 4 will refer to the integer variable model.variables(4) and an index of -5 will refer to the negation of the same variable. A literal index 4 will refer to the logical fact that model.variable(4) == 1 and a literal index of -5 will refer to the logical fact model.variable(4) == 0.

Definition at line 273 of file CpModel.pb.cs.

Constructor & Destructor Documentation

◆ IntegerVariableProto() [1/2]

Google.OrTools.Sat.IntegerVariableProto.IntegerVariableProto ( )
inline

Definition at line 298 of file CpModel.pb.cs.

◆ IntegerVariableProto() [2/2]

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

Definition at line 306 of file CpModel.pb.cs.

Member Function Documentation

◆ CalculateSize()

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

Definition at line 438 of file CpModel.pb.cs.

◆ Clone()

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

Definition at line 314 of file CpModel.pb.cs.

◆ Equals() [1/2]

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

Definition at line 374 of file CpModel.pb.cs.

◆ Equals() [2/2]

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

Definition at line 368 of file CpModel.pb.cs.

◆ GetHashCode()

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

Definition at line 388 of file CpModel.pb.cs.

◆ MergeFrom() [1/2]

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

Definition at line 452 of file CpModel.pb.cs.

◆ MergeFrom() [2/2]

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

Definition at line 465 of file CpModel.pb.cs.

◆ ToString()

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

Definition at line 400 of file CpModel.pb.cs.

◆ WriteTo()

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

Definition at line 406 of file CpModel.pb.cs.

Member Data Documentation

◆ DomainFieldNumber

const int Google.OrTools.Sat.IntegerVariableProto.DomainFieldNumber = 2
static

Field number for the "domain" field.

Definition at line 334 of file CpModel.pb.cs.

◆ NameFieldNumber

const int Google.OrTools.Sat.IntegerVariableProto.NameFieldNumber = 1
static

Field number for the "name" field.

Definition at line 319 of file CpModel.pb.cs.

Property Documentation

◆ Descriptor

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

Definition at line 286 of file CpModel.pb.cs.

◆ Domain

pbc.RepeatedField<long> Google.OrTools.Sat.IntegerVariableProto.Domain
get

The variable domain given as a sorted list of n disjoint intervals [min, max] and encoded as [min_0, max_0, ..., min_{n-1}, max_{n-1}].

The most common example being just [min, max]. If min == max, then this is a constant variable. We have:

  • domain_size() is always even.
  • min == domain.front();
  • max == domain.back();
  • for all i < n : min_i <= max_i
  • for all i < n-1 : max_i + 1 < min_{i+1}.
    Note
    we check at validation that a variable domain is small enough so that we don't run into integer overflow in our algorithms. Because of that, you cannot just have "unbounded" variable like [0, kint64max] and should try to specify tighter domains.

Definition at line 362 of file CpModel.pb.cs.

◆ Name

string Google.OrTools.Sat.IntegerVariableProto.Name
getset

For debug/logging only. Can be empty.

Definition at line 326 of file CpModel.pb.cs.

◆ Parser

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

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


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