14#ifndef OR_TOOLS_MATH_OPT_ELEMENTAL_ATTR_DIFF_H_
15#define OR_TOOLS_MATH_OPT_ELEMENTAL_ATTR_DIFF_H_
20#include "absl/container/flat_hash_set.h"
27template <
int n,
typename Symmetry>
36 void Advance() { modified_keys_.clear(); }
50 void Erase(
const Key key) { modified_keys_.erase(key); }
AttrKey< n, Symmetry > Key
const AttrKeyHashSet< Key > & modified_keys() const
void Erase(const Key key)
AttrDiff()=default
On creation, the attribute is not modified for any key.
void Advance()
Clear all tracked modifications.
bool has_modified_keys() const
void SetModified(const Key key)
Mark the attribute as modified for key.
An object oriented wrapper for quadratic constraints in ModelStorage.
std::conditional_t<(AttrKeyT::size() > 0), absl::flat_hash_set< AttrKeyT >, detail::AttrKey0RawSet< typename AttrKeyT::SymmetryT, AttrKeyT > > AttrKeyHashSet
A hash set of AttrKeyT, where AttrKeyT is an AttrKey<n, Symmetry>.