From f608f7503cdac8c8d802f8162201fc5d1b0872f5 Mon Sep 17 00:00:00 2001 From: "Mark R. Diggory" Date: Sun, 23 Nov 2003 20:34:41 +0000 Subject: [PATCH] Additional Matrix Multiply test git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@141046 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/math/linear/RealMatrixImplTest.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java b/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java index fe7f11fff..d4b73ecd9 100644 --- a/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java +++ b/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java @@ -60,7 +60,7 @@ import junit.framework.TestSuite; /** * Test cases for the {@link RealMatrixImpl} class. * - * @version $Revision: 1.7 $ $Date: 2003/11/14 22:22:19 $ + * @version $Revision: 1.8 $ $Date: 2003/11/23 20:34:41 $ */ public final class RealMatrixImplTest extends TestCase { @@ -182,7 +182,7 @@ public final class RealMatrixImplTest extends TestCase { ; } } - + /** test multiply */ public void testMultiply() { RealMatrixImpl m = new RealMatrixImpl(testData); @@ -206,6 +206,19 @@ public final class RealMatrixImplTest extends TestCase { ; } } + + //Additional Test for RealMatrixImplTest.testMultiply + + private double[][] d3 = new double[][] {{1,2,3,4},{5,6,7,8}}; + private double[][] d4 = new double[][] {{1},{2},{3},{4}}; + private double[][] d5 = new double[][] {{30},{70}}; + + public void testMultiply2() { + RealMatrix m3 = new RealMatrixImpl(d3); + RealMatrix m4 = new RealMatrixImpl(d4); + RealMatrix m5 = new RealMatrixImpl(d5); + assertClose("m3*m4=m5", m3.multiply(m4), m5, entryTolerance); + } /** test isSingular */ public void testIsSingular() {