36 template<
typename T,
typename Slicer = slice_traits<T>,
bool tSize = false>
43 typename Slicer::Type at(
const typename Base::key_type & key, with_sub);
44 typename Slicer::ConstType at(
const typename Base::key_type & key, with_sub)
const;
47 template<
typename T,
typename Slicer,
bool tSize>
48 inline typename Slicer::Type MapWithVariableAsKey<T, Slicer, tSize>::at(
const typename Base::key_type & key, with_sub)
50 auto it = Base::find(key);
59 for(
auto it = Base::begin(); it != Base::end(); ++it)
61 if(it->first->contains(*key))
63 if((*it->first) == (*key))
71 r = it->first->tSubvariableRange().relativeRange(key->tSubvariableRange());
73 r = it->first->subvariableRange().relativeRange(key->subvariableRange());
74 return Slicer::get(it->second, r);
80 throw std::out_of_range(
"[MapWithVariableAsKey::at] Variable " + key->name() +
" is not part of this map.");
83 template<
typename T,
typename Slicer,
bool tSize>
84 inline typename Slicer::ConstType MapWithVariableAsKey<T, Slicer, tSize>::at(
const typename Base::key_type & key,
87 auto it = Base::find(key);
96 for(
auto it = Base::begin(); it != Base::end(); ++it)
98 if(it->first->contains(*key))
100 if((*it->first) == (*key))
108 r = it->first->tSubvariableRange().relativeRange(key->tSubvariableRange());
110 r = it->first->subvariableRange().relativeRange(key->subvariableRange());
111 return Slicer::get(it->second, r);
117 throw std::out_of_range(
"[MapWithVariableAsKey::at] Variable " + key->name() +
" is not part of this map.");
Type
Definition: enums.h:15
Definition: AffineExprDetail.h:15
std::map< KeyWithId, Value, IdLess< KeyWithId >, Allocator > map
Definition: map.h:41