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));
+    }
 }

Reply via email to