*/
typedef const SparseMatrix<number> MatrixType;
- /**
- * Create a typedef for the non-const
- * version of this accessor. This is
- * only used in one place, but is
- * needed to work around a problem in
- * gcc 2.95 and 3.0.
- */
- typedef
- internals::SparseMatrixIterators::Accessor<number,false>
- NonConstAccessor;
-
/**
* Constructor.
*/
* non-const accessor to a const
* accessor.
*/
- Accessor (const NonConstAccessor &a);
+ Accessor (const internals::SparseMatrixIterators::Accessor<number,false> &a);
/**
* Value of this matrix entry.
* reference.
*/
MatrixType & get_matrix () const;
-
+
private:
/**
* Pointer to the matrix we use.
*/
MatrixType *matrix;
+
+ /**
+ * Make the advance function of the
+ * base class available.
+ */
+ using SparsityPatternIterators::Accessor::advance;
+
+ /**
+ * Make iterator class a friend.
+ */
+ template <typename, bool>
+ friend class Iterator;
};
*/
MatrixType *matrix;
+ /**
+ * Make the advance function of the
+ * base class available.
+ */
+ using SparsityPatternIterators::Accessor::advance;
+
+ /**
+ * Make iterator class a friend.
+ */
+ template <typename, bool>
+ friend class Iterator;
+
/**
* Make the inner reference class a
* friend if the compiler has a bug
typedef
typename Accessor<number,Constness>::MatrixType
MatrixType;
-
-
- /**
- * Create a typedef for the non-const
- * version of this iterator. This is
- * only used in one place, but is
- * needed to work around a problem in
- * gcc 2.95 and 3.0.
- */
- typedef
- internals::SparseMatrixIterators::Iterator<number,false>
- NonConstIterator;
/**
* Constructor. Create an iterator
* Conversion constructor to get from
* a non-const iterator to a const
* iterator.
- *
- * (Note: the fact that we fully
- * specialize the namespace of the
- * accessor class is to work around a
- * bug in gcc 2.95 and 3.0. We really
- * mean the present class, but with
- * different template arguments.)
*/
- Iterator (const NonConstIterator &i);
+ Iterator (const internals::SparseMatrixIterators::Iterator<number,false> &i);
/**
* Prefix increment.
template <typename number>
inline
Accessor<number,true>::
- Accessor (const NonConstAccessor &a)
+ Accessor (const internals::SparseMatrixIterators::Accessor<number,false> &a)
:
SparsityPatternIterators::Accessor (a),
matrix (&a.get_matrix())
template <typename number, bool Constness>
inline
Iterator<number, Constness>::
- Iterator (const NonConstIterator &i)
+ Iterator (const internals::SparseMatrixIterators::Iterator<number,false> &i)
:
accessor(*i)
{}
*/
bool operator < (const Accessor &) const;
- /**
- * Move the accessor to the next
- * nonzero entry in the matrix. This
- * function should actually only be
- * called from iterator classes, but
- * due to various problems with
- * friends and templates in gcc 2.95,
- * we can't make it protected. Don't
- * use it in your own programs.
- */
- void advance ();
-
/** @addtogroup Exceptions
* @{ */
*/
unsigned int a_index;
+ /**
+ * Move the accessor to the next
+ * nonzero entry in the matrix.
+ */
+ void advance ();
+
/**
* Grant access to iterator class.
*/