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 {
8585 void scale_eigenvectors_to_identity_innerproduct () {
8686 libmesh_assert (info_val == 0 );
8787
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 . ;
9090
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+ }
9599
96100 // this product should be an identity matrix
97101 ComplexMatrixX r = this ->VL .conjugate ().transpose () * _B * this ->VR ;
@@ -102,7 +106,7 @@ namespace MAST {
102106 for (unsigned int i=0 ; i<_B.cols (); i++) {
103107 val = r (i,i);
104108 if (std::abs (val) > 0 .)
105- this ->VR .col (i) *= (1 ./val);
109+ this ->VL .col (i) *= (1 ./val);
106110 }
107111 }
108112
You can’t perform that action at this time.
0 commit comments