Optimization objective.
More...
|
static pb::MessageParser< CpObjectiveProto > | Parser [get] |
|
static pbr::MessageDescriptor | Descriptor [get] |
|
pbc::RepeatedField< int > | Vars [get] |
| 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.
|
|
pbc::RepeatedField< long > | Coeffs [get] |
|
double | Offset [get, set] |
| 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.
|
|
double | ScalingFactor [get, set] |
|
pbc::RepeatedField< long > | Domain [get] |
| If non-empty, only look for an objective value in the given domain.
|
|
bool | ScalingWasExact [get, set] |
| 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).
|
|
long | IntegerBeforeOffset [get, set] |
| 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.
|
|
long | IntegerAfterOffset [get, set] |
|
long | IntegerScalingFactor [get, set] |
|
Optimization objective.
Definition at line 6397 of file CpModel.pb.cs.
◆ CpObjectiveProto() [1/2]
Google.OrTools.Sat.CpObjectiveProto.CpObjectiveProto |
( |
| ) |
|
|
inline |
◆ CpObjectiveProto() [2/2]
◆ CalculateSize()
int Google.OrTools.Sat.CpObjectiveProto.CalculateSize |
( |
| ) |
|
|
inline |
◆ Clone()
◆ Equals() [1/2]
◆ Equals() [2/2]
override bool Google.OrTools.Sat.CpObjectiveProto.Equals |
( |
object | other | ) |
|
|
inline |
◆ GetHashCode()
override int Google.OrTools.Sat.CpObjectiveProto.GetHashCode |
( |
| ) |
|
|
inline |
◆ MergeFrom() [1/2]
◆ MergeFrom() [2/2]
void Google.OrTools.Sat.CpObjectiveProto.MergeFrom |
( |
pb.CodedInputStream | input | ) |
|
|
inline |
◆ ToString()
override string Google.OrTools.Sat.CpObjectiveProto.ToString |
( |
| ) |
|
|
inline |
◆ WriteTo()
void Google.OrTools.Sat.CpObjectiveProto.WriteTo |
( |
pb.CodedOutputStream | output | ) |
|
|
inline |
◆ CoeffsFieldNumber
const int Google.OrTools.Sat.CpObjectiveProto.CoeffsFieldNumber = 4 |
|
static |
◆ DomainFieldNumber
const int Google.OrTools.Sat.CpObjectiveProto.DomainFieldNumber = 5 |
|
static |
◆ IntegerAfterOffsetFieldNumber
const int Google.OrTools.Sat.CpObjectiveProto.IntegerAfterOffsetFieldNumber = 9 |
|
static |
Field number for the "integer_after_offset" field.
Definition at line 6574 of file CpModel.pb.cs.
◆ IntegerBeforeOffsetFieldNumber
const int Google.OrTools.Sat.CpObjectiveProto.IntegerBeforeOffsetFieldNumber = 7 |
|
static |
Field number for the "integer_before_offset" field.
Definition at line 6547 of file CpModel.pb.cs.
◆ IntegerScalingFactorFieldNumber
const int Google.OrTools.Sat.CpObjectiveProto.IntegerScalingFactorFieldNumber = 8 |
|
static |
Field number for the "integer_scaling_factor" field.
Definition at line 6586 of file CpModel.pb.cs.
◆ OffsetFieldNumber
const int Google.OrTools.Sat.CpObjectiveProto.OffsetFieldNumber = 2 |
|
static |
◆ ScalingFactorFieldNumber
const int Google.OrTools.Sat.CpObjectiveProto.ScalingFactorFieldNumber = 3 |
|
static |
Field number for the "scaling_factor" field.
Definition at line 6499 of file CpModel.pb.cs.
◆ ScalingWasExactFieldNumber
const int Google.OrTools.Sat.CpObjectiveProto.ScalingWasExactFieldNumber = 6 |
|
static |
Field number for the "scaling_was_exact" field.
Definition at line 6527 of file CpModel.pb.cs.
◆ VarsFieldNumber
const int Google.OrTools.Sat.CpObjectiveProto.VarsFieldNumber = 1 |
|
static |
◆ Coeffs
pbc.RepeatedField<long> Google.OrTools.Sat.CpObjectiveProto.Coeffs |
|
get |
◆ Descriptor
pbr.MessageDescriptor Google.OrTools.Sat.CpObjectiveProto.Descriptor |
|
staticget |
◆ Domain
pbc.RepeatedField<long> Google.OrTools.Sat.CpObjectiveProto.Domain |
|
get |
If non-empty, only look for an objective value in the given domain.
- Note
- this does not depend on the offset or scaling factor, it is a domain on the sum of the objective terms only.
Definition at line 6522 of file CpModel.pb.cs.
◆ IntegerAfterOffset
long Google.OrTools.Sat.CpObjectiveProto.IntegerAfterOffset |
|
getset |
◆ IntegerBeforeOffset
long Google.OrTools.Sat.CpObjectiveProto.IntegerBeforeOffset |
|
getset |
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
- 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).
Definition at line 6566 of file CpModel.pb.cs.
◆ IntegerScalingFactor
long Google.OrTools.Sat.CpObjectiveProto.IntegerScalingFactor |
|
getset |
◆ Offset
double Google.OrTools.Sat.CpObjectiveProto.Offset |
|
getset |
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
- if scaling_factor is zero, then it is assumed to be 1, so that by default these fields have no effect.
Definition at line 6491 of file CpModel.pb.cs.
◆ Parser
◆ ScalingFactor
double Google.OrTools.Sat.CpObjectiveProto.ScalingFactor |
|
getset |
◆ ScalingWasExact
bool Google.OrTools.Sat.CpObjectiveProto.ScalingWasExact |
|
getset |
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?
Definition at line 6539 of file CpModel.pb.cs.
◆ Vars
pbc.RepeatedField<int> Google.OrTools.Sat.CpObjectiveProto.Vars |
|
get |
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.
Definition at line 6461 of file CpModel.pb.cs.
The documentation for this class was generated from the following file: