Java Reference

Java Reference

MPQuadraticObjective.Builder

Detailed Description

Quadratic part of a model's objective. Added with other objectives (such as
linear), this creates the model's objective function to be optimized.
Note: the linear part of the objective currently needs to be specified in the
MPVariableProto.objective_coefficient fields. If you'd rather have a
dedicated linear array here, talk to or-core-team@

Protobuf type

operations_research.MPQuadraticObjective

Definition at line 496 of file MPQuadraticObjective.java.

Public Member Functions

.lang.Override Builder clear ()
 
.lang.Override com.google.protobuf.Descriptors.Descriptor getDescriptorForType ()
 
.lang.Override com.google.ortools.linearsolver.MPQuadraticObjective getDefaultInstanceForType ()
 
.lang.Override com.google.ortools.linearsolver.MPQuadraticObjective build ()
 
.lang.Override com.google.ortools.linearsolver.MPQuadraticObjective 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.MPQuadraticObjective 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 > 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 = 2; More...
 
int getQvar2IndexCount ()
 repeated int32 qvar2_index = 2; More...
 
int getQvar2Index (int index)
 repeated int32 qvar2_index = 2; More...
 
Builder setQvar2Index (int index, int value)
 repeated int32 qvar2_index = 2; More...
 
Builder addQvar2Index (int value)
 repeated int32 qvar2_index = 2; More...
 
Builder addAllQvar2Index (java.lang.Iterable<? extends java.lang.Integer > values)
 repeated int32 qvar2_index = 2; More...
 
Builder clearQvar2Index ()
 repeated int32 qvar2_index = 2; More...
 
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 ()
 
.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()

Builder addAllCoefficient ( java.lang.Iterable<? extends java.lang.Double >  values)
inline
Must be finite.

repeated double coefficient = 3;

Parameters
valuesThe coefficient to add.
Returns
This builder for chaining.

Definition at line 999 of file MPQuadraticObjective.java.

◆ addAllQvar1Index()

Builder addAllQvar1Index ( java.lang.Iterable<? extends java.lang.Integer >  values)
inline
Sparse representation of quadratic terms in the objective function, where
term i is qvar1_index[i] * qvar2_index[i] * coefficient[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 = 1;

Parameters
valuesThe qvar1Index to add.
Returns
This builder for chaining.

Definition at line 807 of file MPQuadraticObjective.java.

◆ addAllQvar2Index()

Builder addAllQvar2Index ( java.lang.Iterable<? extends java.lang.Integer >  values)
inline

repeated int32 qvar2_index = 2;

Parameters
valuesThe qvar2Index to add.
Returns
This builder for chaining.

Definition at line 896 of file MPQuadraticObjective.java.

◆ addCoefficient()

Builder addCoefficient ( double  value)
inline
Must be finite.

repeated double coefficient = 3;

Parameters
valueThe coefficient to add.
Returns
This builder for chaining.

Definition at line 984 of file MPQuadraticObjective.java.

◆ addQvar1Index()

Builder addQvar1Index ( int  value)
inline
Sparse representation of quadratic terms in the objective function, where
term i is qvar1_index[i] * qvar2_index[i] * coefficient[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 = 1;

Parameters
valueThe qvar1Index to add.
Returns
This builder for chaining.

Definition at line 786 of file MPQuadraticObjective.java.

◆ addQvar2Index()

Builder addQvar2Index ( int  value)
inline

repeated int32 qvar2_index = 2;

Parameters
valueThe qvar2Index to add.
Returns
This builder for chaining.

Definition at line 885 of file MPQuadraticObjective.java.

◆ addRepeatedField()

.lang.Override Builder addRepeatedField ( com.google.protobuf.Descriptors.FieldDescriptor  field,
java.lang.Object  value 
)
inline

Definition at line 610 of file MPQuadraticObjective.java.

◆ build()

Definition at line 552 of file MPQuadraticObjective.java.

◆ buildPartial()

.lang.Override com.google.ortools.linearsolver.MPQuadraticObjective buildPartial ( )
inline

Definition at line 561 of file MPQuadraticObjective.java.

◆ clear()

.lang.Override Builder clear ( )
inline

Definition at line 529 of file MPQuadraticObjective.java.

◆ clearCoefficient()

Builder clearCoefficient ( )
inline
Must be finite.

repeated double coefficient = 3;

Returns
This builder for chaining.

Definition at line 1015 of file MPQuadraticObjective.java.

◆ clearField()

.lang.Override Builder clearField ( com.google.protobuf.Descriptors.FieldDescriptor  field)
inline

Definition at line 594 of file MPQuadraticObjective.java.

◆ clearOneof()

.lang.Override Builder clearOneof ( com.google.protobuf.Descriptors.OneofDescriptor  oneof)
inline

Definition at line 599 of file MPQuadraticObjective.java.

◆ clearQvar1Index()

Builder clearQvar1Index ( )
inline
Sparse representation of quadratic terms in the objective function, where
term i is qvar1_index[i] * qvar2_index[i] * coefficient[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 = 1;

Returns
This builder for chaining.

Definition at line 829 of file MPQuadraticObjective.java.

◆ clearQvar2Index()

Builder clearQvar2Index ( )
inline

repeated int32 qvar2_index = 2;

Returns
This builder for chaining.

Definition at line 908 of file MPQuadraticObjective.java.

◆ clone()

.lang.Override Builder clone ( )
inline

Definition at line 584 of file MPQuadraticObjective.java.

◆ getCoefficient()

double getCoefficient ( int  index)
inline
Must be finite.

repeated double coefficient = 3;

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

Implements MPQuadraticObjectiveOrBuilder.

Definition at line 955 of file MPQuadraticObjective.java.

◆ getCoefficientCount()

int getCoefficientCount ( )
inline
Must be finite.

repeated double coefficient = 3;

Returns
The count of coefficient.

Implements MPQuadraticObjectiveOrBuilder.

Definition at line 943 of file MPQuadraticObjective.java.

◆ getCoefficientList()

java.util.List<java.lang.Double> getCoefficientList ( )
inline
Must be finite.

repeated double coefficient = 3;

Returns
A list containing the coefficient.

Implements MPQuadraticObjectiveOrBuilder.

Definition at line 931 of file MPQuadraticObjective.java.

◆ getDefaultInstanceForType()

.lang.Override com.google.ortools.linearsolver.MPQuadraticObjective getDefaultInstanceForType ( )
inline

Definition at line 547 of file MPQuadraticObjective.java.

◆ getDescriptor()

static final com.google.protobuf.Descriptors.Descriptor getDescriptor ( )
inlinestatic

Definition at line 501 of file MPQuadraticObjective.java.

◆ getDescriptorForType()

.lang.Override com.google.protobuf.Descriptors.Descriptor getDescriptorForType ( )
inline

Definition at line 542 of file MPQuadraticObjective.java.

◆ getQvar1Index()

int getQvar1Index ( int  index)
inline
Sparse representation of quadratic terms in the objective function, where
term i is qvar1_index[i] * qvar2_index[i] * coefficient[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 = 1;

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

Implements MPQuadraticObjectiveOrBuilder.

Definition at line 745 of file MPQuadraticObjective.java.

◆ getQvar1IndexCount()

int getQvar1IndexCount ( )
inline
Sparse representation of quadratic terms in the objective function, where
term i is qvar1_index[i] * qvar2_index[i] * coefficient[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 = 1;

Returns
The count of qvar1Index.

Implements MPQuadraticObjectiveOrBuilder.

Definition at line 727 of file MPQuadraticObjective.java.

◆ getQvar1IndexList()

java.util.List<java.lang.Integer> getQvar1IndexList ( )
inline
Sparse representation of quadratic terms in the objective function, where
term i is qvar1_index[i] * qvar2_index[i] * coefficient[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 = 1;

Returns
A list containing the qvar1Index.

Implements MPQuadraticObjectiveOrBuilder.

Definition at line 709 of file MPQuadraticObjective.java.

◆ getQvar2Index()

int getQvar2Index ( int  index)
inline

repeated int32 qvar2_index = 2;

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

Implements MPQuadraticObjectiveOrBuilder.

Definition at line 864 of file MPQuadraticObjective.java.

◆ getQvar2IndexCount()

int getQvar2IndexCount ( )
inline

repeated int32 qvar2_index = 2;

Returns
The count of qvar2Index.

Implements MPQuadraticObjectiveOrBuilder.

Definition at line 856 of file MPQuadraticObjective.java.

◆ getQvar2IndexList()

java.util.List<java.lang.Integer> getQvar2IndexList ( )
inline

repeated int32 qvar2_index = 2;

Returns
A list containing the qvar2Index.

Implements MPQuadraticObjectiveOrBuilder.

Definition at line 848 of file MPQuadraticObjective.java.

◆ internalGetFieldAccessorTable()

.lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable ( )
inlineprotected

Definition at line 507 of file MPQuadraticObjective.java.

◆ isInitialized()

.lang.Override final boolean isInitialized ( )
inline

Definition at line 663 of file MPQuadraticObjective.java.

◆ mergeFrom() [1/3]

Definition at line 625 of file MPQuadraticObjective.java.

◆ mergeFrom() [2/3]

.lang.Override Builder mergeFrom ( com.google.protobuf.CodedInputStream  input,
com.google.protobuf.ExtensionRegistryLite  extensionRegistry 
) throws java.io.IOException
inline

Definition at line 668 of file MPQuadraticObjective.java.

◆ mergeFrom() [3/3]

.lang.Override Builder mergeFrom ( com.google.protobuf.Message  other)
inline

Definition at line 616 of file MPQuadraticObjective.java.

◆ mergeUnknownFields()

.lang.Override final Builder mergeUnknownFields ( final com.google.protobuf.UnknownFieldSet  unknownFields)
inline

Definition at line 1028 of file MPQuadraticObjective.java.

◆ setCoefficient()

Builder setCoefficient ( int  index,
double  value 
)
inline
Must be finite.

repeated double coefficient = 3;

Parameters
indexThe index to set the value at.
valueThe coefficient to set.
Returns
This builder for chaining.

Definition at line 968 of file MPQuadraticObjective.java.

◆ setField()

.lang.Override Builder setField ( com.google.protobuf.Descriptors.FieldDescriptor  field,
java.lang.Object  value 
)
inline

Definition at line 588 of file MPQuadraticObjective.java.

◆ setQvar1Index()

Builder setQvar1Index ( int  index,
int  value 
)
inline
Sparse representation of quadratic terms in the objective function, where
term i is qvar1_index[i] * qvar2_index[i] * coefficient[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 = 1;

Parameters
indexThe index to set the value at.
valueThe qvar1Index to set.
Returns
This builder for chaining.

Definition at line 764 of file MPQuadraticObjective.java.

◆ setQvar2Index()

Builder setQvar2Index ( int  index,
int  value 
)
inline

repeated int32 qvar2_index = 2;

Parameters
indexThe index to set the value at.
valueThe qvar2Index to set.
Returns
This builder for chaining.

Definition at line 873 of file MPQuadraticObjective.java.

◆ setRepeatedField()

.lang.Override Builder setRepeatedField ( com.google.protobuf.Descriptors.FieldDescriptor  field,
int  index,
java.lang.Object  value 
)
inline

Definition at line 604 of file MPQuadraticObjective.java.

◆ setUnknownFields()

.lang.Override final Builder setUnknownFields ( final com.google.protobuf.UnknownFieldSet  unknownFields)
inline

Definition at line 1022 of file MPQuadraticObjective.java.


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