git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9abb0a7
)
JAL-1454 increase max for tqli iterations and throw exception rather than call System...
author
Jim Procter
<jprocter@compbio.dundee.ac.uk>
Tue, 25 Feb 2014 16:43:08 +0000
(16:43 +0000)
committer
Jim Procter
<jprocter@compbio.dundee.ac.uk>
Tue, 25 Feb 2014 16:43:08 +0000
(16:43 +0000)
src/jalview/math/Matrix.java
patch
|
blob
|
history
diff --git
a/src/jalview/math/Matrix.java
b/src/jalview/math/Matrix.java
index
057bdbf
..
8d95203
100755
(executable)
--- a/
src/jalview/math/Matrix.java
+++ b/
src/jalview/math/Matrix.java
@@
-48,6
+48,12
@@
public class Matrix
public double[] e; // off diagonal
/**
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
* Creates a new Matrix object.
*
* @param value
@@
-342,11
+348,11
@@
public class Matrix
}
}
}
}
}
}
-
+
/**
* DOCUMENT ME!
*/
/**
* DOCUMENT ME!
*/
- public void tqli()
+ public void tqli() throws Exception
{
int n = rows;
{
int n = rows;
@@
-393,10
+399,9
@@
public class Matrix
{
iter++;
{
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
{
}
else
{
@@
-596,7
+601,7
@@
public class Matrix
/**
* DOCUMENT ME!
*/
/**
* DOCUMENT ME!
*/
- public void tqli2()
+ public void tqli2() throws Exception
{
int n = rows;
{
int n = rows;
@@
-643,10
+648,9
@@
public class Matrix
{
iter++;
{
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
{
}
else
{
@@
-780,7
+784,7
@@
public class Matrix
* @param args
* DOCUMENT ME!
*/
* @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];
{
int n = Integer.parseInt(args[0]);
double[][] in = new double[n][n];