Google OR-Tools v9.12
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 2592 of file LinearSolver.pb.cs.

Constructor & Destructor Documentation

◆ MPQuadraticConstraint() [1/2]

OperationsResearch.MPQuadraticConstraint.MPQuadraticConstraint ( )
inline

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

◆ MPQuadraticConstraint() [2/2]

OperationsResearch.MPQuadraticConstraint.MPQuadraticConstraint ( MPQuadraticConstraint other)
inline

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

Member Function Documentation

◆ CalculateSize()

int OperationsResearch.MPQuadraticConstraint.CalculateSize ( )
inline

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

◆ ClearLowerBound()

void OperationsResearch.MPQuadraticConstraint.ClearLowerBound ( )
inline

Clears the value of the "lower_bound" field.

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

◆ ClearUpperBound()

void OperationsResearch.MPQuadraticConstraint.ClearUpperBound ( )
inline

Clears the value of the "upper_bound" field.

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

◆ Clone()

MPQuadraticConstraint OperationsResearch.MPQuadraticConstraint.Clone ( )
inline

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

◆ Equals() [1/2]

bool OperationsResearch.MPQuadraticConstraint.Equals ( MPQuadraticConstraint other)
inline

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

◆ Equals() [2/2]

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

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

◆ GetHashCode()

override int OperationsResearch.MPQuadraticConstraint.GetHashCode ( )
inline

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

◆ MergeFrom() [1/2]

void OperationsResearch.MPQuadraticConstraint.MergeFrom ( MPQuadraticConstraint other)
inline

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

◆ MergeFrom() [2/2]

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

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

◆ ToString()

override string OperationsResearch.MPQuadraticConstraint.ToString ( )
inline

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

◆ WriteTo()

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

Definition at line 2827 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 2662 of file LinearSolver.pb.cs.

◆ LowerBoundFieldNumber

const int OperationsResearch.MPQuadraticConstraint.LowerBoundFieldNumber = 6
static

Field number for the "lower_bound" field.

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

◆ QcoefficientFieldNumber

const int OperationsResearch.MPQuadraticConstraint.QcoefficientFieldNumber = 5
static

Field number for the "qcoefficient" field.

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

◆ Qvar1IndexFieldNumber

const int OperationsResearch.MPQuadraticConstraint.Qvar1IndexFieldNumber = 3
static

Field number for the "qvar1_index" field.

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

◆ Qvar2IndexFieldNumber

const int OperationsResearch.MPQuadraticConstraint.Qvar2IndexFieldNumber = 4
static

Field number for the "qvar2_index" field.

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

◆ UpperBoundFieldNumber

const int OperationsResearch.MPQuadraticConstraint.UpperBoundFieldNumber = 7
static

Field number for the "upper_bound" field.

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

◆ VarIndexFieldNumber

const int OperationsResearch.MPQuadraticConstraint.VarIndexFieldNumber = 1
static

Field number for the "var_index" field.

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

Property Documentation

◆ Coefficient

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

Must be finite.

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

◆ Descriptor

pbr.MessageDescriptor OperationsResearch.MPQuadraticConstraint.Descriptor
staticget

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

◆ HasLowerBound

bool OperationsResearch.MPQuadraticConstraint.HasLowerBound
get

Gets whether the "lower_bound" field is set.

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

◆ HasUpperBound

bool OperationsResearch.MPQuadraticConstraint.HasUpperBound
get

Gets whether the "upper_bound" field is set.

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

◆ LowerBound

double OperationsResearch.MPQuadraticConstraint.LowerBound
getset

lower_bound must be <= upper_bound.

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

◆ Parser

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

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

◆ Qcoefficient

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

Must be finite.

Definition at line 2716 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 2691 of file LinearSolver.pb.cs.

◆ Qvar2Index

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

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

◆ UpperBound

double OperationsResearch.MPQuadraticConstraint.UpperBound
getset

Definition at line 2757 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 2657 of file LinearSolver.pb.cs.


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