]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGMatrix.cpp
Fixes to jsbsim.
[flightgear.git] / src / FDM / JSBSim / FGMatrix.cpp
index 6e51fa17d633cb70852e6a56066f1fe3f0f9f2d6..5b4f5da10ba5937b5f0495d92a53517c19144544 100644 (file)
@@ -344,22 +344,24 @@ FGMatrix FGMatrix::operator/(const double scalar)
       }
     }
     
-  }
-  return Quot;
+  } else
+    cerr << "Attempt to divide by zero in method FGMatrix::operator/(const double scalar), object at " << this << endl; 
+  return Quot;  
 }
 
 /******************************************************************************/
 
 void FGMatrix::operator/=(const double scalar)
 {
-
+  
   if(scalar != 0) {
     for (unsigned int i=1; i<=Rows(); i++)  {
       for (unsigned int j=1; j<=Cols(); j++) {
         data[i][j]/=scalar;
       }
     }
-  }
+  } else 
+    cerr << "Attempt to divide by zero in method FGMatrix::operator/=(const double scalar), object " << this << endl; 
 }
 
 /******************************************************************************/
@@ -519,9 +521,15 @@ FGColumnVector FGColumnVector::operator/(const double scalar)
 {
   FGColumnVector Quotient(Rows());
   if(scalar != 0) {
+    
+
     for (unsigned int i=1; i<=Rows(); i++) Quotient(i) = data[i][1] / scalar;
-  }
+
+  } else 
+    cerr << "Attempt to divide by zero in method FGColumnVector::operator/(const double scalar), object " << this << endl; 
   return Quotient;
+  
+    
 }
 
 /******************************************************************************/