From a85262a0d153dd98256ce129d2e03c79855abf4d Mon Sep 17 00:00:00 2001 From: Xiangrui Meng Date: Wed, 2 Apr 2014 13:36:02 -0700 Subject: [PATCH] rename RDDMatrixRow to IndexedRDDMatrixRow --- .../apache/spark/mllib/linalg/rdd/CoordinateRDDMatrix.scala | 2 +- .../rdd/{RDDMatrixRow.scala => IndexedRDDMatrixRow.scala} | 2 +- .../apache/spark/mllib/linalg/rdd/IndexedRowRDDMatrix.scala | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) rename mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/{RDDMatrixRow.scala => IndexedRDDMatrixRow.scala} (93%) diff --git a/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/CoordinateRDDMatrix.scala b/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/CoordinateRDDMatrix.scala index d8a72aed37dda..c6af5fb833b05 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/CoordinateRDDMatrix.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/CoordinateRDDMatrix.scala @@ -66,7 +66,7 @@ class CoordinateRDDMatrix( val indexedRows = entries.map(entry => (entry.i, (entry.j.toInt, entry.value))) .groupByKey() .map { case (i, vectorEntries) => - RDDMatrixRow(i, Vectors.sparse(n, vectorEntries)) + IndexedRDDMatrixRow(i, Vectors.sparse(n, vectorEntries)) } new IndexedRowRDDMatrix(indexedRows, numRows(), numCols()) } diff --git a/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/RDDMatrixRow.scala b/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/IndexedRDDMatrixRow.scala similarity index 93% rename from mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/RDDMatrixRow.scala rename to mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/IndexedRDDMatrixRow.scala index b964fc206f9d3..8c9a9a857646c 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/RDDMatrixRow.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/IndexedRDDMatrixRow.scala @@ -20,4 +20,4 @@ package org.apache.spark.mllib.linalg.rdd import org.apache.spark.mllib.linalg.Vector /** Represents a row of RowRDDMatrix. */ -case class RDDMatrixRow(index: Long, vector: Vector) +case class IndexedRDDMatrixRow(index: Long, vector: Vector) diff --git a/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/IndexedRowRDDMatrix.scala b/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/IndexedRowRDDMatrix.scala index c0ead63a84c7e..d1dbd0a017c2d 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/IndexedRowRDDMatrix.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/IndexedRowRDDMatrix.scala @@ -27,7 +27,7 @@ import org.apache.spark.rdd.RDD * @param n number of cols, where a negative number means unknown */ class IndexedRowRDDMatrix( - val rows: RDD[RDDMatrixRow], + val rows: RDD[IndexedRDDMatrixRow], m: Long = -1L, n: Long = -1L) extends RDDMatrix { @@ -49,8 +49,8 @@ class IndexedRowRDDMatrix( _m } - /** Drops row indices and converts this to a RowRDDMatrix. */ - def compressRows(): RowRDDMatrix = { + /** Drops row indices and converts this matrix to a RowRDDMatrix. */ + def toRowRDDMatrix(): RowRDDMatrix = { new RowRDDMatrix(rows.map(_.vector), -1, _n) } }