Interface CpObjectiveProtoOrBuilder
- All Superinterfaces:
com.google.protobuf.MessageLiteOrBuilder
,com.google.protobuf.MessageOrBuilder
- All Known Implementing Classes:
CpObjectiveProto
,CpObjectiveProto.Builder
@Generated
public interface CpObjectiveProtoOrBuilder
extends com.google.protobuf.MessageOrBuilder
-
Method Summary
Modifier and TypeMethodDescriptionlong
getCoeffs
(int index) repeated int64 coeffs = 4;
int
repeated int64 coeffs = 4;
repeated int64 coeffs = 4;
long
getDomain
(int index) If non-empty, only look for an objective value in the given domain.int
If non-empty, only look for an objective value in the given domain.If non-empty, only look for an objective value in the given domain.long
int64 integer_after_offset = 9;
long
Internal fields to recover a bound on the original integer objective from the presolved one.long
int64 integer_scaling_factor = 8;
double
The displayed objective is always: scaling_factor * (sum(coefficients[i] * objective_vars[i]) + offset).double
double scaling_factor = 3;
boolean
Internal field.int
getVars
(int index) The linear terms of the objective to minimize.int
The linear terms of the objective to minimize.The linear terms of the objective to minimize.Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder
isInitialized
Methods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getVarsList
-
getVarsCount
int getVarsCount()The linear terms of the objective to minimize. For a maximization problem, one can negate all coefficients in the objective and set scaling_factor to -1.
repeated int32 vars = 1;
- Returns:
- The count of vars.
-
getVars
int getVars(int index) The linear terms of the objective to minimize. For a maximization problem, one can negate all coefficients in the objective and set scaling_factor to -1.
repeated int32 vars = 1;
- Parameters:
index
- The index of the element to return.- Returns:
- The vars at the given index.
-
getCoeffsList
-
getCoeffsCount
int getCoeffsCount()repeated int64 coeffs = 4;
- Returns:
- The count of coeffs.
-
getCoeffs
long getCoeffs(int index) repeated int64 coeffs = 4;
- Parameters:
index
- The index of the element to return.- Returns:
- The coeffs at the given index.
-
getOffset
double getOffset()The displayed objective is always: scaling_factor * (sum(coefficients[i] * objective_vars[i]) + offset). This is needed to have a consistent objective after presolve or when scaling a double problem to express it with integers. Note that if scaling_factor is zero, then it is assumed to be 1, so that by default these fields have no effect.
double offset = 2;
- Returns:
- The offset.
-
getScalingFactor
double getScalingFactor()double scaling_factor = 3;
- Returns:
- The scalingFactor.
-
getDomainList
-
getDomainCount
int getDomainCount()If non-empty, only look for an objective value in the given domain. Note that this does not depend on the offset or scaling factor, it is a domain on the sum of the objective terms only.
repeated int64 domain = 5;
- Returns:
- The count of domain.
-
getDomain
long getDomain(int index) If non-empty, only look for an objective value in the given domain. Note that this does not depend on the offset or scaling factor, it is a domain on the sum of the objective terms only.
repeated int64 domain = 5;
- Parameters:
index
- The index of the element to return.- Returns:
- The domain at the given index.
-
getScalingWasExact
boolean getScalingWasExact()Internal field. Do not set. When we scale a FloatObjectiveProto to a integer version, we set this to true if the scaling was exact (i.e. all original coeff were integer for instance). TODO(user): Put the error bounds we computed instead?
bool scaling_was_exact = 6;
- Returns:
- The scalingWasExact.
-
getIntegerBeforeOffset
long getIntegerBeforeOffset()Internal fields to recover a bound on the original integer objective from the presolved one. Basically, initially the integer objective fit on an int64 and is in [Initial_lb, Initial_ub]. During presolve, we might change the linear expression to have a new domain [Presolved_lb, Presolved_ub] that will also always fit on an int64. The two domain will always be linked with an affine transformation between the two of the form: old = (new + before_offset) * integer_scaling_factor + after_offset. Note that we use both offsets to always be able to do the computation while staying in the int64 domain. In particular, the after_offset will always be in (-integer_scaling_factor, integer_scaling_factor).
int64 integer_before_offset = 7;
- Returns:
- The integerBeforeOffset.
-
getIntegerAfterOffset
long getIntegerAfterOffset()int64 integer_after_offset = 9;
- Returns:
- The integerAfterOffset.
-
getIntegerScalingFactor
long getIntegerScalingFactor()int64 integer_scaling_factor = 8;
- Returns:
- The integerScalingFactor.
-