Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Google.OrTools.Sat.CpObjectiveProto Class Referencesealed

Optimization objective. More...

Inheritance diagram for Google.OrTools.Sat.CpObjectiveProto:

Public Member Functions

 CpObjectiveProto ()
 
 CpObjectiveProto (CpObjectiveProto other)
 
CpObjectiveProto Clone ()
 
override bool Equals (object other)
 
bool Equals (CpObjectiveProto other)
 
override int GetHashCode ()
 
override string ToString ()
 
void WriteTo (pb::CodedOutputStream output)
 
int CalculateSize ()
 
void MergeFrom (CpObjectiveProto other)
 
void MergeFrom (pb::CodedInputStream input)
 

Static Public Attributes

const int VarsFieldNumber = 1
 Field number for the "vars" field.
 
const int CoeffsFieldNumber = 4
 Field number for the "coeffs" field.
 
const int OffsetFieldNumber = 2
 Field number for the "offset" field.
 
const int ScalingFactorFieldNumber = 3
 Field number for the "scaling_factor" field.
 
const int DomainFieldNumber = 5
 Field number for the "domain" field.
 
const int ScalingWasExactFieldNumber = 6
 Field number for the "scaling_was_exact" field.
 
const int IntegerBeforeOffsetFieldNumber = 7
 Field number for the "integer_before_offset" field.
 
const int IntegerAfterOffsetFieldNumber = 9
 Field number for the "integer_after_offset" field.
 
const int IntegerScalingFactorFieldNumber = 8
 Field number for the "integer_scaling_factor" field.
 

Properties

static pb::MessageParser< CpObjectiveProtoParser [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]
 

Detailed Description

Optimization objective.

Definition at line 6397 of file CpModel.pb.cs.

Constructor & Destructor Documentation

◆ CpObjectiveProto() [1/2]

Google.OrTools.Sat.CpObjectiveProto.CpObjectiveProto ( )
inline

Definition at line 6422 of file CpModel.pb.cs.

◆ CpObjectiveProto() [2/2]

Google.OrTools.Sat.CpObjectiveProto.CpObjectiveProto ( CpObjectiveProto other)
inline

Definition at line 6430 of file CpModel.pb.cs.

Member Function Documentation

◆ CalculateSize()

int Google.OrTools.Sat.CpObjectiveProto.CalculateSize ( )
inline

Definition at line 6727 of file CpModel.pb.cs.

◆ Clone()

CpObjectiveProto Google.OrTools.Sat.CpObjectiveProto.Clone ( )
inline

Definition at line 6445 of file CpModel.pb.cs.

◆ Equals() [1/2]

bool Google.OrTools.Sat.CpObjectiveProto.Equals ( CpObjectiveProto other)
inline

Definition at line 6605 of file CpModel.pb.cs.

◆ Equals() [2/2]

override bool Google.OrTools.Sat.CpObjectiveProto.Equals ( object other)
inline

Definition at line 6599 of file CpModel.pb.cs.

◆ GetHashCode()

override int Google.OrTools.Sat.CpObjectiveProto.GetHashCode ( )
inline

Definition at line 6626 of file CpModel.pb.cs.

◆ MergeFrom() [1/2]

void Google.OrTools.Sat.CpObjectiveProto.MergeFrom ( CpObjectiveProto other)
inline

Definition at line 6758 of file CpModel.pb.cs.

◆ MergeFrom() [2/2]

void Google.OrTools.Sat.CpObjectiveProto.MergeFrom ( pb.CodedInputStream input)
inline

Definition at line 6788 of file CpModel.pb.cs.

◆ ToString()

override string Google.OrTools.Sat.CpObjectiveProto.ToString ( )
inline

Definition at line 6645 of file CpModel.pb.cs.

◆ WriteTo()

void Google.OrTools.Sat.CpObjectiveProto.WriteTo ( pb.CodedOutputStream output)
inline

Definition at line 6651 of file CpModel.pb.cs.

Member Data Documentation

◆ CoeffsFieldNumber

const int Google.OrTools.Sat.CpObjectiveProto.CoeffsFieldNumber = 4
static

Field number for the "coeffs" field.

Definition at line 6466 of file CpModel.pb.cs.

◆ DomainFieldNumber

const int Google.OrTools.Sat.CpObjectiveProto.DomainFieldNumber = 5
static

Field number for the "domain" field.

Definition at line 6511 of file CpModel.pb.cs.

◆ 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

Field number for the "offset" field.

Definition at line 6477 of file CpModel.pb.cs.

◆ 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

Field number for the "vars" field.

Definition at line 6450 of file CpModel.pb.cs.

Property Documentation

◆ Coeffs

pbc.RepeatedField<long> Google.OrTools.Sat.CpObjectiveProto.Coeffs
get

Definition at line 6472 of file CpModel.pb.cs.

◆ Descriptor

pbr.MessageDescriptor Google.OrTools.Sat.CpObjectiveProto.Descriptor
staticget

Definition at line 6410 of file CpModel.pb.cs.

◆ 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

Definition at line 6578 of file CpModel.pb.cs.

◆ 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

Definition at line 6590 of file CpModel.pb.cs.

◆ 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

pb.MessageParser<CpObjectiveProto> Google.OrTools.Sat.CpObjectiveProto.Parser
staticget

Definition at line 6406 of file CpModel.pb.cs.

◆ ScalingFactor

double Google.OrTools.Sat.CpObjectiveProto.ScalingFactor
getset

Definition at line 6503 of file CpModel.pb.cs.

◆ 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: