* Row number of the element represented by this object. This function can
* only be called for entries for which is_valid_entry() is true.
*/
- unsigned int
+ size_type
row() const;
/**
* Column number of the element represented by this object. This function
* can only be called for entries for which is_valid_entry() is true.
*/
- unsigned int
+ size_type
column() const;
/**
/**
* Current chunk row number.
*/
- unsigned int chunk_row;
+ size_type chunk_row;
/**
* Current chunk col number.
*/
- unsigned int chunk_col;
+ size_type chunk_col;
/**
* Move the accessor to the next nonzero entry in the matrix.
* these iterators) must be a container itself that provides functions
* <tt>begin</tt> and <tt>end</tt> designating a range of iterators that
* describe the contents of one line. Dereferencing these inner iterators
- * must either yield a pair of an unsigned integer as column index and a
+ * must either yield a pair of a scalar as column index and a
* value of arbitrary type (such a type would be used if we wanted to
- * describe a sparse matrix with one such object), or simply an unsigned
- * integer (of we only wanted to describe a sparsity pattern). The function
- * is able to determine itself whether an unsigned integer or a pair is what
- * we get after dereferencing the inner iterators, through some template
- * magic.
+ * describe a sparse matrix with one such object), or simply a scalar (if we
+ * only wanted to describe a sparsity pattern). The function is able to
+ * determine itself whether a scalar or a pair is what we get after
+ * dereferencing the inner iterators, through some template magic.
*
* While the order of the outer iterators denotes the different rows of the
* matrix, the order of the inner iterator denoting the columns does not
* Note that this example works since the iterators dereferenced yield
* containers with functions <tt>begin</tt> and <tt>end</tt> (namely
* <tt>std::vector</tt>s), and the inner iterators dereferenced yield
- * unsigned integers as column indices. Note that we could have replaced
+ * scalars as column indices. Note that we could have replaced
* each of the two <tt>std::vector</tt> occurrences by <tt>std::list</tt>,
* and the inner one by <tt>std::set</tt> as well.
*
* @endcode
*
* This example works because dereferencing iterators of the inner type
- * yields a pair of unsigned integers and a value, the first of which we
+ * yields a pair of scalars and a value, the first of which we
* take as column index. As previously, the outer <tt>std::vector</tt> could
- * be replaced by <tt>std::list</tt>, and the inner <tt>std::map<unsigned
- * int,double></tt> could be replaced by <tt>std::vector<std::pair<unsigned
- * int,double> ></tt>, or a list or set of such pairs, as they all return
- * iterators that point to such pairs.
+ * be replaced by <tt>std::list</tt>, and the inner
+ * <tt>std::map<size_type,double></tt> could be replaced by
+ * <tt>std::vector<std::pair<size_type,double> ></tt>, or a list or set of
+ * such pairs, as they all return iterators that point to such pairs.
*/
template <typename ForwardIterator>
void
*/
template <typename Sparsity>
void
- create_from(const unsigned int m,
- const unsigned int n,
- const Sparsity & sparsity_pattern_for_chunks,
- const unsigned int chunk_size,
- const bool optimize_diagonal = true);
+ create_from(const size_type m,
+ const size_type n,
+ const Sparsity &sparsity_pattern_for_chunks,
+ const size_type chunk_size,
+ const bool optimize_diagonal = true);
/**
* Return whether the object is empty. It is empty if no memory is
* that case.
*/
iterator
- begin(const unsigned int r) const;
+ begin(const size_type r) const;
/**
* Final iterator of row <tt>r</tt>. It points to the first element past the
* matrix.
*/
iterator
- end(const unsigned int r) const;
+ end(const size_type r) const;
/**
* Write the data of this object en bloc to a file. This is done in a binary
* Exception
*/
DeclException1(ExcInvalidNumber,
- int,
+ size_type,
<< "The provided number is invalid here: " << arg1);
/**
* Exception
*/
DeclException2(ExcInvalidIndex,
- int,
- int,
+ size_type,
+ size_type,
<< "The given index " << arg1 << " should be less than "
<< arg2 << ".");
/**
* Exception
*/
DeclException2(ExcNotEnoughSpace,
- int,
- int,
+ size_type,
+ size_type,
<< "Upon entering a new entry to row " << arg1
<< ": there was no free entry any more. " << std::endl
<< "(Maximum number of entries for this row: " << arg2
* Exception
*/
DeclException2(ExcIteratorRange,
- int,
- int,
+ size_type,
+ size_type,
<< "The iterators denote a range of " << arg1
<< " elements, but the given number of rows was " << arg2);
/**
* Exception
*/
DeclException1(ExcInvalidNumberOfPartitions,
- int,
+ size_type,
<< "The number of partitions you gave is " << arg1
<< ", but must be greater than zero.");
/**
* Exception
*/
DeclException2(ExcInvalidArraySize,
- int,
- int,
+ size_type,
+ size_type,
<< "The array has size " << arg1 << " but should have size "
<< arg2);
//@}
- inline unsigned int
+ inline Accessor::size_type
Accessor::row() const
{
Assert(is_valid_entry() == true, ExcInvalidIterator());
- inline unsigned int
+ inline Accessor::size_type
Accessor::column() const
{
Assert(is_valid_entry() == true, ExcInvalidIterator());
reduced_accessor.container->n_nonzero_elements())
return true;
- const unsigned int global_row = sparsity_pattern->get_chunk_size() *
- reduced_accessor.row() +
- chunk_row,
- other_global_row =
- sparsity_pattern->get_chunk_size() *
- other.reduced_accessor.row() +
- other.chunk_row;
+ const auto global_row = sparsity_pattern->get_chunk_size() *
+ reduced_accessor.row() +
+ chunk_row,
+ other_global_row = sparsity_pattern->get_chunk_size() *
+ other.reduced_accessor.row() +
+ other.chunk_row;
if (global_row < other_global_row)
return true;
else if (global_row > other_global_row)
inline void
Accessor::advance()
{
- const unsigned int chunk_size = sparsity_pattern->get_chunk_size();
+ const auto chunk_size = sparsity_pattern->get_chunk_size();
Assert(chunk_row < chunk_size && chunk_col < chunk_size,
ExcIteratorPastEnd());
Assert(reduced_accessor.row() * chunk_size + chunk_row <
reduced_accessor.column() * chunk_size + chunk_col ==
sparsity_pattern->n_cols())
{
- const unsigned int reduced_row = reduced_accessor.row();
+ const auto reduced_row = reduced_accessor.row();
// end of row
if (reduced_accessor.linear_index + 1 ==
reduced_accessor.container->rowstart[reduced_row + 1])
inline ChunkSparsityPattern::iterator
-ChunkSparsityPattern::begin(const unsigned int r) const
+ChunkSparsityPattern::begin(const size_type r) const
{
Assert(r < n_rows(), ExcIndexRange(r, 0, n_rows()));
return {this, r};
inline ChunkSparsityPattern::iterator
-ChunkSparsityPattern::end(const unsigned int r) const
+ChunkSparsityPattern::end(const size_type r) const
{
Assert(r < n_rows(), ExcIndexRange(r, 0, n_rows()));
return {this, r + 1};