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

A linear constraint is always of the form: lower_bound <= sum of linear term elements <= upper_bound, where lower_bound and upper_bound: More...

Inheritance diagram for OperationsResearch.MPConstraintProto:

Public Member Functions

 MPConstraintProto ()
 
 MPConstraintProto (MPConstraintProto other)
 
MPConstraintProto 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.
 
void ClearIsLazy ()
 Clears the value of the "is_lazy" field.
 
override bool Equals (object other)
 
bool Equals (MPConstraintProto other)
 
override int GetHashCode ()
 
override string ToString ()
 
void WriteTo (pb::CodedOutputStream output)
 
int CalculateSize ()
 
void MergeFrom (MPConstraintProto other)
 
void MergeFrom (pb::CodedInputStream input)
 

Static Public Attributes

const int VarIndexFieldNumber = 6
 Field number for the "var_index" field.
 
const int CoefficientFieldNumber = 7
 Field number for the "coefficient" field.
 
const int LowerBoundFieldNumber = 2
 Field number for the "lower_bound" field.
 
const int UpperBoundFieldNumber = 3
 Field number for the "upper_bound" field.
 
const int NameFieldNumber = 4
 Field number for the "name" field.
 
const int IsLazyFieldNumber = 5
 Field number for the "is_lazy" field.
 

Properties

static pb::MessageParser< MPConstraintProtoParser [get]
 
static pbr::MessageDescriptor Descriptor [get]
 
pbc::RepeatedField< int > VarIndex [get]
 var_index[i] is the variable index (w.r.t. to "variable" field of MPModelProto) of the i-th linear term involved in this constraint, and coefficient[i] is its coefficient. Only the terms with non-zero coefficients need to appear. var_index may not contain duplicates.
 
pbc::RepeatedField< double > Coefficient [get]
 Must be finite.
 
double LowerBound [get, set]
 lower_bound must be <= upper_bound.
 
bool HasLowerBound [get]
 Gets whether the "lower_bound" field is set.
 
double UpperBound [get, set]
 
bool HasUpperBound [get]
 Gets whether the "upper_bound" field is set.
 
string Name [get, set]
 The name of the constraint.
 
bool HasName [get]
 Gets whether the "name" field is set.
 
bool IsLazy [get, set]
 [Advanced usage: do not use this if you don't know what you're doing.] A lazy constraint is handled differently by the core solving engine, but it does not change the result. It may or may not impact the performance. For more info see: http://tinyurl.com/lazy-constraints.
 
bool HasIsLazy [get]
 Gets whether the "is_lazy" field is set.
 

Detailed Description

A linear constraint is always of the form: lower_bound <= sum of linear term elements <= upper_bound, where lower_bound and upper_bound:

  • Can form a singleton: lower_bound == upper_bound. The constraint is an equation.
  • Can form a finite interval [lower_bound, upper_bound]. The constraint is both lower- and upper-bounded, i.e. "boxed".
  • Can form a semi-infinite interval. lower_bound = -infinity: the constraint is upper-bounded. upper_bound = +infinity: the constraint is lower-bounded.
  • Can form the infinite interval: lower_bound = -infinity and upper_bound = +infinity. The constraint is free.

Definition at line 800 of file LinearSolver.pb.cs.

Constructor & Destructor Documentation

◆ MPConstraintProto() [1/2]

OperationsResearch.MPConstraintProto.MPConstraintProto ( )
inline

Definition at line 826 of file LinearSolver.pb.cs.

◆ MPConstraintProto() [2/2]

OperationsResearch.MPConstraintProto.MPConstraintProto ( MPConstraintProto other)
inline

Definition at line 834 of file LinearSolver.pb.cs.

Member Function Documentation

◆ CalculateSize()

int OperationsResearch.MPConstraintProto.CalculateSize ( )
inline

Definition at line 1107 of file LinearSolver.pb.cs.

◆ ClearIsLazy()

void OperationsResearch.MPConstraintProto.ClearIsLazy ( )
inline

Clears the value of the "is_lazy" field.

Definition at line 997 of file LinearSolver.pb.cs.

◆ ClearLowerBound()

void OperationsResearch.MPConstraintProto.ClearLowerBound ( )
inline

Clears the value of the "lower_bound" field.

Definition at line 908 of file LinearSolver.pb.cs.

◆ ClearName()

void OperationsResearch.MPConstraintProto.ClearName ( )
inline

Clears the value of the "name" field.

Definition at line 964 of file LinearSolver.pb.cs.

◆ ClearUpperBound()

void OperationsResearch.MPConstraintProto.ClearUpperBound ( )
inline

Clears the value of the "upper_bound" field.

Definition at line 935 of file LinearSolver.pb.cs.

◆ Clone()

MPConstraintProto OperationsResearch.MPConstraintProto.Clone ( )
inline

Definition at line 847 of file LinearSolver.pb.cs.

◆ Equals() [1/2]

bool OperationsResearch.MPConstraintProto.Equals ( MPConstraintProto other)
inline

Definition at line 1009 of file LinearSolver.pb.cs.

◆ Equals() [2/2]

override bool OperationsResearch.MPConstraintProto.Equals ( object other)
inline

Definition at line 1003 of file LinearSolver.pb.cs.

◆ GetHashCode()

override int OperationsResearch.MPConstraintProto.GetHashCode ( )
inline

Definition at line 1027 of file LinearSolver.pb.cs.

◆ MergeFrom() [1/2]

void OperationsResearch.MPConstraintProto.MergeFrom ( MPConstraintProto other)
inline

Definition at line 1131 of file LinearSolver.pb.cs.

◆ MergeFrom() [2/2]

void OperationsResearch.MPConstraintProto.MergeFrom ( pb.CodedInputStream input)
inline

Definition at line 1154 of file LinearSolver.pb.cs.

◆ ToString()

override string OperationsResearch.MPConstraintProto.ToString ( )
inline

Definition at line 1043 of file LinearSolver.pb.cs.

◆ WriteTo()

void OperationsResearch.MPConstraintProto.WriteTo ( pb.CodedOutputStream output)
inline

Definition at line 1049 of file LinearSolver.pb.cs.

Member Data Documentation

◆ CoefficientFieldNumber

const int OperationsResearch.MPConstraintProto.CoefficientFieldNumber = 7
static

Field number for the "coefficient" field.

Definition at line 869 of file LinearSolver.pb.cs.

◆ IsLazyFieldNumber

const int OperationsResearch.MPConstraintProto.IsLazyFieldNumber = 5
static

Field number for the "is_lazy" field.

Definition at line 969 of file LinearSolver.pb.cs.

◆ LowerBoundFieldNumber

const int OperationsResearch.MPConstraintProto.LowerBoundFieldNumber = 2
static

Field number for the "lower_bound" field.

Definition at line 883 of file LinearSolver.pb.cs.

◆ NameFieldNumber

const int OperationsResearch.MPConstraintProto.NameFieldNumber = 4
static

Field number for the "name" field.

Definition at line 940 of file LinearSolver.pb.cs.

◆ UpperBoundFieldNumber

const int OperationsResearch.MPConstraintProto.UpperBoundFieldNumber = 3
static

Field number for the "upper_bound" field.

Definition at line 913 of file LinearSolver.pb.cs.

◆ VarIndexFieldNumber

const int OperationsResearch.MPConstraintProto.VarIndexFieldNumber = 6
static

Field number for the "var_index" field.

Definition at line 852 of file LinearSolver.pb.cs.

Property Documentation

◆ Coefficient

pbc.RepeatedField<double> OperationsResearch.MPConstraintProto.Coefficient
get

Must be finite.

Definition at line 878 of file LinearSolver.pb.cs.

◆ Descriptor

pbr.MessageDescriptor OperationsResearch.MPConstraintProto.Descriptor
staticget

Definition at line 814 of file LinearSolver.pb.cs.

◆ HasIsLazy

bool OperationsResearch.MPConstraintProto.HasIsLazy
get

Gets whether the "is_lazy" field is set.

Definition at line 991 of file LinearSolver.pb.cs.

◆ HasLowerBound

bool OperationsResearch.MPConstraintProto.HasLowerBound
get

Gets whether the "lower_bound" field is set.

Definition at line 902 of file LinearSolver.pb.cs.

◆ HasName

bool OperationsResearch.MPConstraintProto.HasName
get

Gets whether the "name" field is set.

Definition at line 958 of file LinearSolver.pb.cs.

◆ HasUpperBound

bool OperationsResearch.MPConstraintProto.HasUpperBound
get

Gets whether the "upper_bound" field is set.

Definition at line 929 of file LinearSolver.pb.cs.

◆ IsLazy

bool OperationsResearch.MPConstraintProto.IsLazy
getset

[Advanced usage: do not use this if you don't know what you're doing.] A lazy constraint is handled differently by the core solving engine, but it does not change the result. It may or may not impact the performance. For more info see: http://tinyurl.com/lazy-constraints.

Definition at line 981 of file LinearSolver.pb.cs.

◆ LowerBound

double OperationsResearch.MPConstraintProto.LowerBound
getset

lower_bound must be <= upper_bound.

Definition at line 892 of file LinearSolver.pb.cs.

◆ Name

string OperationsResearch.MPConstraintProto.Name
getset

The name of the constraint.

Definition at line 949 of file LinearSolver.pb.cs.

◆ Parser

pb.MessageParser<MPConstraintProto> OperationsResearch.MPConstraintProto.Parser
staticget

Definition at line 810 of file LinearSolver.pb.cs.

◆ UpperBound

double OperationsResearch.MPConstraintProto.UpperBound
getset

Definition at line 919 of file LinearSolver.pb.cs.

◆ VarIndex

pbc.RepeatedField<int> OperationsResearch.MPConstraintProto.VarIndex
get

var_index[i] is the variable index (w.r.t. to "variable" field of MPModelProto) of the i-th linear term involved in this constraint, and coefficient[i] is its coefficient. Only the terms with non-zero coefficients need to appear. var_index may not contain duplicates.

Definition at line 864 of file LinearSolver.pb.cs.


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