Java Reference
Java Reference
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/8.1/refman/constraints.html#subsubsection:QuadraticConstraints
Protobuf type
Definition at line 765 of file MPQuadraticConstraint.java.
Public Member Functions | |
| .lang.Override Builder | clear () |
| .lang.Override com.google.protobuf.Descriptors.Descriptor | getDescriptorForType () |
| .lang.Override com.google.ortools.linearsolver.MPQuadraticConstraint | getDefaultInstanceForType () |
| .lang.Override com.google.ortools.linearsolver.MPQuadraticConstraint | build () |
| .lang.Override com.google.ortools.linearsolver.MPQuadraticConstraint | buildPartial () |
| .lang.Override Builder | clone () |
| .lang.Override Builder | setField (com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) |
| .lang.Override Builder | clearField (com.google.protobuf.Descriptors.FieldDescriptor field) |
| .lang.Override Builder | clearOneof (com.google.protobuf.Descriptors.OneofDescriptor oneof) |
| .lang.Override Builder | setRepeatedField (com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) |
| .lang.Override Builder | addRepeatedField (com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) |
| .lang.Override Builder | mergeFrom (com.google.protobuf.Message other) |
| Builder | mergeFrom (com.google.ortools.linearsolver.MPQuadraticConstraint other) |
| .lang.Override final boolean | isInitialized () |
| .lang.Override Builder | mergeFrom (com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException |
| java.util.List< java.lang.Integer > | getVarIndexList () |
| int | getVarIndexCount () |
| int | getVarIndex (int index) |
| Builder | setVarIndex (int index, int value) |
| Builder | addVarIndex (int value) |
| Builder | addAllVarIndex (java.lang.Iterable<? extends java.lang.Integer > values) |
| Builder | clearVarIndex () |
| java.util.List< java.lang.Double > | getCoefficientList () |
| int | getCoefficientCount () |
| double | getCoefficient (int index) |
| Builder | setCoefficient (int index, double value) |
| Builder | addCoefficient (double value) |
| Builder | addAllCoefficient (java.lang.Iterable<? extends java.lang.Double > values) |
| Builder | clearCoefficient () |
| java.util.List< java.lang.Integer > | getQvar1IndexList () |
| int | getQvar1IndexCount () |
| int | getQvar1Index (int index) |
| Builder | setQvar1Index (int index, int value) |
| Builder | addQvar1Index (int value) |
| Builder | addAllQvar1Index (java.lang.Iterable<? extends java.lang.Integer > values) |
| Builder | clearQvar1Index () |
| java.util.List< java.lang.Integer > | getQvar2IndexList () |
repeated int32 qvar2_index = 4; More... | |
| int | getQvar2IndexCount () |
repeated int32 qvar2_index = 4; More... | |
| int | getQvar2Index (int index) |
repeated int32 qvar2_index = 4; More... | |
| Builder | setQvar2Index (int index, int value) |
repeated int32 qvar2_index = 4; More... | |
| Builder | addQvar2Index (int value) |
repeated int32 qvar2_index = 4; More... | |
| Builder | addAllQvar2Index (java.lang.Iterable<? extends java.lang.Integer > values) |
repeated int32 qvar2_index = 4; More... | |
| Builder | clearQvar2Index () |
repeated int32 qvar2_index = 4; More... | |
| java.util.List< java.lang.Double > | getQcoefficientList () |
| int | getQcoefficientCount () |
| double | getQcoefficient (int index) |
| Builder | setQcoefficient (int index, double value) |
| Builder | addQcoefficient (double value) |
| Builder | addAllQcoefficient (java.lang.Iterable<? extends java.lang.Double > values) |
| Builder | clearQcoefficient () |
| .lang.Override boolean | hasLowerBound () |
| .lang.Override double | getLowerBound () |
| Builder | setLowerBound (double value) |
| Builder | clearLowerBound () |
| .lang.Override boolean | hasUpperBound () |
optional double upper_bound = 7 [default = inf]; More... | |
| .lang.Override double | getUpperBound () |
optional double upper_bound = 7 [default = inf]; More... | |
| Builder | setUpperBound (double value) |
optional double upper_bound = 7 [default = inf]; More... | |
| Builder | clearUpperBound () |
optional double upper_bound = 7 [default = inf]; More... | |
| .lang.Override final Builder | setUnknownFields (final com.google.protobuf.UnknownFieldSet unknownFields) |
| .lang.Override final Builder | mergeUnknownFields (final com.google.protobuf.UnknownFieldSet unknownFields) |
Static Public Member Functions | |
| static final com.google.protobuf.Descriptors.Descriptor | getDescriptor () |
Protected Member Functions | |
| .lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable | internalGetFieldAccessorTable () |
Member Function Documentation
◆ addAllCoefficient()
|
inline |
Must be finite.
repeated double coefficient = 2;
- Parameters
-
values The coefficient to add.
- Returns
- This builder for chaining.
Definition at line 1222 of file MPQuadraticConstraint.java.
◆ addAllQcoefficient()
|
inline |
Must be finite.
repeated double qcoefficient = 5;
- Parameters
-
values The qcoefficient to add.
- Returns
- This builder for chaining.
Definition at line 1557 of file MPQuadraticConstraint.java.
◆ addAllQvar1Index()
|
inline |
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.
repeated int32 qvar1_index = 3;
- Parameters
-
values The qvar1Index to add.
- Returns
- This builder for chaining.
Definition at line 1365 of file MPQuadraticConstraint.java.
◆ addAllQvar2Index()
|
inline |
repeated int32 qvar2_index = 4;
- Parameters
-
values The qvar2Index to add.
- Returns
- This builder for chaining.
Definition at line 1454 of file MPQuadraticConstraint.java.
◆ addAllVarIndex()
|
inline |
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.
repeated int32 var_index = 1;
- Parameters
-
values The varIndex to add.
- Returns
- This builder for chaining.
Definition at line 1112 of file MPQuadraticConstraint.java.
◆ addCoefficient()
|
inline |
Must be finite.
repeated double coefficient = 2;
- Parameters
-
value The coefficient to add.
- Returns
- This builder for chaining.
Definition at line 1207 of file MPQuadraticConstraint.java.
◆ addQcoefficient()
|
inline |
Must be finite.
repeated double qcoefficient = 5;
- Parameters
-
value The qcoefficient to add.
- Returns
- This builder for chaining.
Definition at line 1542 of file MPQuadraticConstraint.java.
◆ addQvar1Index()
|
inline |
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.
repeated int32 qvar1_index = 3;
- Parameters
-
value The qvar1Index to add.
- Returns
- This builder for chaining.
Definition at line 1344 of file MPQuadraticConstraint.java.
◆ addQvar2Index()
|
inline |
repeated int32 qvar2_index = 4;
- Parameters
-
value The qvar2Index to add.
- Returns
- This builder for chaining.
Definition at line 1443 of file MPQuadraticConstraint.java.
◆ addRepeatedField()
|
inline |
Definition at line 907 of file MPQuadraticConstraint.java.
◆ addVarIndex()
|
inline |
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.
repeated int32 var_index = 1;
- Parameters
-
value The varIndex to add.
- Returns
- This builder for chaining.
Definition at line 1094 of file MPQuadraticConstraint.java.
◆ build()
|
inline |
Definition at line 829 of file MPQuadraticConstraint.java.
◆ buildPartial()
|
inline |
Definition at line 838 of file MPQuadraticConstraint.java.
◆ clear()
|
inline |
Definition at line 798 of file MPQuadraticConstraint.java.
◆ clearCoefficient()
|
inline |
Must be finite.
repeated double coefficient = 2;
- Returns
- This builder for chaining.
Definition at line 1238 of file MPQuadraticConstraint.java.
◆ clearField()
|
inline |
Definition at line 891 of file MPQuadraticConstraint.java.
◆ clearLowerBound()
|
inline |
lower_bound must be <= upper_bound.
optional double lower_bound = 6 [default = -inf];
- Returns
- This builder for chaining.
Definition at line 1628 of file MPQuadraticConstraint.java.
◆ clearOneof()
|
inline |
Definition at line 896 of file MPQuadraticConstraint.java.
◆ clearQcoefficient()
|
inline |
Must be finite.
repeated double qcoefficient = 5;
- Returns
- This builder for chaining.
Definition at line 1573 of file MPQuadraticConstraint.java.
◆ clearQvar1Index()
|
inline |
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.
repeated int32 qvar1_index = 3;
- Returns
- This builder for chaining.
Definition at line 1387 of file MPQuadraticConstraint.java.
◆ clearQvar2Index()
|
inline |
repeated int32 qvar2_index = 4;
- Returns
- This builder for chaining.
Definition at line 1466 of file MPQuadraticConstraint.java.
◆ clearUpperBound()
|
inline |
optional double upper_bound = 7 [default = inf];
- Returns
- This builder for chaining.
Definition at line 1667 of file MPQuadraticConstraint.java.
◆ clearVarIndex()
|
inline |
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.
repeated int32 var_index = 1;
- Returns
- This builder for chaining.
Definition at line 1131 of file MPQuadraticConstraint.java.
◆ clone()
|
inline |
Definition at line 881 of file MPQuadraticConstraint.java.
◆ getCoefficient()
|
inline |
Must be finite.
repeated double coefficient = 2;
- Parameters
-
index The index of the element to return.
- Returns
- The coefficient at the given index.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1178 of file MPQuadraticConstraint.java.
◆ getCoefficientCount()
|
inline |
Must be finite.
repeated double coefficient = 2;
- Returns
- The count of coefficient.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1166 of file MPQuadraticConstraint.java.
◆ getCoefficientList()
|
inline |
Must be finite.
repeated double coefficient = 2;
- Returns
- A list containing the coefficient.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1154 of file MPQuadraticConstraint.java.
◆ getDefaultInstanceForType()
|
inline |
Definition at line 824 of file MPQuadraticConstraint.java.
◆ getDescriptor()
|
inlinestatic |
Definition at line 770 of file MPQuadraticConstraint.java.
◆ getDescriptorForType()
|
inline |
Definition at line 819 of file MPQuadraticConstraint.java.
◆ getLowerBound()
|
inline |
lower_bound must be <= upper_bound.
optional double lower_bound = 6 [default = -inf];
- Returns
- The lowerBound.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1602 of file MPQuadraticConstraint.java.
◆ getQcoefficient()
|
inline |
Must be finite.
repeated double qcoefficient = 5;
- Parameters
-
index The index of the element to return.
- Returns
- The qcoefficient at the given index.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1513 of file MPQuadraticConstraint.java.
◆ getQcoefficientCount()
|
inline |
Must be finite.
repeated double qcoefficient = 5;
- Returns
- The count of qcoefficient.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1501 of file MPQuadraticConstraint.java.
◆ getQcoefficientList()
|
inline |
Must be finite.
repeated double qcoefficient = 5;
- Returns
- A list containing the qcoefficient.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1489 of file MPQuadraticConstraint.java.
◆ getQvar1Index()
|
inline |
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.
repeated int32 qvar1_index = 3;
- Parameters
-
index The index of the element to return.
- Returns
- The qvar1Index at the given index.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1303 of file MPQuadraticConstraint.java.
◆ getQvar1IndexCount()
|
inline |
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.
repeated int32 qvar1_index = 3;
- Returns
- The count of qvar1Index.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1285 of file MPQuadraticConstraint.java.
◆ getQvar1IndexList()
|
inline |
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.
repeated int32 qvar1_index = 3;
- Returns
- A list containing the qvar1Index.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1267 of file MPQuadraticConstraint.java.
◆ getQvar2Index()
|
inline |
repeated int32 qvar2_index = 4;
- Parameters
-
index The index of the element to return.
- Returns
- The qvar2Index at the given index.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1422 of file MPQuadraticConstraint.java.
◆ getQvar2IndexCount()
|
inline |
repeated int32 qvar2_index = 4;
- Returns
- The count of qvar2Index.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1414 of file MPQuadraticConstraint.java.
◆ getQvar2IndexList()
|
inline |
repeated int32 qvar2_index = 4;
- Returns
- A list containing the qvar2Index.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1406 of file MPQuadraticConstraint.java.
◆ getUpperBound()
|
inline |
optional double upper_bound = 7 [default = inf];
- Returns
- The upperBound.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1649 of file MPQuadraticConstraint.java.
◆ getVarIndex()
|
inline |
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.
repeated int32 var_index = 1;
- Parameters
-
index The index of the element to return.
- Returns
- The varIndex at the given index.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1059 of file MPQuadraticConstraint.java.
◆ getVarIndexCount()
|
inline |
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.
repeated int32 var_index = 1;
- Returns
- The count of varIndex.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1044 of file MPQuadraticConstraint.java.
◆ getVarIndexList()
|
inline |
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.
repeated int32 var_index = 1;
- Returns
- A list containing the varIndex.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1029 of file MPQuadraticConstraint.java.
◆ hasLowerBound()
|
inline |
lower_bound must be <= upper_bound.
optional double lower_bound = 6 [default = -inf];
- Returns
- Whether the lowerBound field is set.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1590 of file MPQuadraticConstraint.java.
◆ hasUpperBound()
|
inline |
optional double upper_bound = 7 [default = inf];
- Returns
- Whether the upperBound field is set.
Implements MPQuadraticConstraintOrBuilder.
Definition at line 1641 of file MPQuadraticConstraint.java.
◆ internalGetFieldAccessorTable()
|
inlineprotected |
Definition at line 776 of file MPQuadraticConstraint.java.
◆ isInitialized()
|
inline |
Definition at line 986 of file MPQuadraticConstraint.java.
◆ mergeFrom() [1/3]
|
inline |
Definition at line 922 of file MPQuadraticConstraint.java.
◆ mergeFrom() [2/3]
|
inline |
Definition at line 991 of file MPQuadraticConstraint.java.
◆ mergeFrom() [3/3]
|
inline |
Definition at line 913 of file MPQuadraticConstraint.java.
◆ mergeUnknownFields()
|
inline |
Definition at line 1680 of file MPQuadraticConstraint.java.
◆ setCoefficient()
|
inline |
Must be finite.
repeated double coefficient = 2;
- Parameters
-
index The index to set the value at. value The coefficient to set.
- Returns
- This builder for chaining.
Definition at line 1191 of file MPQuadraticConstraint.java.
◆ setField()
|
inline |
Definition at line 885 of file MPQuadraticConstraint.java.
◆ setLowerBound()
|
inline |
lower_bound must be <= upper_bound.
optional double lower_bound = 6 [default = -inf];
- Parameters
-
value The lowerBound to set.
- Returns
- This builder for chaining.
Definition at line 1614 of file MPQuadraticConstraint.java.
◆ setQcoefficient()
|
inline |
Must be finite.
repeated double qcoefficient = 5;
- Parameters
-
index The index to set the value at. value The qcoefficient to set.
- Returns
- This builder for chaining.
Definition at line 1526 of file MPQuadraticConstraint.java.
◆ setQvar1Index()
|
inline |
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.
repeated int32 qvar1_index = 3;
- Parameters
-
index The index to set the value at. value The qvar1Index to set.
- Returns
- This builder for chaining.
Definition at line 1322 of file MPQuadraticConstraint.java.
◆ setQvar2Index()
|
inline |
repeated int32 qvar2_index = 4;
- Parameters
-
index The index to set the value at. value The qvar2Index to set.
- Returns
- This builder for chaining.
Definition at line 1431 of file MPQuadraticConstraint.java.
◆ setRepeatedField()
|
inline |
Definition at line 901 of file MPQuadraticConstraint.java.
◆ setUnknownFields()
|
inline |
Definition at line 1674 of file MPQuadraticConstraint.java.
◆ setUpperBound()
|
inline |
optional double upper_bound = 7 [default = inf];
- Parameters
-
value The upperBound to set.
- Returns
- This builder for chaining.
Definition at line 1657 of file MPQuadraticConstraint.java.
◆ setVarIndex()
|
inline |
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.
repeated int32 var_index = 1;
- Parameters
-
index The index to set the value at. value The varIndex to set.
- Returns
- This builder for chaining.
Definition at line 1075 of file MPQuadraticConstraint.java.
The documentation for this class was generated from the following file: