File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -85,13 +85,17 @@ namespace MAST {
85
85
void scale_eigenvectors_to_identity_innerproduct () {
86
86
libmesh_assert (info_val == 0 );
87
87
88
- // scale the right eigenvectors so that they all have the same norm
89
- Real l2 = this -> VR . col ( 0 ). norm () ;
88
+ // scale the right eigenvectors so that they all have unit norm
89
+ Real l2 = 0 . ;
90
90
91
- libmesh_assert (l2 > 0 .);
92
-
93
- for (unsigned int i=1 ; i<this ->VR .cols (); i++)
94
- this ->VR .col (i) *= l2 / this ->VR .col (i).norm ();
91
+ for (unsigned int i=0 ; i<this ->VR .cols (); i++) {
92
+
93
+ l2 = this ->VR .col (i).norm ();
94
+ libmesh_assert (l2 > 0 .);
95
+
96
+ // scale all right eigenvectors to unit length
97
+ this ->VR .col (i) /= l2;
98
+ }
95
99
96
100
// this product should be an identity matrix
97
101
ComplexMatrixX r = this ->VL .conjugate ().transpose () * _B * this ->VR ;
@@ -102,7 +106,7 @@ namespace MAST {
102
106
for (unsigned int i=0 ; i<_B.cols (); i++) {
103
107
val = r (i,i);
104
108
if (std::abs (val) > 0 .)
105
- this ->VR .col (i) *= (1 ./val);
109
+ this ->VL .col (i) *= (1 ./val);
106
110
}
107
111
}
108
112
You can’t perform that action at this time.
0 commit comments