Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.linearsolver.MPQuadraticConstraint Class 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/9.0/refman/constraints.html#subsubsection:QuadraticConstraints

Protobuf type operations_research.MPQuadraticConstraint

Definition at line 22 of file MPQuadraticConstraint.java.

Inheritance diagram for com.google.ortools.linearsolver.MPQuadraticConstraint:
com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder

Classes

class  Builder

Public Member Functions

java.util.List< java.lang.Integer > getVarIndexList ()
int getVarIndexCount ()
int getVarIndex (int index)
java.util.List< java.lang.Double > getCoefficientList ()
int getCoefficientCount ()
double getCoefficient (int index)
java.util.List< java.lang.Integer > getQvar1IndexList ()
int getQvar1IndexCount ()
int getQvar1Index (int index)
java.util.List< java.lang.Integer > getQvar2IndexList ()
int getQvar2IndexCount ()
int getQvar2Index (int index)
java.util.List< java.lang.Double > getQcoefficientList ()
int getQcoefficientCount ()
double getQcoefficient (int index)
boolean hasLowerBound ()
double getLowerBound ()
boolean hasUpperBound ()
double getUpperBound ()
final boolean isInitialized ()
void writeTo (com.google.protobuf.CodedOutputStream output) throws java.io.IOException
int getSerializedSize ()
boolean equals (final java.lang.Object obj)
int hashCode ()
Builder newBuilderForType ()
Builder toBuilder ()
com.google.protobuf.Parser< MPQuadraticConstraintgetParserForType ()
com.google.ortools.linearsolver.MPQuadraticConstraint getDefaultInstanceForType ()

Static Public Member Functions

static final com.google.protobuf.Descriptors.Descriptor getDescriptor ()
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom (java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom (java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom (com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom (com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom (byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom (byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom (java.io.InputStream input) throws java.io.IOException
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom (java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
static com.google.ortools.linearsolver.MPQuadraticConstraint parseDelimitedFrom (java.io.InputStream input) throws java.io.IOException
static com.google.ortools.linearsolver.MPQuadraticConstraint parseDelimitedFrom (java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom (com.google.protobuf.CodedInputStream input) throws java.io.IOException
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom (com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
static Builder newBuilder ()
static Builder newBuilder (com.google.ortools.linearsolver.MPQuadraticConstraint prototype)
static com.google.ortools.linearsolver.MPQuadraticConstraint getDefaultInstance ()
static com.google.protobuf.Parser< MPQuadraticConstraintparser ()

Static Public Attributes

static final int VAR_INDEX_FIELD_NUMBER = 1
static final int COEFFICIENT_FIELD_NUMBER = 2
static final int QVAR1_INDEX_FIELD_NUMBER = 3
static final int QVAR2_INDEX_FIELD_NUMBER = 4
static final int QCOEFFICIENT_FIELD_NUMBER = 5
static final int LOWER_BOUND_FIELD_NUMBER = 6
static final int UPPER_BOUND_FIELD_NUMBER = 7

Protected Member Functions

com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable ()
Builder newBuilderForType (com.google.protobuf.GeneratedMessage.BuilderParent parent)

Member Function Documentation

◆ equals()

boolean com.google.ortools.linearsolver.MPQuadraticConstraint.equals ( final java.lang.Object obj)

Definition at line 427 of file MPQuadraticConstraint.java.

◆ getCoefficient()

double com.google.ortools.linearsolver.MPQuadraticConstraint.getCoefficient ( int index)
Must be finite.

repeated double coefficient = 2;

Parameters
indexThe index of the element to return.
Returns
The coefficient at the given index.

Implements com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 151 of file MPQuadraticConstraint.java.

◆ getCoefficientCount()

int com.google.ortools.linearsolver.MPQuadraticConstraint.getCoefficientCount ( )
Must be finite.

repeated double coefficient = 2;

Returns
The count of coefficient.

Implements com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 139 of file MPQuadraticConstraint.java.

◆ getCoefficientList()

java.util.List< java.lang.Double > com.google.ortools.linearsolver.MPQuadraticConstraint.getCoefficientList ( )
Must be finite.

repeated double coefficient = 2;

Returns
A list containing the coefficient.

Implements com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 128 of file MPQuadraticConstraint.java.

◆ getDefaultInstance()

com.google.ortools.linearsolver.MPQuadraticConstraint com.google.ortools.linearsolver.MPQuadraticConstraint.getDefaultInstance ( )
static

Definition at line 1632 of file MPQuadraticConstraint.java.

◆ getDefaultInstanceForType()

com.google.ortools.linearsolver.MPQuadraticConstraint com.google.ortools.linearsolver.MPQuadraticConstraint.getDefaultInstanceForType ( )

Definition at line 1668 of file MPQuadraticConstraint.java.

◆ getDescriptor()

final com.google.protobuf.Descriptors.Descriptor com.google.ortools.linearsolver.MPQuadraticConstraint.getDescriptor ( )
static

Definition at line 51 of file MPQuadraticConstraint.java.

◆ getLowerBound()

double com.google.ortools.linearsolver.MPQuadraticConstraint.getLowerBound ( )
lower_bound must be <= upper_bound.

optional double lower_bound = 6 [default = -inf];

Returns
The lowerBound.

Implements com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 307 of file MPQuadraticConstraint.java.

◆ getParserForType()

com.google.protobuf.Parser< MPQuadraticConstraint > com.google.ortools.linearsolver.MPQuadraticConstraint.getParserForType ( )

Definition at line 1663 of file MPQuadraticConstraint.java.

◆ getQcoefficient()

double com.google.ortools.linearsolver.MPQuadraticConstraint.getQcoefficient ( int index)
Must be finite.

repeated double qcoefficient = 5;

Parameters
indexThe index of the element to return.
Returns
The qcoefficient at the given index.

Implements com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 280 of file MPQuadraticConstraint.java.

◆ getQcoefficientCount()

int com.google.ortools.linearsolver.MPQuadraticConstraint.getQcoefficientCount ( )
Must be finite.

repeated double qcoefficient = 5;

Returns
The count of qcoefficient.

Implements com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 268 of file MPQuadraticConstraint.java.

◆ getQcoefficientList()

java.util.List< java.lang.Double > com.google.ortools.linearsolver.MPQuadraticConstraint.getQcoefficientList ( )
Must be finite.

repeated double qcoefficient = 5;

Returns
A list containing the qcoefficient.

Implements com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 257 of file MPQuadraticConstraint.java.

◆ getQvar1Index()

int com.google.ortools.linearsolver.MPQuadraticConstraint.getQvar1Index ( int index)
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
indexThe index of the element to return.
Returns
The qvar1Index at the given index.

Implements com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 210 of file MPQuadraticConstraint.java.

◆ getQvar1IndexCount()

int com.google.ortools.linearsolver.MPQuadraticConstraint.getQvar1IndexCount ( )
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 com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 192 of file MPQuadraticConstraint.java.

◆ getQvar1IndexList()

java.util.List< java.lang.Integer > com.google.ortools.linearsolver.MPQuadraticConstraint.getQvar1IndexList ( )
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 com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 175 of file MPQuadraticConstraint.java.

◆ getQvar2Index()

int com.google.ortools.linearsolver.MPQuadraticConstraint.getQvar2Index ( int index)

repeated int32 qvar2_index = 4;

Parameters
indexThe index of the element to return.
Returns
The qvar2Index at the given index.

Implements com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 239 of file MPQuadraticConstraint.java.

◆ getQvar2IndexCount()

int com.google.ortools.linearsolver.MPQuadraticConstraint.getQvar2IndexCount ( )

repeated int32 qvar2_index = 4;

Returns
The count of qvar2Index.

Implements com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 231 of file MPQuadraticConstraint.java.

◆ getQvar2IndexList()

java.util.List< java.lang.Integer > com.google.ortools.linearsolver.MPQuadraticConstraint.getQvar2IndexList ( )

repeated int32 qvar2_index = 4;

Returns
A list containing the qvar2Index.

Implements com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 224 of file MPQuadraticConstraint.java.

◆ getSerializedSize()

int com.google.ortools.linearsolver.MPQuadraticConstraint.getSerializedSize ( )

Definition at line 369 of file MPQuadraticConstraint.java.

◆ getUpperBound()

double com.google.ortools.linearsolver.MPQuadraticConstraint.getUpperBound ( )

optional double upper_bound = 7 [default = inf];

Returns
The upperBound.

Implements com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 326 of file MPQuadraticConstraint.java.

◆ getVarIndex()

int com.google.ortools.linearsolver.MPQuadraticConstraint.getVarIndex ( int index)
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
indexThe index of the element to return.
Returns
The varIndex at the given index.

Implements com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 110 of file MPQuadraticConstraint.java.

◆ getVarIndexCount()

int com.google.ortools.linearsolver.MPQuadraticConstraint.getVarIndexCount ( )
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 com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 95 of file MPQuadraticConstraint.java.

◆ getVarIndexList()

java.util.List< java.lang.Integer > com.google.ortools.linearsolver.MPQuadraticConstraint.getVarIndexList ( )
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 com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 81 of file MPQuadraticConstraint.java.

◆ hashCode()

int com.google.ortools.linearsolver.MPQuadraticConstraint.hashCode ( )

Definition at line 463 of file MPQuadraticConstraint.java.

◆ hasLowerBound()

boolean com.google.ortools.linearsolver.MPQuadraticConstraint.hasLowerBound ( )
lower_bound must be <= upper_bound.

optional double lower_bound = 6 [default = -inf];

Returns
Whether the lowerBound field is set.

Implements com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 295 of file MPQuadraticConstraint.java.

◆ hasUpperBound()

boolean com.google.ortools.linearsolver.MPQuadraticConstraint.hasUpperBound ( )

optional double upper_bound = 7 [default = inf];

Returns
Whether the upperBound field is set.

Implements com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder.

Definition at line 318 of file MPQuadraticConstraint.java.

◆ internalGetFieldAccessorTable()

com.google.protobuf.GeneratedMessage.FieldAccessorTable com.google.ortools.linearsolver.MPQuadraticConstraint.internalGetFieldAccessorTable ( )
protected

Definition at line 57 of file MPQuadraticConstraint.java.

◆ isInitialized()

final boolean com.google.ortools.linearsolver.MPQuadraticConstraint.isInitialized ( )

Definition at line 332 of file MPQuadraticConstraint.java.

◆ newBuilder() [1/2]

Builder com.google.ortools.linearsolver.MPQuadraticConstraint.newBuilder ( )
static

Definition at line 578 of file MPQuadraticConstraint.java.

◆ newBuilder() [2/2]

Builder com.google.ortools.linearsolver.MPQuadraticConstraint.newBuilder ( com.google.ortools.linearsolver.MPQuadraticConstraint prototype)
static

Definition at line 581 of file MPQuadraticConstraint.java.

◆ newBuilderForType() [1/2]

Builder com.google.ortools.linearsolver.MPQuadraticConstraint.newBuilderForType ( )

Definition at line 577 of file MPQuadraticConstraint.java.

◆ newBuilderForType() [2/2]

Builder com.google.ortools.linearsolver.MPQuadraticConstraint.newBuilderForType ( com.google.protobuf.GeneratedMessage.BuilderParent parent)
protected

Definition at line 591 of file MPQuadraticConstraint.java.

◆ parseDelimitedFrom() [1/2]

com.google.ortools.linearsolver.MPQuadraticConstraint com.google.ortools.linearsolver.MPQuadraticConstraint.parseDelimitedFrom ( java.io.InputStream input) throws java.io.IOException
static

Definition at line 549 of file MPQuadraticConstraint.java.

◆ parseDelimitedFrom() [2/2]

com.google.ortools.linearsolver.MPQuadraticConstraint com.google.ortools.linearsolver.MPQuadraticConstraint.parseDelimitedFrom ( java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws java.io.IOException
static

Definition at line 555 of file MPQuadraticConstraint.java.

◆ parseFrom() [1/10]

com.google.ortools.linearsolver.MPQuadraticConstraint com.google.ortools.linearsolver.MPQuadraticConstraint.parseFrom ( byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 526 of file MPQuadraticConstraint.java.

◆ parseFrom() [2/10]

com.google.ortools.linearsolver.MPQuadraticConstraint com.google.ortools.linearsolver.MPQuadraticConstraint.parseFrom ( byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 530 of file MPQuadraticConstraint.java.

◆ parseFrom() [3/10]

com.google.ortools.linearsolver.MPQuadraticConstraint com.google.ortools.linearsolver.MPQuadraticConstraint.parseFrom ( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 515 of file MPQuadraticConstraint.java.

◆ parseFrom() [4/10]

com.google.ortools.linearsolver.MPQuadraticConstraint com.google.ortools.linearsolver.MPQuadraticConstraint.parseFrom ( com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 520 of file MPQuadraticConstraint.java.

◆ parseFrom() [5/10]

com.google.ortools.linearsolver.MPQuadraticConstraint com.google.ortools.linearsolver.MPQuadraticConstraint.parseFrom ( com.google.protobuf.CodedInputStream input) throws java.io.IOException
static

Definition at line 562 of file MPQuadraticConstraint.java.

◆ parseFrom() [6/10]

com.google.ortools.linearsolver.MPQuadraticConstraint com.google.ortools.linearsolver.MPQuadraticConstraint.parseFrom ( com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws java.io.IOException
static

Definition at line 568 of file MPQuadraticConstraint.java.

◆ parseFrom() [7/10]

com.google.ortools.linearsolver.MPQuadraticConstraint com.google.ortools.linearsolver.MPQuadraticConstraint.parseFrom ( java.io.InputStream input) throws java.io.IOException
static

Definition at line 536 of file MPQuadraticConstraint.java.

◆ parseFrom() [8/10]

com.google.ortools.linearsolver.MPQuadraticConstraint com.google.ortools.linearsolver.MPQuadraticConstraint.parseFrom ( java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws java.io.IOException
static

Definition at line 541 of file MPQuadraticConstraint.java.

◆ parseFrom() [9/10]

com.google.ortools.linearsolver.MPQuadraticConstraint com.google.ortools.linearsolver.MPQuadraticConstraint.parseFrom ( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 504 of file MPQuadraticConstraint.java.

◆ parseFrom() [10/10]

com.google.ortools.linearsolver.MPQuadraticConstraint com.google.ortools.linearsolver.MPQuadraticConstraint.parseFrom ( java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 509 of file MPQuadraticConstraint.java.

◆ parser()

com.google.protobuf.Parser< MPQuadraticConstraint > com.google.ortools.linearsolver.MPQuadraticConstraint.parser ( )
static

Definition at line 1658 of file MPQuadraticConstraint.java.

◆ toBuilder()

Builder com.google.ortools.linearsolver.MPQuadraticConstraint.toBuilder ( )

Definition at line 585 of file MPQuadraticConstraint.java.

◆ writeTo()

void com.google.ortools.linearsolver.MPQuadraticConstraint.writeTo ( com.google.protobuf.CodedOutputStream output) throws java.io.IOException

Definition at line 342 of file MPQuadraticConstraint.java.

Member Data Documentation

◆ COEFFICIENT_FIELD_NUMBER

final int com.google.ortools.linearsolver.MPQuadraticConstraint.COEFFICIENT_FIELD_NUMBER = 2
static

Definition at line 114 of file MPQuadraticConstraint.java.

◆ LOWER_BOUND_FIELD_NUMBER

final int com.google.ortools.linearsolver.MPQuadraticConstraint.LOWER_BOUND_FIELD_NUMBER = 6
static

Definition at line 284 of file MPQuadraticConstraint.java.

◆ QCOEFFICIENT_FIELD_NUMBER

final int com.google.ortools.linearsolver.MPQuadraticConstraint.QCOEFFICIENT_FIELD_NUMBER = 5
static

Definition at line 243 of file MPQuadraticConstraint.java.

◆ QVAR1_INDEX_FIELD_NUMBER

final int com.google.ortools.linearsolver.MPQuadraticConstraint.QVAR1_INDEX_FIELD_NUMBER = 3
static

Definition at line 155 of file MPQuadraticConstraint.java.

◆ QVAR2_INDEX_FIELD_NUMBER

final int com.google.ortools.linearsolver.MPQuadraticConstraint.QVAR2_INDEX_FIELD_NUMBER = 4
static

Definition at line 214 of file MPQuadraticConstraint.java.

◆ UPPER_BOUND_FIELD_NUMBER

final int com.google.ortools.linearsolver.MPQuadraticConstraint.UPPER_BOUND_FIELD_NUMBER = 7
static

Definition at line 311 of file MPQuadraticConstraint.java.

◆ VAR_INDEX_FIELD_NUMBER

final int com.google.ortools.linearsolver.MPQuadraticConstraint.VAR_INDEX_FIELD_NUMBER = 1
static

Definition at line 64 of file MPQuadraticConstraint.java.


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