* quadratic matrices #m1 and #m2 of arbitrary types and implements
* matrix-vector multiplications for the product
* <i>M<sub>1</sub>M<sub>2</sub></i> by performing multiplication with
- * both factors consecutively.
+ * both factors consecutively. Because the types of the matrices are
+ * opaque (i.e., they can be arbitrary), you can stack products of three
+ * or more matrices by making one of the two matrices an object of the
+ * current type handles be a ProductMatrix itself.
*
- * Here an example multiplying two different FullMatrix objects:
+ * Here is an example multiplying two different FullMatrix objects:
* @include product_matrix.cc
*
* @author Guido Kanschat, 2000, 2001, 2002, 2005
const MATRIX2 &m2,
VectorMemory<VECTOR> &mem);
+ /**
+ * Destructor.
+ */
+ ~ProductMatrix();
+
/**
* Change the matrices.
*/
void initialize(const MATRIX1 &m1, const MATRIX2 &m2,
VectorMemory<VECTOR> &mem);
- /**
- * Destructor.
- */
- ~ProductMatrix();
-
// Doc in PointerMatrixBase
void clear();
const VECTOR &v) const;
/**
- * Tranposed matrix-vector
+ * Transposed matrix-vector
* product <i>w = m2<sup>T</sup> *
* m1<sup>T</sup> * v</i>.
*/
const VECTOR &v) const;
/**
- * Adding, tranposed
+ * Adding, transposed
* matrix-vector product <i>w +=
* m2<sup>T</sup> *
* m1<sup>T</sup> * v</i>.
* Memory for auxiliary vector.
*/
SmartPointer<VectorMemory<VECTOR>,ProductMatrix<VECTOR> > mem;
+
/**
* Return some kind of
* identifier.
/**
- * A matrix that is the scaled version of another matrix.
+ * A matrix that is the multiple of another matrix.
*
* Matrix-vector products of this matrix are composed of those of the
- * original matrix and scaling by a constant factor.
+ * original matrix with the vector and then scaling of the result by
+ * a constant factor.
*
* @author Guido Kanschat, 2007
*/
/**
* Constructor leaving an
- * unitialized
+ * uninitialized
* matrix. initialize() must be
* called, before the matrix can
* be used.
const VectorType &v) const;
/**
- * Tranposed matrix-vector
+ * Transposed matrix-vector
* product <i>w = m2<sup>T</sup> *
* m1<sup>T</sup> * v</i>.
*/
const VectorType &v) const;
/**
- * Adding, tranposed
+ * Adding, transposed
* matrix-vector product <i>w +=
* m2<sup>T</sup> *
* m1<sup>T</sup> * v</i>.
* BlockVector, then an additional parameter selects a single
* component for this operation.
*
+ * In mathematical terms, this class acts as if it was the matrix
+ * $I-\frac 1n{\mathbf 1}_n{\mathbf 1}_n^T$ where ${\mathbf 1}_n$ is
+ * a vector of size $n$ that has only ones as its entries. Thus,
+ * taking the dot product between a vector $\mathbf v$ and
+ * $\frac 1n {\mathbf 1}_n$ yields the <i>mean value</i> of the entries
+ * of ${\mathbf v}$. Consequently,
+ * $ \left[I-\frac 1n{\mathbf 1}_n{\mathbf 1}_n^T\right] \mathbf v
+ * = \mathbf v - \left[\frac 1n \mathbf v} \cdot {\mathbf 1}_n\right]{\mathbf 1}_n$
+ * subtracts from every vector element the mean value of all elements.
+ *
* @author Guido Kanschat, 2002, 2003
*/
class MeanValueFilter : public Subscriptor
* Constructor, optionally
* selecting a component.
*/
- MeanValueFilter(size_type component = numbers::invalid_size_type);
+ MeanValueFilter(const size_type component = numbers::invalid_size_type);
/**
* Subtract mean value from @p v.
/**
* Component for filtering block vectors.
*/
- size_type component;
+ const size_type component;
};
* SolverRichardson::Tsolve() allows for the implementation of
* transpose matrix vector products.
*
- * The functions vmult() and Tvmult() appoximate the inverse
+ * The functions vmult() and Tvmult() approximate the inverse
* iteratively starting with the vector <tt>dst</tt>. Functions
* vmult_add() and Tvmult_add() start the iteration with a zero
* vector.
const VECTOR &src) const = 0;
/**
- * Tranposed matrix-vector product.
+ * Transposed matrix-vector product.
*/
virtual void Tvmult (VECTOR &dst,
const VECTOR &src) const = 0;
const VECTOR &src) const = 0;
/**
- * Tranposed matrix-vector product,
+ * Transposed matrix-vector product,
* adding to <tt>dst</tt>.
*/
virtual void Tvmult_add (VECTOR &dst,
const VECTOR &src) const;
/**
- * Tranposed matrix-vector product.
+ * Transposed matrix-vector product.
*/
virtual void Tvmult (VECTOR &dst,
const VECTOR &src) const;
const VECTOR &src) const;
/**
- * Tranposed matrix-vector product,
+ * Transposed matrix-vector product,
* adding to <tt>dst</tt>.
*/
virtual void Tvmult_add (VECTOR &dst,
const VECTOR &src) const;
/**
- * Tranposed matrix-vector product.
+ * Transposed matrix-vector product.
*/
virtual void Tvmult (VECTOR &dst,
const VECTOR &src) const;
const VECTOR &src) const;
/**
- * Tranposed matrix-vector product,
+ * Transposed matrix-vector product,
* adding to <tt>dst</tt>.
*/
virtual void Tvmult_add (VECTOR &dst,
const Vector<number> &src) const;
/**
- * Tranposed matrix-vector
+ * Transposed matrix-vector
* product, actually the
* multiplication of the vector
* representing this matrix with
const Vector<number> &src) const;
/**
- * Tranposed matrix-vector product,
+ * Transposed matrix-vector product,
* adding to <tt>dst</tt>.
*
* The dimension of <tt>src</tt>