*/
bool optimize_diagonal () const;
+ /**
+ * Return whether this object stores only
+ * those entries that have been added
+ * explicitly, or if the sparsity pattern
+ * contains elements that have been added
+ * through other means (implicitly) while
+ * building it. For the current class,
+ * the result is false because we store
+ * entire chunks, not individual
+ * elements, and adding one entry to the
+ * sparsity pattern requires also adding
+ * all the other elements of a chunk. The
+ * only exception is if
+ * <code>chunk_size==1</code>, the
+ * sparsity pattern is nonsymmetric or
+ * optimize_diag has been set to false.
+ *
+ * This function mainly serves the
+ * purpose of describing the current
+ * class in cases where several kinds of
+ * sparsity patterns can be passed as
+ * template arguments.
+ */
+ bool stores_only_added_elements () const;
/**
* Write the data of this object
/**
* Return the number of nonzero elements
- * allocated through this sparsity pattern.
+ * allocated through this sparsity
+ * pattern.
*/
unsigned int n_nonzero_elements () const;
+ /**
+ * Return whether this object stores only
+ * those entries that have been added
+ * explicitly, or if the sparsity pattern
+ * contains elements that have been added
+ * through other means (implicitly) while
+ * building it. For the current class,
+ * the result is always true.
+ *
+ * This function mainly serves the
+ * purpose of describing the current
+ * class in cases where several kinds of
+ * sparsity patterns can be passed as
+ * template arguments.
+ */
+ static
+ bool stores_only_added_elements ();
+
private:
/**
* Number of rows that this sparsity
}
+
+inline
+bool
+CompressedSetSparsityPattern::stores_only_added_elements ()
+{
+ return true;
+}
+
+
DEAL_II_NAMESPACE_CLOSE
#endif
/**
* Return the number of nonzero elements
- * allocated through this sparsity pattern.
+ * allocated through this sparsity
+ * pattern.
*/
unsigned int n_nonzero_elements () const;
+ /**
+ * Return whether this object stores only
+ * those entries that have been added
+ * explicitly, or if the sparsity pattern
+ * contains elements that have been added
+ * through other means (implicitly) while
+ * building it. For the current class,
+ * the result is always true.
+ *
+ * This function mainly serves the
+ * purpose of describing the current
+ * class in cases where several kinds of
+ * sparsity patterns can be passed as
+ * template arguments.
+ */
+ static
+ bool stores_only_added_elements ();
+
private:
/**
* Number of rows that this sparsity
+inline
+bool
+CompressedSparsityPattern::stores_only_added_elements ()
+{
+ return true;
+}
+
+
+
DEAL_II_NAMESPACE_CLOSE
* the diagonal storage optimization.
*/
bool optimize_diagonal () const;
+
+ /**
+ * Return whether this object stores only
+ * those entries that have been added
+ * explicitly, or if the sparsity pattern
+ * contains elements that have been added
+ * through other means (implicitly) while
+ * building it. For the current class,
+ * the result is true iff optimize_diag
+ * in the constructor or reinit() calls
+ * has been set to false, or if the
+ * represented matrix is not square.
+ *
+ * This function mainly serves the
+ * purpose of describing the current
+ * class in cases where several kinds of
+ * sparsity patterns can be passed as
+ * template arguments.
+ */
+ bool stores_only_added_elements () const;
/**
* Use the METIS partitioner to generate
}
+inline
+bool
+SparsityPattern::stores_only_added_elements () const
+{
+ if ((diagonal_optimized == true)
+ &&
+ (n_cols() == n_rows()))
+ return false;
+ else
+ return true;
+}
+
+
inline
const std::size_t *
SparsityPattern::get_rowstart_indices () const
}
+
+bool
+ChunkSparsityPattern::stores_only_added_elements () const
+{
+ if (chunk_size == 1)
+ return sparsity_pattern.stores_only_added_elements ();
+ else
+ return false;
+}
+
+
+
void
ChunkSparsityPattern::block_write (std::ostream &out) const
{