* If <tt>M</tt> is zero, no
* matrix is stored.
*
- * If <tt>mem</tt> is zero, a
- * PrimitiveVectorMemory is
- * generated.
+ * If <tt>mem</tt> is zero, the
+ * VectorMemory::default_pool()
+ * is used.
*/
PointerMatrixAux (VectorMemory<VECTOR>* mem = 0,
const MATRIX* M=0);
/**
- * Constructor. The name argument
- * is used to identify the
+ * Constructor not using a
+ * matrix. The name argument is
+ * used to identify the
* SmartPointer for this object.
*/
PointerMatrixAux(VectorMemory<VECTOR>* mem,
const char* name);
-
+
/**
* Constructor. <tt>M</tt> points
* to a matrix which must live
/**
* The backup memory if none was provided.
*/
- PrimitiveVectorMemory<VECTOR> my_memory;
+ mutable PrimitiveVectorMemory<VECTOR> my_memory;
/**
* Object for getting the
* auxiliary vector.
*/
- SmartPointer<VectorMemory<VECTOR> > mem;
+ mutable SmartPointer<VectorMemory<VECTOR> > mem;
/**
* The pointer to the actual matrix.
m(M, typeid(*this).name())
{
if (mem == 0)
- mem = &my_memory;
+ mem = &VectorMemory<VECTOR>::default_pool();
}
m(0, name)
{
if (mem == 0)
- mem = &my_memory;
+ mem = &VectorMemory<VECTOR>::default_pool();
}
m(M, name)
{
if (mem == 0)
- mem = &my_memory;
+ mem = &VectorMemory<VECTOR>::default_pool();
}
PointerMatrixAux<MATRIX, VECTOR>::vmult (VECTOR& dst,
const VECTOR& src) const
{
+ if (mem == 0)
+ mem = &my_memory;
Assert (mem != 0, ExcNotInitialized());
Assert (m != 0, ExcNotInitialized());
m->vmult (dst, src);
PointerMatrixAux<MATRIX, VECTOR>::Tvmult (VECTOR& dst,
const VECTOR& src) const
{
+ if (mem == 0)
+ mem = &my_memory;
Assert (mem != 0, ExcNotInitialized());
Assert (m != 0, ExcNotInitialized());
m->Tvmult (dst, src);
PointerMatrixAux<MATRIX, VECTOR>::vmult_add (VECTOR& dst,
const VECTOR& src) const
{
+ if (mem == 0)
+ mem = &my_memory;
Assert (mem != 0, ExcNotInitialized());
Assert (m != 0, ExcNotInitialized());
VECTOR* v = mem->alloc();
PointerMatrixAux<MATRIX, VECTOR>::Tvmult_add (VECTOR& dst,
const VECTOR& src) const
{
+ if (mem == 0)
+ mem = &my_memory;
Assert (mem != 0, ExcNotInitialized());
Assert (m != 0, ExcNotInitialized());
VECTOR* v = mem->alloc();