Skip to content
Snippets Groups Projects

Add SubArray class

Merged Stéphane Del Pino requested to merge feature/item-array into develop
2 files
+ 316
128
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -109,6 +109,17 @@ class SubItemValuePerItem
return m_connectivity_ptr.use_count() != 0;
}
PUGS_INLINE
std::shared_ptr<const IConnectivity>
connectivity_ptr() const noexcept
{
if constexpr (std::is_same_v<ConnectivityPtr, ConnectivitySharedPtr>) {
return m_connectivity_ptr;
} else {
return m_connectivity_ptr.lock();
}
}
template <typename IndexType, typename SubIndexType>
PUGS_FORCEINLINE DataType&
operator()(IndexType item_id, SubIndexType i) const noexcept(NO_ASSERT)
@@ -128,7 +139,7 @@ class SubItemValuePerItem
{
static_assert(std::is_integral_v<ArrayIndexType>, "index must be an integral type");
Assert(this->isBuilt());
Assert(i < m_values.size());
Assert(static_cast<size_t>(i) < m_values.size());
return m_values[i];
}
@@ -223,7 +234,6 @@ class SubItemValuePerItem
{
static_assert(not std::is_const_v<DataType>, "Cannot allocate SubItemValuePerItem of const data: only "
"view is supported");
;
ConnectivityMatrix connectivity_matrix = connectivity._getMatrix(item_type, sub_item_type);
Loading