![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
#include <elemental_differencer.h>
Classes | |
struct | AttributeDifference |
struct | ElementDifference |
The difference for an ElementType. More... |
Public Member Functions | |
ElementalDifference ()=default | |
const ElementDifference & | element_difference (const ElementType e) const |
ElementDifference & | mutable_element_difference (const ElementType e) |
template<typename AttrType> | |
const AttributeDifference< AttrType > & | attr_difference (const AttrType a) const |
template<typename AttrType> | |
AttributeDifference< AttrType > & | mutable_attr_difference (const AttrType a) |
bool | Empty () const |
bool | model_name_different () const |
void | set_model_name_different (bool value) |
bool | primary_objective_name_different () const |
void | set_primary_objective_name_different (bool value) |
Static Public Member Functions | |
static ElementalDifference | Create (const Elemental &first, const Elemental &second, const ElementalDifferenceOptions &options={}) |
Returns the difference between two Elementals. | |
static std::string | DescribeDifference (const Elemental &first, const Elemental &second, const ElementalDifferenceOptions &options={}) |
Returns a string describing the difference between two models. | |
static std::string | Describe (const Elemental &first, const Elemental &second, const ElementalDifference &difference) |
Holds the difference between the model from two Elementals. Typically used to check if two Elemental objects are the same, and provide a nice description of how they differ if they are not the same.
Definition at line 67 of file elemental_differencer.h.
|
explicitdefault |
|
inline |
Definition at line 146 of file elemental_differencer.h.
|
static |
Returns the difference between two Elementals.
We can CHECK here, we just read the element from the set.
NOLINTNEXTLINE(clang-diagnostic-pre-c++20-compat)
Definition at line 68 of file elemental_differencer.cc.
|
static |
Returns a string describing difference, using data from first and second to make the output more human readable (e.g. show element names), or CHECK fails on bad input (see below).
Advanced use, generally prefer DescribeDifference(const Elemental&, / const Elemental&, const ElementalDifferenceOptions&) instead, which cannot CHECK fail. Useful if you want to compute the difference and do some logical operations before (perhaps conditionally) converting the difference to a string.
This function can CHECK fail if difference claims that first or second contains an element which is missing. A sufficient condition to ensure that this function will NOT CHECK is to invoke it as Describe(first, second, Create(first, second)) to ensure that the models are correct and not modified between Create() and Describe().
NOLINTNEXTLINE(clang-diagnostic-pre-c++20-compat)
Definition at line 155 of file elemental_differencer.cc.
|
static |
Returns a string describing the difference between two models.
Definition at line 247 of file elemental_differencer.cc.
|
inline |
Definition at line 136 of file elemental_differencer.h.
bool operations_research::math_opt::ElementalDifference::Empty | ( | ) | const |
Definition at line 52 of file elemental_differencer.cc.
|
inline |
Definition at line 157 of file elemental_differencer.h.
|
inline |
Definition at line 151 of file elemental_differencer.h.
|
inline |
Definition at line 141 of file elemental_differencer.h.
|
inline |
Definition at line 162 of file elemental_differencer.h.
|
inline |
Definition at line 158 of file elemental_differencer.h.
|
inline |
Definition at line 165 of file elemental_differencer.h.