#include "slepcbv.h" PetscErrorCode BVMatProject(BV X,Mat A,BV Y,Mat M)Collective
X | - basis vectors | |
A | - (optional) matrix to be projected | |
Y | - left basis vectors, can be equal to X |
M | - the resulting matrix |
This operation is similar to BVDot(), with important differences. The goal is to compute the matrix resulting from the orthogonal projection of A onto the subspace spanned by the columns of X, M = X^H*A*X, or the oblique projection onto X along Y, M = Y^H*A*X.
A difference with respect to BVDot() is that the standard inner product is always used, regardless of a non-standard inner product being specified with BVSetMatrix().
On entry, M must be a sequential dense Mat with dimensions ky,kx at least, where ky (resp. kx) is the number of active columns of Y (resp. X). Another difference with respect to BVDot() is that all entries of M are computed except the leading ly,lx part, where ly (resp. lx) is the number of leading columns of Y (resp. X). Hence, the leading columns of X and Y participate in the computation, as opposed to BVDot(). The leading part of M is assumed to be already available from previous computations.
In the orthogonal projection case, Y=X, some computation can be saved if A is real symmetric (or complex Hermitian). In order to exploit this property, the symmetry flag of A must be set with MatSetOption().