7#ifndef POSTCELLCOLLECTOR_H_
8#define POSTCELLCOLLECTOR_H_
28 static constexpr MInt value() {
return std::numeric_limits<MInt>::min(); }
35#ifdef MAIA_PGI_COMPILER
36 return std::numeric_limits<MFloat>::quiet_NaN();
38 return std::numeric_limits<MFloat>::signaling_NaN();
101 template <
class Functor,
class T>
108 m_noVariables = noVars_;
114 resetStorage(noVariables(), m_Variables);
115 resetStorage(1, m_properties);
121 return m_Variables[
id * noVariables() + varId];
127 return m_Variables[
id * noVariables() + varId];
145 m_properties.at(
id).reset();
152 fill_invalid(m_Variables, begin, end, noVariables());
155 fill_invalid(m_properties, begin, end);
162 return m_properties[
id];
167template <
class Functor,
class T>
169 const MInt destination) {
171 copyData(source.m_Variables, m_Variables, c, begin, end, destination, noVariables());
173 copyData(source.m_properties, m_properties, c, begin, end, destination);
void copyData(const Container_ &source, Container_ &target, Functor &&f, const MInt begin, const MInt end, const MInt dest, const MInt solverSize=1)
Copy [begin, end) range with given solver size from source to dest position of target.
void fill_invalid(Container_ &c, const MInt begin, const MInt end, const MInt solverSize=1, const T value=Invalid< T >::value())
void resetStorage(const MInt n, Storage< T > &c)
Create new container with given size and replace original one.
void reset(const MInt capacity)
Reset tree, re-create data structures with given capacity, and set size to zero.
Class that represents Post cell collector.
constexpr PostCellCollector()=default
Default c'tor does nothing.
void reset()
Reset tree, re-create data structures with given capacity, and set size to zero.
void rawCopyGeneric(Functor &&c, const T &source, const MInt begin, const MInt end, const MInt destination)
Helper function for rawCopy(). Destination may refer to beginning or end of target range.
void resetProperties(const MInt id)
Reset all properties.
Storage< BitsetType > m_properties
maia::post::cell::BitsetType BitsetType
Storage< MFloat > m_Variables
void setNoVariables(const MInt noVars_)
constexpr MInt noVariables() const
Return number of variables.
BitsetType::reference hasProperty(const MInt id, const PostCell p)
Accessor for properties.
typename maia::post::collector::Invalid< T > Invalid
MInt m_noVariables
Number of variables.
MFloat & variable(const MInt id, const MInt dim)
Accessor for variables.
typename Base::template Storage< T > Storage
void invalidate(const MInt begin, const MInt end)
Erase range of nodes such that they contain no sensible values anymore.
BitsetType & properties(const MInt id)
Accessor for properties.
constexpr std::underlying_type< PostCell >::type p(const PostCell property)
Converts property name to underlying integer value.
std::bitset< p(PostCell::NumProperties)> BitsetType
maia::post::cell::BitsetType BitsetType
Underlying bitset type for property storage.
Namespace for auxiliary functions/classes.
PostCell
POST cell Property Labels.
static constexpr MFloat value()
static constexpr MInt value()