public double[] e; // off diagonal
/**
+ * maximum number of iterations for tqli
+ *
+ */
+ int maxIter = 45; // fudge - add 15 iterations, just in case
+
+ /**
* Creates a new Matrix object.
*
* @param value
}
}
}
-
+
/**
* DOCUMENT ME!
*/
- public void tqli()
+ public void tqli() throws Exception
{
int n = rows;
{
iter++;
- if (iter == 30)
+ if (iter == maxIter)
{
- System.err.print("Too many iterations in tqli");
- System.exit(0); // JBPNote - should this really be here ???
+ throw new Exception("Too many iterations in tqli ("+maxIter+")");
}
else
{
/**
* DOCUMENT ME!
*/
- public void tqli2()
+ public void tqli2() throws Exception
{
int n = rows;
{
iter++;
- if (iter == 30)
+ if (iter == maxIter)
{
- System.err.print("Too many iterations in tqli");
- System.exit(0); // JBPNote - same as above - not a graceful exit!
+ throw new Exception ("Too many iterations in tqli2 (max is "+maxIter+")");
}
else
{
* @param args
* DOCUMENT ME!
*/
- public static void main(String[] args)
+ public static void main(String[] args) throws Exception
{
int n = Integer.parseInt(args[0]);
double[][] in = new double[n][n];