Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.linearsolver.MPQuadraticConstraint Class Reference
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 ()
 
- Public Member Functions inherited from com.google.ortools.linearsolver.MPQuadraticConstraintOrBuilder

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)
 

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 20 of file MPQuadraticConstraint.java.

Member Function Documentation

◆ equals()

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

Definition at line 425 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 149 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 137 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 126 of file MPQuadraticConstraint.java.

◆ getDefaultInstance()

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

Definition at line 1630 of file MPQuadraticConstraint.java.

◆ getDefaultInstanceForType()

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

Definition at line 1666 of file MPQuadraticConstraint.java.

◆ getDescriptor()

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

Definition at line 49 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 305 of file MPQuadraticConstraint.java.

◆ getParserForType()

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

Definition at line 1661 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 278 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 266 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 255 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 208 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 190 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 173 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 237 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 229 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 222 of file MPQuadraticConstraint.java.

◆ getSerializedSize()

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

Definition at line 367 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 324 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 108 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 93 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 79 of file MPQuadraticConstraint.java.

◆ hashCode()

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

Definition at line 461 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 293 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 316 of file MPQuadraticConstraint.java.

◆ internalGetFieldAccessorTable()

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

Definition at line 55 of file MPQuadraticConstraint.java.

◆ isInitialized()

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

Definition at line 330 of file MPQuadraticConstraint.java.

◆ newBuilder() [1/2]

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

Definition at line 576 of file MPQuadraticConstraint.java.

◆ newBuilder() [2/2]

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

Definition at line 579 of file MPQuadraticConstraint.java.

◆ newBuilderForType() [1/2]

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

Definition at line 575 of file MPQuadraticConstraint.java.

◆ newBuilderForType() [2/2]

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

Definition at line 589 of file MPQuadraticConstraint.java.

◆ parseDelimitedFrom() [1/2]

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

Definition at line 547 of file MPQuadraticConstraint.java.

◆ parseDelimitedFrom() [2/2]

static 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 553 of file MPQuadraticConstraint.java.

◆ parseFrom() [1/10]

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

Definition at line 524 of file MPQuadraticConstraint.java.

◆ parseFrom() [2/10]

static 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 528 of file MPQuadraticConstraint.java.

◆ parseFrom() [3/10]

static 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 513 of file MPQuadraticConstraint.java.

◆ parseFrom() [4/10]

static 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 518 of file MPQuadraticConstraint.java.

◆ parseFrom() [5/10]

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

Definition at line 560 of file MPQuadraticConstraint.java.

◆ parseFrom() [6/10]

static 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 566 of file MPQuadraticConstraint.java.

◆ parseFrom() [7/10]

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

Definition at line 534 of file MPQuadraticConstraint.java.

◆ parseFrom() [8/10]

static 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 539 of file MPQuadraticConstraint.java.

◆ parseFrom() [9/10]

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

Definition at line 502 of file MPQuadraticConstraint.java.

◆ parseFrom() [10/10]

static 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 507 of file MPQuadraticConstraint.java.

◆ parser()

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

Definition at line 1656 of file MPQuadraticConstraint.java.

◆ toBuilder()

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

Definition at line 583 of file MPQuadraticConstraint.java.

◆ writeTo()

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

Definition at line 340 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 112 of file MPQuadraticConstraint.java.

◆ LOWER_BOUND_FIELD_NUMBER

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

Definition at line 282 of file MPQuadraticConstraint.java.

◆ QCOEFFICIENT_FIELD_NUMBER

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

Definition at line 241 of file MPQuadraticConstraint.java.

◆ QVAR1_INDEX_FIELD_NUMBER

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

Definition at line 153 of file MPQuadraticConstraint.java.

◆ QVAR2_INDEX_FIELD_NUMBER

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

Definition at line 212 of file MPQuadraticConstraint.java.

◆ UPPER_BOUND_FIELD_NUMBER

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

Definition at line 309 of file MPQuadraticConstraint.java.

◆ VAR_INDEX_FIELD_NUMBER

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

Definition at line 62 of file MPQuadraticConstraint.java.


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