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

Quadratic constraints of the form lb <= sum a_i x_i + sum b_ij x_i x_j <= ub, where a, b, lb and ub are constants, and x are the model's variables. Quadratic matrices that are Positive Semi-Definite, Second-Order Cones or rotated Second-Order Cones are always accepted. Other forms may or may not be accepted depending on the underlying solver used. See https://scip.zib.de/doc/html/cons__quadratic_8h.php and https://www.gurobi.com/documentation/9.0/refman/constraints.html#subsubsection:QuadraticConstraints. More...

Inheritance diagram for OperationsResearch.MPQuadraticConstraint:

Public Member Functions

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

Static Public Attributes

const int VarIndexFieldNumber = 1
 Field number for the "var_index" field.
 
const int CoefficientFieldNumber = 2
 Field number for the "coefficient" field.
 
const int Qvar1IndexFieldNumber = 3
 Field number for the "qvar1_index" field.
 
const int Qvar2IndexFieldNumber = 4
 Field number for the "qvar2_index" field.
 
const int QcoefficientFieldNumber = 5
 Field number for the "qcoefficient" field.
 
const int LowerBoundFieldNumber = 6
 Field number for the "lower_bound" field.
 
const int UpperBoundFieldNumber = 7
 Field number for the "upper_bound" field.
 

Properties

static pb::MessageParser< MPQuadraticConstraintParser [get]
 
static pbr::MessageDescriptor Descriptor [get]
 
pbc::RepeatedField< int > VarIndex [get]
 Sparse representation of linear terms in the quadratic constraint, where term i is var_index[i] * coefficient[i]. var_index are variable indices w.r.t the "variable" field in MPModelProto, and should be unique.
 
pbc::RepeatedField< double > Coefficient [get]
 Must be finite.
 
pbc::RepeatedField< int > Qvar1Index [get]
 Sparse representation of quadratic terms in the quadratic constraint, where term i is qvar1_index[i] * qvar2_index[i] * qcoefficient[i]. qvar1_index and qvar2_index are variable indices w.r.t the "variable" field in MPModelProto. qvar1_index, qvar2_index and coefficients must have the same size. If the same unordered pair (qvar1_index, qvar2_index) appears several times, the sum of all of the associated coefficients will be applied.
 
pbc::RepeatedField< int > Qvar2Index [get]
 
pbc::RepeatedField< double > Qcoefficient [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.
 

Detailed Description

Quadratic constraints of the form lb <= sum a_i x_i + sum b_ij x_i x_j <= ub, where a, b, lb and ub are constants, and x are the model's variables. Quadratic matrices that are Positive Semi-Definite, Second-Order Cones or rotated Second-Order Cones are always accepted. Other forms may or may not be accepted depending on the underlying solver used. See https://scip.zib.de/doc/html/cons__quadratic_8h.php and https://www.gurobi.com/documentation/9.0/refman/constraints.html#subsubsection:QuadraticConstraints.

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

Constructor & Destructor Documentation

◆ MPQuadraticConstraint() [1/2]

OperationsResearch.MPQuadraticConstraint.MPQuadraticConstraint ( )
inline

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

◆ MPQuadraticConstraint() [2/2]

OperationsResearch.MPQuadraticConstraint.MPQuadraticConstraint ( MPQuadraticConstraint other)
inline

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

Member Function Documentation

◆ CalculateSize()

int OperationsResearch.MPQuadraticConstraint.CalculateSize ( )
inline

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

◆ ClearLowerBound()

void OperationsResearch.MPQuadraticConstraint.ClearLowerBound ( )
inline

Clears the value of the "lower_bound" field.

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

◆ ClearUpperBound()

void OperationsResearch.MPQuadraticConstraint.ClearUpperBound ( )
inline

Clears the value of the "upper_bound" field.

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

◆ Clone()

MPQuadraticConstraint OperationsResearch.MPQuadraticConstraint.Clone ( )
inline

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

◆ Equals() [1/2]

bool OperationsResearch.MPQuadraticConstraint.Equals ( MPQuadraticConstraint other)
inline

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

◆ Equals() [2/2]

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

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

◆ GetHashCode()

override int OperationsResearch.MPQuadraticConstraint.GetHashCode ( )
inline

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

◆ MergeFrom() [1/2]

void OperationsResearch.MPQuadraticConstraint.MergeFrom ( MPQuadraticConstraint other)
inline

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

◆ MergeFrom() [2/2]

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

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

◆ ToString()

override string OperationsResearch.MPQuadraticConstraint.ToString ( )
inline

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

◆ WriteTo()

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

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

Member Data Documentation

◆ CoefficientFieldNumber

const int OperationsResearch.MPQuadraticConstraint.CoefficientFieldNumber = 2
static

Field number for the "coefficient" field.

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

◆ LowerBoundFieldNumber

const int OperationsResearch.MPQuadraticConstraint.LowerBoundFieldNumber = 6
static

Field number for the "lower_bound" field.

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

◆ QcoefficientFieldNumber

const int OperationsResearch.MPQuadraticConstraint.QcoefficientFieldNumber = 5
static

Field number for the "qcoefficient" field.

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

◆ Qvar1IndexFieldNumber

const int OperationsResearch.MPQuadraticConstraint.Qvar1IndexFieldNumber = 3
static

Field number for the "qvar1_index" field.

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

◆ Qvar2IndexFieldNumber

const int OperationsResearch.MPQuadraticConstraint.Qvar2IndexFieldNumber = 4
static

Field number for the "qvar2_index" field.

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

◆ UpperBoundFieldNumber

const int OperationsResearch.MPQuadraticConstraint.UpperBoundFieldNumber = 7
static

Field number for the "upper_bound" field.

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

◆ VarIndexFieldNumber

const int OperationsResearch.MPQuadraticConstraint.VarIndexFieldNumber = 1
static

Field number for the "var_index" field.

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

Property Documentation

◆ Coefficient

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

Must be finite.

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

◆ Descriptor

pbr.MessageDescriptor OperationsResearch.MPQuadraticConstraint.Descriptor
staticget

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

◆ HasLowerBound

bool OperationsResearch.MPQuadraticConstraint.HasLowerBound
get

Gets whether the "lower_bound" field is set.

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

◆ HasUpperBound

bool OperationsResearch.MPQuadraticConstraint.HasUpperBound
get

Gets whether the "upper_bound" field is set.

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

◆ LowerBound

double OperationsResearch.MPQuadraticConstraint.LowerBound
getset

lower_bound must be <= upper_bound.

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

◆ Parser

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

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

◆ Qcoefficient

pbc.RepeatedField<double> OperationsResearch.MPQuadraticConstraint.Qcoefficient
get

Must be finite.

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

◆ Qvar1Index

pbc.RepeatedField<int> OperationsResearch.MPQuadraticConstraint.Qvar1Index
get

Sparse representation of quadratic terms in the quadratic constraint, where term i is qvar1_index[i] * qvar2_index[i] * qcoefficient[i]. qvar1_index and qvar2_index are variable indices w.r.t the "variable" field in MPModelProto. qvar1_index, qvar2_index and coefficients must have the same size. If the same unordered pair (qvar1_index, qvar2_index) appears several times, the sum of all of the associated coefficients will be applied.

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

◆ Qvar2Index

pbc.RepeatedField<int> OperationsResearch.MPQuadraticConstraint.Qvar2Index
get

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

◆ UpperBound

double OperationsResearch.MPQuadraticConstraint.UpperBound
getset

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

◆ VarIndex

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

Sparse representation of linear terms in the quadratic constraint, where term i is var_index[i] * coefficient[i]. var_index are variable indices w.r.t the "variable" field in MPModelProto, and should be unique.

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


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