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

The objective of an optimization problem. More...

Inheritance diagram for Google.OrTools.Sat.LinearObjective:

Public Member Functions

 LinearObjective ()
 
 LinearObjective (LinearObjective other)
 
LinearObjective Clone ()
 
void ClearOffset ()
 Clears the value of the "offset" field.
 
void ClearScalingFactor ()
 Clears the value of the "scaling_factor" field.
 
override bool Equals (object other)
 
bool Equals (LinearObjective other)
 
override int GetHashCode ()
 
override string ToString ()
 
void WriteTo (pb::CodedOutputStream output)
 
int CalculateSize ()
 
void MergeFrom (LinearObjective other)
 
void MergeFrom (pb::CodedInputStream input)
 

Static Public Attributes

const int LiteralsFieldNumber = 1
 Field number for the "literals" field.
 
const int CoefficientsFieldNumber = 2
 Field number for the "coefficients" field.
 
const int OffsetFieldNumber = 3
 Field number for the "offset" field.
 
const int ScalingFactorFieldNumber = 4
 Field number for the "scaling_factor" field.
 

Properties

static pb::MessageParser< LinearObjectiveParser [get]
 
static pbr::MessageDescriptor Descriptor [get]
 
pbc::RepeatedField< int > Literals [get]
 The goal is always to minimize the linear Boolean formula defined by these two fields: sum_i literal_i * coefficient_i where literal_i is 1 iff literal_i is true in a given assignment.
 
pbc::RepeatedField< long > Coefficients [get]
 
double Offset [get, set]
 For a given variable assignment, the "real" problem objective value is 'scaling_factor * (minimization_objective + offset)' where 'minimization_objective is the one defined just above.
 
bool HasOffset [get]
 Gets whether the "offset" field is set.
 
double ScalingFactor [get, set]
 
bool HasScalingFactor [get]
 Gets whether the "scaling_factor" field is set.
 

Detailed Description

The objective of an optimization problem.

Definition at line 453 of file BooleanProblem.pb.cs.

Constructor & Destructor Documentation

◆ LinearObjective() [1/2]

Google.OrTools.Sat.LinearObjective.LinearObjective ( )
inline

Definition at line 479 of file BooleanProblem.pb.cs.

◆ LinearObjective() [2/2]

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

Definition at line 487 of file BooleanProblem.pb.cs.

Member Function Documentation

◆ CalculateSize()

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

Definition at line 683 of file BooleanProblem.pb.cs.

◆ ClearOffset()

void Google.OrTools.Sat.LinearObjective.ClearOffset ( )
inline

Clears the value of the "offset" field.

Definition at line 566 of file BooleanProblem.pb.cs.

◆ ClearScalingFactor()

void Google.OrTools.Sat.LinearObjective.ClearScalingFactor ( )
inline

Clears the value of the "scaling_factor" field.

Definition at line 593 of file BooleanProblem.pb.cs.

◆ Clone()

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

Definition at line 498 of file BooleanProblem.pb.cs.

◆ Equals() [1/2]

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

Definition at line 605 of file BooleanProblem.pb.cs.

◆ Equals() [2/2]

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

Definition at line 599 of file BooleanProblem.pb.cs.

◆ GetHashCode()

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

Definition at line 621 of file BooleanProblem.pb.cs.

◆ MergeFrom() [1/2]

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

Definition at line 701 of file BooleanProblem.pb.cs.

◆ MergeFrom() [2/2]

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

Definition at line 718 of file BooleanProblem.pb.cs.

◆ ToString()

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

Definition at line 635 of file BooleanProblem.pb.cs.

◆ WriteTo()

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

Definition at line 641 of file BooleanProblem.pb.cs.

Member Data Documentation

◆ CoefficientsFieldNumber

const int Google.OrTools.Sat.LinearObjective.CoefficientsFieldNumber = 2
static

Field number for the "coefficients" field.

Definition at line 523 of file BooleanProblem.pb.cs.

◆ LiteralsFieldNumber

const int Google.OrTools.Sat.LinearObjective.LiteralsFieldNumber = 1
static

Field number for the "literals" field.

Definition at line 503 of file BooleanProblem.pb.cs.

◆ OffsetFieldNumber

const int Google.OrTools.Sat.LinearObjective.OffsetFieldNumber = 3
static

Field number for the "offset" field.

Definition at line 534 of file BooleanProblem.pb.cs.

◆ ScalingFactorFieldNumber

const int Google.OrTools.Sat.LinearObjective.ScalingFactorFieldNumber = 4
static

Field number for the "scaling_factor" field.

Definition at line 571 of file BooleanProblem.pb.cs.

Property Documentation

◆ Coefficients

pbc.RepeatedField<long> Google.OrTools.Sat.LinearObjective.Coefficients
get

Definition at line 529 of file BooleanProblem.pb.cs.

◆ Descriptor

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

Definition at line 467 of file BooleanProblem.pb.cs.

◆ HasOffset

bool Google.OrTools.Sat.LinearObjective.HasOffset
get

Gets whether the "offset" field is set.

Definition at line 560 of file BooleanProblem.pb.cs.

◆ HasScalingFactor

bool Google.OrTools.Sat.LinearObjective.HasScalingFactor
get

Gets whether the "scaling_factor" field is set.

Definition at line 587 of file BooleanProblem.pb.cs.

◆ Literals

pbc.RepeatedField<int> Google.OrTools.Sat.LinearObjective.Literals
get

The goal is always to minimize the linear Boolean formula defined by these two fields: sum_i literal_i * coefficient_i where literal_i is 1 iff literal_i is true in a given assignment.

Note
the same variable shouldn't appear twice and that zero coefficients are not allowed.

Definition at line 518 of file BooleanProblem.pb.cs.

◆ Offset

double Google.OrTools.Sat.LinearObjective.Offset
getset

For a given variable assignment, the "real" problem objective value is 'scaling_factor * (minimization_objective + offset)' where 'minimization_objective is the one defined just above.

Note
this is not what we minimize, but it is what we display. In particular if scaling_factor is negative, then the "real" problem is a maximization problem, even if the "internal" objective is minimized.

Definition at line 550 of file BooleanProblem.pb.cs.

◆ Parser

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

Definition at line 463 of file BooleanProblem.pb.cs.

◆ ScalingFactor

double Google.OrTools.Sat.LinearObjective.ScalingFactor
getset

Definition at line 577 of file BooleanProblem.pb.cs.


The documentation for this class was generated from the following file: