<< " by " << arg2
<< " has remainder different from zero");
+ /**
+ * This exception is thrown if the
+ * iterator you access has
+ * corrupted data. It might for
+ * instance be, that the container
+ * it refers does not have an entry
+ * at the point the iterator
+ * refers.
+ *
+ * Typically, this will be an
+ * internal error of deal.II,
+ * because the increment and
+ * decrement operators should never
+ * yield an invalid iterator.
+ */
+ DeclException0 (ExcInvalidIterator);
+
/**
* This exception is thrown if the
* iterator you incremented or
* matrix.
*
* The general template is not
- * implemented, only the specializations
- * for the two possible values of the
- * second template argument.
+ * implemented, only the
+ * specializations for the two
+ * possible values of the second
+ * template argument. Therefore,
+ * the interface listed here only
+ * serves as a template provided
+ * since doxygen does not link the
+ * specializations.
*/
template <typename number, bool Constness>
- class Accessor;
+ class Accessor : public SparsityPatternIterators::Accessor
+ {
+ public:
+ /**
+ * Value of this matrix entry.
+ */
+ number value() const;
+
+ /**
+ * Value of this matrix entry.
+ */
+ number& value();
+
+ /**
+ * Return a reference to the matrix
+ * into which this accessor
+ * points. Note that in the present
+ * case, this is a constant
+ * reference.
+ */
+ const SparseMatrix<number>& get_matrix () const;
+ };
+
/**
/** @addtogroup Exceptions
* @{ */
- /**
- * Exception
- */
- DeclException0 (ExcInvalidIterator);
//@}
protected:
/**
/** @addtogroup Exceptions
* @{ */
/**
- * Exception
- */
- DeclException1 (ExcInvalidNumber,
- int,
- << "The provided number is invalid here: " << arg1);
- /**
- * Exception
- */
- DeclException2 (ExcInvalidIndex,
- int, int,
- << "The given index " << arg1
- << " should be less than " << arg2 << ".");
- /**
- * Exception
+ * You tried to add an element to
+ * a row, but there was no space left.
*/
DeclException2 (ExcNotEnoughSpace,
int, int,
<< "(Maximum number of entries for this row: "
<< arg2 << "; maybe the matrix is already compressed?)");
/**
- * Exception
+ * The operation is only allowed
+ * after the SparsityPattern has
+ * been set up and compress() was
+ * called.
*/
DeclException0 (ExcNotCompressed);
/**
- * Exception
+ * This operation changes the
+ * structure of the
+ * SparsityPattern and is not
+ * possible after compress() has
+ * been called.
*/
DeclException0 (ExcMatrixIsCompressed);
/**
* Exception
*/
- DeclException0 (ExcEmptyObject);
- /**
- * Exception
- */
DeclException0 (ExcInvalidConstructorCall);
/**
* This exception is thrown if
int,
<< "The number of partitions you gave is " << arg1
<< ", but must be greater than zero.");
- /**
- * Exception
- */
- DeclException2 (ExcInvalidArraySize,
- int, int,
- << "The array has size " << arg1 << " but should have size "
- << arg2);
//@}
private:
/**
{}
+ inline
+ bool
+ Accessor::is_valid_entry () const
+ {
+ return (sparsity_pattern
+ ->get_column_numbers()[sparsity_pattern
+ ->get_rowstart_indices()[a_row]+a_index]
+ != SparsityPattern::invalid_entry);
+ }
+
+
inline
unsigned int
Accessor::row() const
- inline
- bool
- Accessor::is_valid_entry () const
- {
- return (sparsity_pattern
- ->get_column_numbers()[sparsity_pattern
- ->get_rowstart_indices()[a_row]+a_index]
- != SparsityPattern::invalid_entry);
- }
-
-
inline
bool
{
const unsigned int col
= internal::SparsityPatternTools::get_column_index_from_iterator(*j);
- Assert (col < n_cols, ExcInvalidIndex(col,n_cols));
+ Assert (col < n_cols, ExcIndexRange(col,0,n_cols));
if ((col!=row) || !is_square)
*cols++ = col;
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
const VectorSlice<const std::vector<unsigned int> >&row_lengths,
const bool optimize_diag)
{
- Assert (row_lengths.size() == m, ExcInvalidNumber (m));
+ AssertDimension (row_lengths.size(), m);
rows = m;
cols = n;
for (unsigned int j=0; j<row_length; ++j)
{
const unsigned int col = csp.column_number(row,j);
- Assert (col < csp.n_cols(), ExcInvalidIndex(col,csp.n_cols()));
+ Assert (col < csp.n_cols(), ExcIndexRange(col,0,csp.n_cols()));
if ((col!=row) || !is_square)
*cols++ = col;
for (; col_num != csp.row_end (row); ++col_num)
{
const unsigned int col = *col_num;
- //Assert (col < csp.n_cols(), ExcInvalidIndex(col,csp.n_cols()));
-
if ((col!=row) || !is_square)
*cols++ = col;
}
for (unsigned int j=0; j<row_length; ++j)
{
const unsigned int col = csp.column_number(row,j);
- Assert (col < csp.n_cols(), ExcInvalidIndex(col,csp.n_cols()));
+ Assert (col < csp.n_cols(), ExcIndexRange(col,0,csp.n_cols()));
if ((col!=row) || !is_square)
*cols++ = col;
const unsigned int j) const
{
Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
- Assert (i<rows, ExcInvalidIndex(i,rows));
- Assert (j<cols, ExcInvalidIndex(j,cols));
+ Assert (i<rows, ExcIndexRange(i,0,rows));
+ Assert (j<cols, ExcIndexRange(j,0,cols));
Assert (compressed, ExcNotCompressed());
// let's see whether there is
const unsigned int j)
{
Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
- Assert (i<rows, ExcInvalidIndex(i,rows));
- Assert (j<cols, ExcInvalidIndex(j,cols));
+ Assert (i<rows, ExcIndexRange(i,0,rows));
+ Assert (j<cols, ExcIndexRange(j,0,cols));
Assert (compressed==false, ExcMatrixIsCompressed());
for (unsigned int k=rowstart[i]; k<rowstart[i+1]; k++)