public static final class CpObjectiveProto.Builder extends com.google.protobuf.GeneratedMessage.Builder<CpObjectiveProto.Builder> implements CpObjectiveProtoOrBuilder
Optimization objective.Protobuf type
operations_research.sat.CpObjectiveProto| Modifier and Type | Method and Description |
|---|---|
CpObjectiveProto.Builder |
addAllCoeffs(java.lang.Iterable<? extends java.lang.Long> values)
repeated int64 coeffs = 4; |
CpObjectiveProto.Builder |
addAllDomain(java.lang.Iterable<? extends java.lang.Long> values)
If non-empty, only look for an objective value in the given domain.
|
CpObjectiveProto.Builder |
addAllVars(java.lang.Iterable<? extends java.lang.Integer> values)
The linear terms of the objective to minimize.
|
CpObjectiveProto.Builder |
addCoeffs(long value)
repeated int64 coeffs = 4; |
CpObjectiveProto.Builder |
addDomain(long value)
If non-empty, only look for an objective value in the given domain.
|
CpObjectiveProto.Builder |
addVars(int value)
The linear terms of the objective to minimize.
|
CpObjectiveProto |
build() |
CpObjectiveProto |
buildPartial() |
CpObjectiveProto.Builder |
clear() |
CpObjectiveProto.Builder |
clearCoeffs()
repeated int64 coeffs = 4; |
CpObjectiveProto.Builder |
clearDomain()
If non-empty, only look for an objective value in the given domain.
|
CpObjectiveProto.Builder |
clearIntegerAfterOffset()
int64 integer_after_offset = 9; |
CpObjectiveProto.Builder |
clearIntegerBeforeOffset()
Internal fields to recover a bound on the original integer objective from
the presolved one.
|
CpObjectiveProto.Builder |
clearIntegerScalingFactor()
int64 integer_scaling_factor = 8; |
CpObjectiveProto.Builder |
clearOffset()
The displayed objective is always:
scaling_factor * (sum(coefficients[i] * objective_vars[i]) + offset).
|
CpObjectiveProto.Builder |
clearScalingFactor()
double scaling_factor = 3; |
CpObjectiveProto.Builder |
clearScalingWasExact()
Internal field.
|
CpObjectiveProto.Builder |
clearVars()
The linear terms of the objective to minimize.
|
long |
getCoeffs(int index)
repeated int64 coeffs = 4; |
int |
getCoeffsCount()
repeated int64 coeffs = 4; |
java.util.List<java.lang.Long> |
getCoeffsList()
repeated int64 coeffs = 4; |
CpObjectiveProto |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
long |
getDomain(int index)
If non-empty, only look for an objective value in the given domain.
|
int |
getDomainCount()
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.
|
long |
getIntegerAfterOffset()
int64 integer_after_offset = 9; |
long |
getIntegerBeforeOffset()
Internal fields to recover a bound on the original integer objective from
the presolved one.
|
long |
getIntegerScalingFactor()
int64 integer_scaling_factor = 8; |
double |
getOffset()
The displayed objective is always:
scaling_factor * (sum(coefficients[i] * objective_vars[i]) + offset).
|
double |
getScalingFactor()
double scaling_factor = 3; |
boolean |
getScalingWasExact()
Internal field.
|
int |
getVars(int index)
The linear terms of the objective to minimize.
|
int |
getVarsCount()
The linear terms of the objective to minimize.
|
java.util.List<java.lang.Integer> |
getVarsList()
The linear terms of the objective to minimize.
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
CpObjectiveProto.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
CpObjectiveProto.Builder |
mergeFrom(CpObjectiveProto other) |
CpObjectiveProto.Builder |
mergeFrom(com.google.protobuf.Message other) |
CpObjectiveProto.Builder |
setCoeffs(int index,
long value)
repeated int64 coeffs = 4; |
CpObjectiveProto.Builder |
setDomain(int index,
long value)
If non-empty, only look for an objective value in the given domain.
|
CpObjectiveProto.Builder |
setIntegerAfterOffset(long value)
int64 integer_after_offset = 9; |
CpObjectiveProto.Builder |
setIntegerBeforeOffset(long value)
Internal fields to recover a bound on the original integer objective from
the presolved one.
|
CpObjectiveProto.Builder |
setIntegerScalingFactor(long value)
int64 integer_scaling_factor = 8; |
CpObjectiveProto.Builder |
setOffset(double value)
The displayed objective is always:
scaling_factor * (sum(coefficients[i] * objective_vars[i]) + offset).
|
CpObjectiveProto.Builder |
setScalingFactor(double value)
double scaling_factor = 3; |
CpObjectiveProto.Builder |
setScalingWasExact(boolean value)
Internal field.
|
CpObjectiveProto.Builder |
setVars(int index,
int value)
The linear terms of the objective to minimize.
|
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<CpObjectiveProto.Builder>public CpObjectiveProto.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessage.Builder<CpObjectiveProto.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<CpObjectiveProto.Builder>public CpObjectiveProto getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic CpObjectiveProto build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic CpObjectiveProto buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic CpObjectiveProto.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<CpObjectiveProto.Builder>public CpObjectiveProto.Builder mergeFrom(CpObjectiveProto other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessage.Builder<CpObjectiveProto.Builder>public CpObjectiveProto.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<CpObjectiveProto.Builder>java.io.IOExceptionpublic 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;getVarsList in interface CpObjectiveProtoOrBuilderpublic 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;getVarsCount in interface CpObjectiveProtoOrBuilderpublic 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;getVars in interface CpObjectiveProtoOrBuilderindex - The index of the element to return.public CpObjectiveProto.Builder setVars(int index, int value)
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;index - The index to set the value at.value - The vars to set.public CpObjectiveProto.Builder addVars(int value)
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;value - The vars to add.public CpObjectiveProto.Builder addAllVars(java.lang.Iterable<? extends java.lang.Integer> values)
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;values - The vars to add.public CpObjectiveProto.Builder clearVars()
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;public java.util.List<java.lang.Long> getCoeffsList()
repeated int64 coeffs = 4;getCoeffsList in interface CpObjectiveProtoOrBuilderpublic int getCoeffsCount()
repeated int64 coeffs = 4;getCoeffsCount in interface CpObjectiveProtoOrBuilderpublic long getCoeffs(int index)
repeated int64 coeffs = 4;getCoeffs in interface CpObjectiveProtoOrBuilderindex - The index of the element to return.public CpObjectiveProto.Builder setCoeffs(int index, long value)
repeated int64 coeffs = 4;index - The index to set the value at.value - The coeffs to set.public CpObjectiveProto.Builder addCoeffs(long value)
repeated int64 coeffs = 4;value - The coeffs to add.public CpObjectiveProto.Builder addAllCoeffs(java.lang.Iterable<? extends java.lang.Long> values)
repeated int64 coeffs = 4;values - The coeffs to add.public CpObjectiveProto.Builder clearCoeffs()
repeated int64 coeffs = 4;public 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;getOffset in interface CpObjectiveProtoOrBuilderpublic CpObjectiveProto.Builder setOffset(double value)
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;value - The offset to set.public CpObjectiveProto.Builder clearOffset()
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;public double getScalingFactor()
double scaling_factor = 3;getScalingFactor in interface CpObjectiveProtoOrBuilderpublic CpObjectiveProto.Builder setScalingFactor(double value)
double scaling_factor = 3;value - The scalingFactor to set.public CpObjectiveProto.Builder clearScalingFactor()
double scaling_factor = 3;public 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;getDomainList in interface CpObjectiveProtoOrBuilderpublic 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;getDomainCount in interface CpObjectiveProtoOrBuilderpublic 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;getDomain in interface CpObjectiveProtoOrBuilderindex - The index of the element to return.public CpObjectiveProto.Builder setDomain(int index, long value)
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;index - The index to set the value at.value - The domain to set.public CpObjectiveProto.Builder addDomain(long value)
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;value - The domain to add.public CpObjectiveProto.Builder addAllDomain(java.lang.Iterable<? extends java.lang.Long> values)
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;values - The domain to add.public CpObjectiveProto.Builder clearDomain()
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;public 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;getScalingWasExact in interface CpObjectiveProtoOrBuilderpublic CpObjectiveProto.Builder setScalingWasExact(boolean value)
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;value - The scalingWasExact to set.public CpObjectiveProto.Builder clearScalingWasExact()
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;public 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;getIntegerBeforeOffset in interface CpObjectiveProtoOrBuilderpublic CpObjectiveProto.Builder setIntegerBeforeOffset(long value)
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;value - The integerBeforeOffset to set.public CpObjectiveProto.Builder clearIntegerBeforeOffset()
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;public long getIntegerAfterOffset()
int64 integer_after_offset = 9;getIntegerAfterOffset in interface CpObjectiveProtoOrBuilderpublic CpObjectiveProto.Builder setIntegerAfterOffset(long value)
int64 integer_after_offset = 9;value - The integerAfterOffset to set.public CpObjectiveProto.Builder clearIntegerAfterOffset()
int64 integer_after_offset = 9;public long getIntegerScalingFactor()
int64 integer_scaling_factor = 8;getIntegerScalingFactor in interface CpObjectiveProtoOrBuilderpublic CpObjectiveProto.Builder setIntegerScalingFactor(long value)
int64 integer_scaling_factor = 8;value - The integerScalingFactor to set.public CpObjectiveProto.Builder clearIntegerScalingFactor()
int64 integer_scaling_factor = 8;Copyright © 2024. All rights reserved.