You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hama.apache.org by ed...@apache.org on 2008/08/25 10:03:35 UTC
svn commit: r688646 - in /incubator/hama/trunk/src/test/org/apache/hama:
TestMatrix.java TestVector.java mapred/TestMatrixMapReduce.java
Author: edwardyoon
Date: Mon Aug 25 01:03:35 2008
New Revision: 688646
URL: http://svn.apache.org/viewvc?rev=688646&view=rev
Log: (empty)
Modified:
incubator/hama/trunk/src/test/org/apache/hama/TestMatrix.java
incubator/hama/trunk/src/test/org/apache/hama/TestVector.java
incubator/hama/trunk/src/test/org/apache/hama/mapred/TestMatrixMapReduce.java
Modified: incubator/hama/trunk/src/test/org/apache/hama/TestMatrix.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/test/org/apache/hama/TestMatrix.java?rev=688646&r1=688645&r2=688646&view=diff
==============================================================================
--- incubator/hama/trunk/src/test/org/apache/hama/TestMatrix.java (original)
+++ incubator/hama/trunk/src/test/org/apache/hama/TestMatrix.java Mon Aug 25 01:03:35 2008
@@ -28,7 +28,7 @@
* Random matrix creation test
*/
public void testRandomMatrix() {
- Matrix rand = DenseMatrix.random(conf, SIZE, SIZE);
+ Matrix rand = Matrix.random(conf, SIZE, SIZE);
assertTrue(rand.getRows() == SIZE);
}
}
Modified: incubator/hama/trunk/src/test/org/apache/hama/TestVector.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/test/org/apache/hama/TestVector.java?rev=688646&r1=688645&r2=688646&view=diff
==============================================================================
--- incubator/hama/trunk/src/test/org/apache/hama/TestVector.java (original)
+++ incubator/hama/trunk/src/test/org/apache/hama/TestVector.java Mon Aug 25 01:03:35 2008
@@ -24,13 +24,12 @@
private final double norm1 = 12.0;
private final double norm2 = 6.782329983125268;
private double[][] values = { { 2, 5, 1, 4 }, { 4, 1, 3, 3 } };
- private final String m = "dotTest";
/**
* Test vector
*/
public void testGetVector() {
- Matrix m1 = new DenseMatrix(conf, m);
+ Matrix m1 = new Matrix(conf, "dotTest");
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 4; j++) {
@@ -59,11 +58,11 @@
}
private void norm1Test(Vector v1, Vector v2) {
- assertEquals(norm1, ((DenseVector) v1).getNorm1());
+ assertEquals(norm1, v1.getNorm1());
}
private void norm2Test(Vector v1, Vector v2) {
- assertEquals(norm2, ((DenseVector) v1).getNorm2());
+ assertEquals(norm2, v1.getNorm2());
}
private void scalingTest(Vector v2) {
@@ -75,7 +74,7 @@
}
public void testGetSet() {
- Vector v1 = new DenseVector();
+ Vector v1 = new Vector();
v1.set(0, 0.2);
assertEquals(v1.get(0), 0.2);
}
Modified: incubator/hama/trunk/src/test/org/apache/hama/mapred/TestMatrixMapReduce.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/test/org/apache/hama/mapred/TestMatrixMapReduce.java?rev=688646&r1=688645&r2=688646&view=diff
==============================================================================
--- incubator/hama/trunk/src/test/org/apache/hama/mapred/TestMatrixMapReduce.java (original)
+++ incubator/hama/trunk/src/test/org/apache/hama/mapred/TestMatrixMapReduce.java Mon Aug 25 01:03:35 2008
@@ -24,10 +24,9 @@
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;
-import org.apache.hama.DenseMatrix;
-import org.apache.hama.DenseVector;
import org.apache.hama.HamaTestCase;
import org.apache.hama.Matrix;
+import org.apache.hama.Vector;
import org.apache.hama.algebra.AdditionMap;
import org.apache.hama.algebra.AdditionReduce;
import org.apache.log4j.Logger;
@@ -47,11 +46,11 @@
}
public void testMatrixMapReduce() throws IOException {
- Matrix matrixA = new DenseMatrix(conf, A);
+ Matrix matrixA = new Matrix(conf, A);
matrixA.set(0, 0, 1);
matrixA.set(0, 1, 0);
- Matrix matrixB = new DenseMatrix(conf, B);
+ Matrix matrixB = new Matrix(conf, B);
matrixB.set(0, 0, 1);
matrixB.set(0, 1, 1);
@@ -59,13 +58,13 @@
}
public void miniMRJob() throws IOException {
- Matrix c = new DenseMatrix(conf, output);
+ Matrix c = new Matrix(conf, output);
JobConf jobConf = new JobConf(conf, TestMatrixMapReduce.class);
jobConf.setJobName("test MR job");
- DenseMap.initJob(A, B, AdditionMap.class, ImmutableBytesWritable.class,
- DenseVector.class, jobConf);
+ MatrixMap.initJob(A, B, AdditionMap.class, ImmutableBytesWritable.class,
+ Vector.class, jobConf);
MatrixReduce.initJob(output, AdditionReduce.class, jobConf);
jobConf.setNumMapTasks(1);