void
print_svg(std::ostream &out) const;
+ /**
+ * Determine an estimate for the memory consumption (in bytes) of this
+ * object.
+ */
+ std::size_t
+ memory_consumption() const;
+
/**
* @addtogroup Exceptions
* @{
bool
is_compressed() const;
- /**
- * Determine an estimate for the memory consumption (in bytes) of this
- * object.
- */
- std::size_t
- memory_consumption() const;
-
/**
* Copy data from an object of type BlockDynamicSparsityPattern, i.e. resize
* this object to the size of the given argument, and copy over the contents
+template <class SparsityPatternType>
+std::size_t
+BlockSparsityPatternBase<SparsityPatternType>::memory_consumption() const
+{
+ std::size_t mem = 0;
+ mem += (MemoryConsumption::memory_consumption(n_block_rows()) +
+ MemoryConsumption::memory_consumption(n_block_cols()) +
+ MemoryConsumption::memory_consumption(sub_objects) +
+ MemoryConsumption::memory_consumption(row_indices) +
+ MemoryConsumption::memory_consumption(column_indices));
+ for (size_type r = 0; r < n_block_rows(); ++r)
+ for (size_type c = 0; c < n_block_cols(); ++c)
+ mem += MemoryConsumption::memory_consumption(*sub_objects[r][c]);
+
+ return mem;
+}
+
+
+
BlockSparsityPattern::BlockSparsityPattern(const size_type n_rows,
const size_type n_columns)
: BlockSparsityPatternBase<SparsityPattern>(n_rows, n_columns)
}
-std::size_t
-BlockSparsityPattern::memory_consumption() const
-{
- std::size_t mem = 0;
- mem += (MemoryConsumption::memory_consumption(n_block_rows()) +
- MemoryConsumption::memory_consumption(n_block_cols()) +
- MemoryConsumption::memory_consumption(sub_objects) +
- MemoryConsumption::memory_consumption(row_indices) +
- MemoryConsumption::memory_consumption(column_indices));
- for (size_type r = 0; r < n_block_rows(); ++r)
- for (size_type c = 0; c < n_block_cols(); ++c)
- mem += MemoryConsumption::memory_consumption(*sub_objects[r][c]);
-
- return mem;
-}
-
-
void
BlockSparsityPattern::copy_from(const BlockDynamicSparsityPattern &dsp)