Google OR-Tools v9.12
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 ()
 

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

Member Function Documentation

◆ equals()

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

Definition at line 426 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 150 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 138 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 127 of file MPQuadraticConstraint.java.

◆ getDefaultInstance()

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

Definition at line 1631 of file MPQuadraticConstraint.java.

◆ getDefaultInstanceForType()

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

Definition at line 1667 of file MPQuadraticConstraint.java.

◆ getDescriptor()

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

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

◆ getParserForType()

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

Definition at line 1662 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 279 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 267 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 256 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 209 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 191 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 174 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 238 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 230 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 223 of file MPQuadraticConstraint.java.

◆ getSerializedSize()

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

Definition at line 368 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 325 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 109 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 94 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 80 of file MPQuadraticConstraint.java.

◆ hashCode()

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

Definition at line 462 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 294 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 317 of file MPQuadraticConstraint.java.

◆ internalGetFieldAccessorTable()

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

Definition at line 56 of file MPQuadraticConstraint.java.

◆ isInitialized()

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

Definition at line 331 of file MPQuadraticConstraint.java.

◆ newBuilder() [1/2]

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

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

◆ newBuilderForType() [1/2]

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

Definition at line 576 of file MPQuadraticConstraint.java.

◆ newBuilderForType() [2/2]

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

Definition at line 590 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 548 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 554 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 525 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 529 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 514 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 519 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 561 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 567 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 535 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 540 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 503 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 508 of file MPQuadraticConstraint.java.

◆ parser()

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

Definition at line 1657 of file MPQuadraticConstraint.java.

◆ toBuilder()

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

Definition at line 584 of file MPQuadraticConstraint.java.

◆ writeTo()

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

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

◆ LOWER_BOUND_FIELD_NUMBER

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

Definition at line 283 of file MPQuadraticConstraint.java.

◆ QCOEFFICIENT_FIELD_NUMBER

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

Definition at line 242 of file MPQuadraticConstraint.java.

◆ QVAR1_INDEX_FIELD_NUMBER

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

Definition at line 154 of file MPQuadraticConstraint.java.

◆ QVAR2_INDEX_FIELD_NUMBER

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

Definition at line 213 of file MPQuadraticConstraint.java.

◆ UPPER_BOUND_FIELD_NUMBER

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

Definition at line 310 of file MPQuadraticConstraint.java.

◆ VAR_INDEX_FIELD_NUMBER

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

Definition at line 63 of file MPQuadraticConstraint.java.


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