1 #include "RBGen_Utils.h"
3 #include "Epetra_LAPACK.h"
4 #include "Epetra_LocalMap.h"
5 #include "Epetra_MultiVector.h"
15 if (S.NumVectors() != T.NumVectors()) {
19 int m = S.NumVectors(), n = T.NumVectors();
20 int num_vecs = ( m < n ? m : n );
21 double U[ 1 ], Vt[ 1 ];
23 std::vector<double> work( lwork );
24 std::vector<double> theta( num_vecs );
28 info = Pvec.Multiply(
'T',
'N', 1.0, S, T, 0.0 );
32 lapack.
GESVD(
'N',
'N', num_vecs, num_vecs, Pvec.Values(), Pvec.Stride(),
33 &theta[0], U, 1, Vt, 1, &work[0], &lwork, &info );
35 return (acos( theta[num_vecs-1] ) );
void GESVD(const char JOBU, const char JOBVT, const int M, const int N, float *A, const int LDA, float *S, float *U, const int LDU, float *VT, const int LDVT, float *WORK, const int *LWORK, int *INFO) const
double BasisAngle(const Epetra_MultiVector &S, const Epetra_MultiVector &T)
Method for computing the angle between two subspaces represented as Epetra_MultiVector bases...