VectorMemory<VECTOR>& m)
: mem(&m, typeid(*this).name())
{
- m1 = new PointerMatrix<MATRIX1, VECTOR>(&mat1);
- m2 = new PointerMatrix<MATRIX2, VECTOR>(&mat2);
+ m1 = new PointerMatrix<MATRIX1, VECTOR>(&mat1, typeid(*this).name());
+ m2 = new PointerMatrix<MATRIX2, VECTOR>(&mat2, typeid(*this).name());
}
{
delete m1;
delete m2;
- m1 = new PointerMatrix<MATRIX1, VECTOR>(&mat1);
- m2 = new PointerMatrix<MATRIX2, VECTOR>(&mat2);
+ m1 = new PointerMatrix<MATRIX1, VECTOR>(&mat1, typeid(*this).name());
+ m2 = new PointerMatrix<MATRIX2, VECTOR>(&mat2, typeid(*this).name());
}
/**
* Matrix-vector product, adding to
- * @p dst.
+ * <tt>dst</tt>.
*/
virtual void vmult_add (VECTOR& dst,
const VECTOR& src) const = 0;
/**
* Tranposed matrix-vector product,
- * adding to @p dst.
+ * adding to <tt>dst</tt>.
*/
virtual void Tvmult_add (VECTOR& dst,
const VECTOR& src) const = 0;
* argument is stored in this
* class. As usual, the lifetime of
* <tt>*M</tt> must be longer than the
- * one of the @p PointerMatrix.
+ * one of the PointerMatrix.
*
- * If @p M is zero, no matrix is stored.
+ * If <tt>M</tt> is zero, no
+ * matrix is stored.
*/
PointerMatrix (const MATRIX* M=0);
+
+ /**
+ * Constructor. The name argument
+ * is used to identify the
+ * SmartPointer for this object.
+ */
+ PointerMatrix(const char* name);
+
+ /**
+ * Constructor. <tt>M</tt> points
+ * to a matrix which must live
+ * longer than the
+ * PointerMatrix. The name
+ * argument is used to identify
+ * the SmartPointer for this
+ * object.
+ */
+ PointerMatrix(const MATRIX* M,
+ const char* name);
/**
* Return whether the object is
/**
* Matrix-vector product, adding to
- * @p dst.
+ * <tt>dst</tt>.
*/
virtual void vmult_add (VECTOR& dst,
const VECTOR& src) const;
/**
* Tranposed matrix-vector product,
- * adding to @p dst.
+ * adding to <tt>dst</tt>.
*/
virtual void Tvmult_add (VECTOR& dst,
const VECTOR& src) const;
}
+//----------------------------------------------------------------------//
+
template<class MATRIX, class VECTOR>
PointerMatrix<MATRIX, VECTOR>::PointerMatrix (const MATRIX* M)
- :
- m(M, typeid(*this).name())
+ : m(M, typeid(*this).name())
+{}
+
+
+template<class MATRIX, class VECTOR>
+PointerMatrix<MATRIX, VECTOR>::PointerMatrix (const char* name)
+ : m(0, name)
+{}
+
+
+template<class MATRIX, class VECTOR>
+PointerMatrix<MATRIX, VECTOR>::PointerMatrix (
+ const MATRIX* M,
+ const char* name)
+ : m(M, name)
{}
+
template<class MATRIX, class VECTOR>
inline const PointerMatrix<MATRIX, VECTOR>&
PointerMatrix<MATRIX, VECTOR>::operator= (const MATRIX* M)