Commits

Alberto Passalacqua  committed 9d44ce3
  • Participants
  • Parent commits a398bea

Comments (0)

Files changed (1)

File eigenSolver.C

 
 bool Foam::eigenSolver::isSymmetric(const scalarSquareMatrix& A)
 {
-    bool symm = true;
-
     for (label j = 0; (j < n_) && symm; j++)
     {
 	for (label i = 0; (i < n_) && symm; i++)
 	{
-	    symm = (A[i][j] == A[j][i]);
+	    if (A[i][j] != A[j][i])
+	    {
+		return false;
+	    }
 	}
     }
 
-    return symm;
+    return true;
 }
 
 void Foam::eigenSolver::tridiagonaliseSymmMatrix()
 	    {
 		g = -g;
 	    }
-	    
+
 	    h -= orth_[m]*g;
 	    orth_[m] -= g;
 
 	    eigenvaluesIm_[n] = scalar(0);
 	    n--;
 	    iter = 0;
-	} 
+	}
 	else if (l == n-1)	// Two roots found
 	{
 	    w = H_[n][n-1]*H_[n-1][n];
                     q = H_[k+1][k-1];
                     r = (notlast ? H_[k+2][k-1] : 0.0);
                     x = mag(p) + mag(q) + mag(r);
-		    
+
                     if (x != 0.0)
                     {
                         p /= x;