<h3>Specific improvements</h3>
<ol>
+
+<li> New: SparsityPattern::row_position() finds a column index in a row and returns
+its "local" index or numbers::invalid_unsigned_int.
+<br>
+(Guido Kanschat, 2011/09/26)
+
+<li> New: There is now a function GridTools::volume() computing the volume
+
<li> New: The function Utilities::MPI::sum
function can be used to compute the sum of values over a number of
MPI processes without having to deal with the underlying MPI functions.
static const unsigned int invalid_entry = numbers::invalid_unsigned_int;
/**
- * @name Functions generating and
- * filling a SparsityPattern.
+ * @name Construction and setup
+ * Constructors, destructor; functions initializing, copying and filling an object.
*/
// @{
/**
bool exists (const unsigned int i,
const unsigned int j) const;
+ /**
+ * The index of a global matrix
+ * entry in its row.
+ *
+ * This function is analogous to
+ * operator(), but it computes
+ * the index not with respect to
+ * the total field, but only with
+ * respect to the row <tt>j</tt>.
+ */
+ unsigned int row_position(const unsigned int i,
+ const unsigned int j) const;
+
/**
* Access to column number field.
* Return the column number of
// @{
/**
* @deprecated
- *
* This function is deprecated. Use
* SparsityTools::partition instead.
*
/**
- * This is kind of an expert mode. Get
+ * @deprecated This is kind of an expert mode. Get
* access to the rowstart array, but
* read-only.
*
inline const unsigned int * get_column_numbers () const;
BOOST_SERIALIZATION_SPLIT_MEMBER()
-
/** @addtogroup Exceptions
+ * @name Exceptions
* @{ */
/**
* You tried to add an element to
bool
-SparsityPattern::exists (const unsigned int i,
- const unsigned int j) const
+SparsityPattern::exists (const unsigned int i, const unsigned int j) const
{
Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
Assert (i<rows, ExcIndexRange(i,0,rows));
+unsigned int
+SparsityPattern::row_position (const unsigned int i, const unsigned int j) const
+{
+ Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
+ Assert (i<rows, ExcIndexRange(i,0,rows));
+ Assert (j<cols, ExcIndexRange(j,0,cols));
+
+ for (unsigned int k=rowstart[i]; k<rowstart[i+1]; k++)
+ {
+ // entry exists
+ if (colnums[k] == j) return k-rowstart[i];
+ }
+ return numbers::invalid_unsigned_int;
+}
+
+
+
std::pair<unsigned int, unsigned int>
SparsityPattern::matrix_position (const unsigned int global_index) const
{