Google OR-Tools v9.14
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...

Detailed Description

The objective of an optimization problem.

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

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.

Constructor & Destructor Documentation

◆ LinearObjective() [1/2]

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

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

◆ LinearObjective() [2/2]

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

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

Member Function Documentation

◆ CalculateSize()

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

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

◆ ClearOffset()

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

Clears the value of the "offset" field.

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

◆ ClearScalingFactor()

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

Clears the value of the "scaling_factor" field.

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

◆ Clone()

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

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

◆ Equals() [1/2]

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

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

◆ Equals() [2/2]

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

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

◆ GetHashCode()

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

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

◆ MergeFrom() [1/2]

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

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

◆ MergeFrom() [2/2]

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

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

◆ ToString()

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

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

◆ WriteTo()

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

Definition at line 649 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 531 of file BooleanProblem.pb.cs.

◆ LiteralsFieldNumber

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

Field number for the "literals" field.

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

◆ OffsetFieldNumber

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

Field number for the "offset" field.

Definition at line 542 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 579 of file BooleanProblem.pb.cs.

Property Documentation

◆ Coefficients

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

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

◆ Descriptor

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

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

◆ HasOffset

bool Google.OrTools.Sat.LinearObjective.HasOffset
get

Gets whether the "offset" field is set.

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

◆ HasScalingFactor

bool Google.OrTools.Sat.LinearObjective.HasScalingFactor
get

Gets whether the "scaling_factor" field is set.

Definition at line 595 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 526 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 558 of file BooleanProblem.pb.cs.

◆ Parser

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

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

◆ ScalingFactor

double Google.OrTools.Sat.LinearObjective.ScalingFactor
getset

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


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