}
+template<typename number, typename vnumber>
+ProductSparseMatrix<number, vnumber>::ProductSparseMatrix()
+ :
+ m1(0, typeid(*this).name()),
+ m2(0, typeid(*this).name()),
+ mem(0, typeid(*this).name())
+{}
+
+
+template<typename number, typename vnumber>
+void
+ProductSparseMatrix<number, vnumber>::initialize(
+ const MatrixType& mat1,
+ const MatrixType& mat2,
+ VectorMemory<VectorType>& memory)
+{
+ Assert(mat1.n() == mat2.m(), ExcDimensionMismatch(mat1.n(),mat2.m()));
+ mem = &memory;
+ m1 = &mat1;
+ m2 = &mat2;
+}
+
+
+template<typename number, typename vnumber>
+void
+ProductSparseMatrix<number, vnumber>::clear()
+{
+ m1 = 0;
+ m2 = 0;
+}
+
+
template<typename number, typename vnumber>
void
ProductSparseMatrix<number, vnumber>::vmult (VectorType& dst, const VectorType& src) const
{
+ Assert(mem != 0, ExcNotInitialized());
+ Assert(m1 != 0, ExcNotInitialized());
+ Assert(m2 != 0, ExcNotInitialized());
+
VectorType* v = mem->alloc();
v->reinit(m1->n());
m2->vmult (*v, src);
void
ProductSparseMatrix<number, vnumber>::vmult_add (VectorType& dst, const VectorType& src) const
{
+ Assert(mem != 0, ExcNotInitialized());
+ Assert(m1 != 0, ExcNotInitialized());
+ Assert(m2 != 0, ExcNotInitialized());
+
VectorType* v = mem->alloc();
v->reinit(m1->n());
m2->vmult (*v, src);
void
ProductSparseMatrix<number, vnumber>::Tvmult (VectorType& dst, const VectorType& src) const
{
+ Assert(mem != 0, ExcNotInitialized());
+ Assert(m1 != 0, ExcNotInitialized());
+ Assert(m2 != 0, ExcNotInitialized());
+
VectorType* v = mem->alloc();
v->reinit(m1->n());
m1->Tvmult (*v, src);
void
ProductSparseMatrix<number, vnumber>::Tvmult_add (VectorType& dst, const VectorType& src) const
{
+ Assert(mem != 0, ExcNotInitialized());
+ Assert(m1 != 0, ExcNotInitialized());
+ Assert(m2 != 0, ExcNotInitialized());
+
VectorType* v = mem->alloc();
v->reinit(m1->n());
m1->Tvmult (*v, src);