Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::math_opt::Objective Class Referencefinal

Detailed Description

Definition at line 43 of file objective.h.

#include <objective.h>

Inheritance diagram for operations_research::math_opt::Objective:
operations_research::math_opt::ModelStorageItem

Public Types

using IdType = AuxiliaryObjectiveId

Public Member Functions

std::optional< int64_t > id () const
ObjectiveId typed_id () const
bool is_primary () const
bool maximize () const
int64_t priority () const
absl::string_view name () const
double offset () const
int64_t num_linear_terms () const
int64_t num_quadratic_terms () const
double coefficient (Variable variable) const
double coefficient (Variable first_variable, Variable second_variable) const
bool is_coefficient_nonzero (Variable variable) const
bool is_coefficient_nonzero (Variable first_variable, Variable second_variable) const
LinearExpression AsLinearExpression () const
QuadraticExpression AsQuadraticExpression () const
std::string ToString () const
Public Member Functions inherited from operations_research::math_opt::ModelStorageItem
ModelStorageCPtr storage () const

Static Public Member Functions

static Objective Primary (ModelStorageCPtr storage)
static Objective Auxiliary (ModelStorageCPtr storage, AuxiliaryObjectiveId id)

Friends

bool operator== (const Objective &lhs, const Objective &rhs)
bool operator!= (const Objective &lhs, const Objective &rhs)
template<typename H>
AbslHashValue (H h, const Objective &objective)
std::ostream & operator<< (std::ostream &ostr, const Objective &objective)

Additional Inherited Members

Protected Member Functions inherited from operations_research::math_opt::ModelStorageItem
 ModelStorageItem (ModelStorageCPtr storage)
 ModelStorageItem (const ModelStorageItem &)=default
ModelStorageItemoperator= (const ModelStorageItem &)=default
 ModelStorageItem (ModelStorageItem &&)=default
ModelStorageItemoperator= (ModelStorageItem &&)=default
 ~ModelStorageItem ()=default

Member Typedef Documentation

◆ IdType

Member Function Documentation

◆ AsLinearExpression()

LinearExpression operations_research::math_opt::Objective::AsLinearExpression ( ) const

Definition at line 29 of file objective.cc.

◆ AsQuadraticExpression()

QuadraticExpression operations_research::math_opt::Objective::AsQuadraticExpression ( ) const

Definition at line 40 of file objective.cc.

◆ Auxiliary()

Objective operations_research::math_opt::Objective::Auxiliary ( ModelStorageCPtr storage,
AuxiliaryObjectiveId id )
inlinestatic

Definition at line 219 of file objective.h.

◆ coefficient() [1/2]

double operations_research::math_opt::Objective::coefficient ( Variable first_variable,
Variable second_variable ) const
inline

Definition at line 172 of file objective.h.

◆ coefficient() [2/2]

double operations_research::math_opt::Objective::coefficient ( Variable variable) const
inline

Definition at line 166 of file objective.h.

◆ id()

std::optional< int64_t > operations_research::math_opt::Objective::id ( ) const
inline

Definition at line 132 of file objective.h.

◆ is_coefficient_nonzero() [1/2]

bool operations_research::math_opt::Objective::is_coefficient_nonzero ( Variable first_variable,
Variable second_variable ) const
inline

Definition at line 189 of file objective.h.

◆ is_coefficient_nonzero() [2/2]

bool operations_research::math_opt::Objective::is_coefficient_nonzero ( Variable variable) const
inline

Definition at line 182 of file objective.h.

◆ is_primary()

bool operations_research::math_opt::Objective::is_primary ( ) const
inline

Definition at line 141 of file objective.h.

◆ maximize()

bool operations_research::math_opt::Objective::maximize ( ) const
inline

Definition at line 147 of file objective.h.

◆ name()

absl::string_view operations_research::math_opt::Objective::name ( ) const
inline

Definition at line 149 of file objective.h.

◆ num_linear_terms()

int64_t operations_research::math_opt::Objective::num_linear_terms ( ) const
inline

Definition at line 162 of file objective.h.

◆ num_quadratic_terms()

int64_t operations_research::math_opt::Objective::num_quadratic_terms ( ) const
inline

Definition at line 158 of file objective.h.

◆ offset()

double operations_research::math_opt::Objective::offset ( ) const
inline

Definition at line 156 of file objective.h.

◆ Primary()

Objective operations_research::math_opt::Objective::Primary ( ModelStorageCPtr storage)
inlinestatic

Definition at line 215 of file objective.h.

◆ priority()

int64_t operations_research::math_opt::Objective::priority ( ) const
inline

Definition at line 143 of file objective.h.

◆ ToString()

std::string operations_research::math_opt::Objective::ToString ( ) const

Definition at line 52 of file objective.cc.

◆ typed_id()

ObjectiveId operations_research::math_opt::Objective::typed_id ( ) const
inline

Definition at line 139 of file objective.h.

◆ AbslHashValue

template<typename H>
H AbslHashValue ( H h,
const Objective & objective )
friend

Definition at line 208 of file objective.h.

◆ operator!=

bool operator!= ( const Objective & lhs,
const Objective & rhs )
friend

Definition at line 203 of file objective.h.

◆ operator<<

std::ostream & operator<< ( std::ostream & ostr,
const Objective & objective )
friend

Definition at line 61 of file objective.cc.

◆ operator==

bool operator== ( const Objective & lhs,
const Objective & rhs )
friend

Definition at line 199 of file objective.h.


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