* @author Guido Kanschat, 2002
*/
template <class MATRIX, class VECTOR>
-class MGMatrix : public MGMatrixBase<VECTOR>,
- public SmartPointer<MGLevelObject<MATRIX> >
+class MGMatrix : public MGMatrixBase<VECTOR>
{
public:
/**
*/
virtual void Tvmult_add(unsigned int level, VECTOR& dst,
const VECTOR& src) const;
+
+private:
+ /**
+ * Pointer to the matrix objects on each level.
+ */
+ SmartPointer<MGLevelObject<MATRIX> > matrix;
};
* @author Guido Kanschat, 2002
*/
template <class MATRIX, typename number>
-class MGMatrixSelect : public MGMatrixBase<Vector<number> >,
- public SmartPointer<MGLevelObject<MATRIX> >
+class MGMatrixSelect : public MGMatrixBase<Vector<number> >
{
public:
/**
const Vector<number>& src) const;
private:
+ /**
+ * Pointer to the matrix objects on each level.
+ */
+ SmartPointer<MGLevelObject<MATRIX> > matrix;
/**
* Row coordinate of selected block.
*/
template <class MATRIX, class VECTOR>
MGMatrix<MATRIX, VECTOR>::MGMatrix (MGLevelObject<MATRIX>* p)
:
- SmartPointer<MGLevelObject<MATRIX> > (p)
+ matrix (p)
{}
void
MGMatrix<MATRIX, VECTOR>::set_matrix (MGLevelObject<MATRIX>* p)
{
- (SmartPointer<MGLevelObject<MATRIX> >) (*this) = p;
+ matrix = p;
}
VECTOR& dst,
const VECTOR& src) const
{
- Assert((SmartPointer<MGLevelObject<MATRIX> >) *this != 0,
- ExcNotInitialized());
+ Assert(matrix != 0, ExcNotInitialized());
- const MGLevelObject<MATRIX>& m = **this;
+ const MGLevelObject<MATRIX>& m = *matrix;
m[level].vmult(dst, src);
}
VECTOR& dst,
const VECTOR& src) const
{
- Assert((SmartPointer<MGLevelObject<MATRIX> >) *this != 0,
- ExcNotInitialized());
+ Assert(matrix != 0, ExcNotInitialized());
- const MGLevelObject<MATRIX>& m = **this;
+ const MGLevelObject<MATRIX>& m = *matrix;
m[level].vmult_add(dst, src);
}
VECTOR& dst,
const VECTOR& src) const
{
- Assert((SmartPointer<MGLevelObject<MATRIX> >) *this != 0,
- ExcNotInitialized());
+ Assert(matrix != 0, ExcNotInitialized());
- const MGLevelObject<MATRIX>& m = **this;
+ const MGLevelObject<MATRIX>& m = *matrix;
m[level].Tvmult(dst, src);
}
VECTOR& dst,
const VECTOR& src) const
{
- Assert((SmartPointer<MGLevelObject<MATRIX> >) *this != 0,
- ExcNotInitialized());
+ Assert(matrix != 0, ExcNotInitialized());
- const MGLevelObject<MATRIX>& m = **this;
+ const MGLevelObject<MATRIX>& m = *matrix;
m[level].Tvmult_add(dst, src);
}
MGMatrixSelect (const unsigned int row,
const unsigned int col,
MGLevelObject<MATRIX>* p)
- :
- SmartPointer<MGLevelObject<MATRIX> > (p),
+ :
+ matrix (p),
row(row),
col(col)
{}
void
MGMatrixSelect<MATRIX, number>::set_matrix (MGLevelObject<MATRIX>* p)
{
- (SmartPointer<MGLevelObject<MATRIX> >) (*this) = p;
+ matrix = p;
}
Vector<number>& dst,
const Vector<number>& src) const
{
- Assert((SmartPointer<MGLevelObject<MATRIX> >) *this != 0,
- ExcNotInitialized());
+ Assert(matrix != 0, ExcNotInitialized());
- const MGLevelObject<MATRIX>& m = **this;
+ const MGLevelObject<MATRIX>& m = *matrix;
m[level].block(row, col).vmult(dst, src);
}
Vector<number>& dst,
const Vector<number>& src) const
{
- Assert((SmartPointer<MGLevelObject<MATRIX> >) *this != 0,
- ExcNotInitialized());
+ Assert(matrix != 0, ExcNotInitialized());
- const MGLevelObject<MATRIX>& m = **this;
+ const MGLevelObject<MATRIX>& m = *matrix;
m[level].block(row, col).vmult_add(dst, src);
}
Vector<number>& dst,
const Vector<number>& src) const
{
- Assert((SmartPointer<MGLevelObject<MATRIX> >) *this != 0,
- ExcNotInitialized());
+ Assert(matrix != 0, ExcNotInitialized());
- const MGLevelObject<MATRIX>& m = **this;
+ const MGLevelObject<MATRIX>& m = *matrix;
m[level].block(row, col).Tvmult(dst, src);
}
Vector<number>& dst,
const Vector<number>& src) const
{
- Assert((SmartPointer<MGLevelObject<MATRIX> >) *this != 0,
- ExcNotInitialized());
+ Assert(matrix != 0, ExcNotInitialized());
- const MGLevelObject<MATRIX>& m = **this;
+ const MGLevelObject<MATRIX>& m = *matrix;
m[level].block(row, col).Tvmult_add(dst, src);
}