Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::math_opt::ObjectiveStorage::Diff Struct Reference

#include <objective_storage.h>

Classes

struct  SingleObjective
 

Public Member Functions

 Diff (const ObjectiveStorage &storage, VariableId variable_checkpoint)
 
bool objective_tracked (ObjectiveId id) const
 

Public Attributes

AuxiliaryObjectiveId objective_checkpoint {0}
 
VariableId variable_checkpoint {0}
 
absl::flat_hash_map< ObjectiveId, SingleObjectiveobjective_diffs
 
absl::flat_hash_set< AuxiliaryObjectiveId > deleted
 

Detailed Description

Tracks the changes to ObjectiveStorage. Advancing the checkpoint throws away tracked changes.

An instance of this class is owned by each update tracker of ModelStorage.

Definition at line 44 of file objective_storage.h.

Constructor & Destructor Documentation

◆ Diff()

operations_research::math_opt::ObjectiveStorage::Diff::Diff ( const ObjectiveStorage & storage,
VariableId variable_checkpoint )
inlineexplicit

Definition at line 243 of file objective_storage.h.

Member Function Documentation

◆ objective_tracked()

bool operations_research::math_opt::ObjectiveStorage::Diff::objective_tracked ( ObjectiveId id) const
inline

Returns true if objective id is already tracked by the diff. Otherwise, it should be considered a "new" objective.

The primary objective is always present, so updates are always exported.

Definition at line 445 of file objective_storage.h.

Member Data Documentation

◆ deleted

absl::flat_hash_set<AuxiliaryObjectiveId> operations_research::math_opt::ObjectiveStorage::Diff::deleted

Definition at line 83 of file objective_storage.h.

◆ objective_checkpoint

AuxiliaryObjectiveId operations_research::math_opt::ObjectiveStorage::Diff::objective_checkpoint {0}

Definition at line 76 of file objective_storage.h.

◆ objective_diffs

absl::flat_hash_map<ObjectiveId, SingleObjective> operations_research::math_opt::ObjectiveStorage::Diff::objective_diffs

No guarantees provided on which objectives have corresponding entries, or that values are not empty().

Todo
(b/259109678): Consider storing primary objective separately (like in ObjectiveStorage) if hashing is a noticeable bottleneck.

Definition at line 82 of file objective_storage.h.

◆ variable_checkpoint

VariableId operations_research::math_opt::ObjectiveStorage::Diff::variable_checkpoint {0}

Definition at line 77 of file objective_storage.h.


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