You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2017/02/24 13:52:49 UTC

[1/2] [math] Make tolerance more stringent for trivial case (unit test).

Repository: commons-math
Updated Branches:
  refs/heads/master 656327570 -> 843267df5


Make tolerance more stringent for trivial case (unit test).


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/e9e76131
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/e9e76131
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/e9e76131

Branch: refs/heads/master
Commit: e9e76131f35c112046b9f184816683beab605e9c
Parents: 6563275
Author: Gilles <er...@apache.org>
Authored: Fri Feb 24 14:50:55 2017 +0100
Committer: Gilles <er...@apache.org>
Committed: Fri Feb 24 14:50:55 2017 +0100

----------------------------------------------------------------------
 .../org/apache/commons/math4/linear/RRQRDecompositionTest.java    | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/e9e76131/src/test/java/org/apache/commons/math4/linear/RRQRDecompositionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/linear/RRQRDecompositionTest.java b/src/test/java/org/apache/commons/math4/linear/RRQRDecompositionTest.java
index 8623bec..b307b80 100644
--- a/src/test/java/org/apache/commons/math4/linear/RRQRDecompositionTest.java
+++ b/src/test/java/org/apache/commons/math4/linear/RRQRDecompositionTest.java
@@ -235,7 +235,6 @@ public class RRQRDecompositionTest {
         double[][] d = { { 1, 1, 1 }, { 0, 0, 0 }, { 1, 2, 3 } };
         RealMatrix m = new Array2DRowRealMatrix(d);
         RRQRDecomposition qr = new RRQRDecomposition(m);
-        Assert.assertEquals(2, qr.getRank(1.0e-16));
+        Assert.assertEquals(2, qr.getRank(0));
     }
-
 }


[2/2] [math] Add unit test.

Posted by er...@apache.org.
Add unit test.


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/843267df
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/843267df
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/843267df

Branch: refs/heads/master
Commit: 843267df5a0b44145d5b9ee9153d17aa5e15cce1
Parents: e9e7613
Author: Gilles <er...@apache.org>
Authored: Fri Feb 24 14:52:08 2017 +0100
Committer: Gilles <er...@apache.org>
Committed: Fri Feb 24 14:52:08 2017 +0100

----------------------------------------------------------------------
 .../apache/commons/math4/linear/RRQRDecompositionTest.java    | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/843267df/src/test/java/org/apache/commons/math4/linear/RRQRDecompositionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/linear/RRQRDecompositionTest.java b/src/test/java/org/apache/commons/math4/linear/RRQRDecompositionTest.java
index b307b80..01acaae 100644
--- a/src/test/java/org/apache/commons/math4/linear/RRQRDecompositionTest.java
+++ b/src/test/java/org/apache/commons/math4/linear/RRQRDecompositionTest.java
@@ -237,4 +237,11 @@ public class RRQRDecompositionTest {
         RRQRDecomposition qr = new RRQRDecomposition(m);
         Assert.assertEquals(2, qr.getRank(0));
     }
+    @Test
+    public void testRank2() {
+        double[][] d = { { 1, 1, 1 }, { 2, 3, 4 }, { 1, 2, 3 } };
+        RealMatrix m = new Array2DRowRealMatrix(d);
+        RRQRDecomposition qr = new RRQRDecomposition(m);
+        Assert.assertEquals(2, qr.getRank(1e-14));
+    }
 }