Package com.google.ortools.sat
Interface CpObjectiveProtoOrBuilder
-
- All Superinterfaces:
com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder
- All Known Implementing Classes:
CpObjectiveProto,CpObjectiveProto.Builder
public interface CpObjectiveProtoOrBuilder extends com.google.protobuf.MessageOrBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetCoeffs(int index)repeated int64 coeffs = 4;intgetCoeffsCount()repeated int64 coeffs = 4;java.util.List<java.lang.Long>getCoeffsList()repeated int64 coeffs = 4;longgetDomain(int index)If non-empty, only look for an objective value in the given domain.intgetDomainCount()If non-empty, only look for an objective value in the given domain.java.util.List<java.lang.Long>getDomainList()If non-empty, only look for an objective value in the given domain.longgetIntegerAfterOffset()int64 integer_after_offset = 9;longgetIntegerBeforeOffset()Internal fields to recover a bound on the original integer objective from the presolved one.longgetIntegerScalingFactor()int64 integer_scaling_factor = 8;doublegetOffset()The displayed objective is always: scaling_factor * (sum(coefficients[i] * objective_vars[i]) + offset).doublegetScalingFactor()double scaling_factor = 3;booleangetScalingWasExact()Internal field.intgetVars(int index)The linear terms of the objective to minimize.intgetVarsCount()The linear terms of the objective to minimize.java.util.List<java.lang.Integer>getVarsList()The linear terms of the objective to minimize.-
Methods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
-
-
-
Method Detail
-
getVarsList
java.util.List<java.lang.Integer> getVarsList()
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:
- A list containing the vars.
-
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
java.util.List<java.lang.Long> getCoeffsList()
repeated int64 coeffs = 4;- Returns:
- A list containing the coeffs.
-
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
java.util.List<java.lang.Long> getDomainList()
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:
- A list containing the domain.
-
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.
-
-