aboutsummaryrefslogtreecommitdiff
path: root/mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala
diff options
context:
space:
mode:
Diffstat (limited to 'mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala')
-rw-r--r--mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala16
1 files changed, 8 insertions, 8 deletions
diff --git a/mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala b/mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala
index a47526d36f..0ea687bbcc 100644
--- a/mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala
+++ b/mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala
@@ -69,7 +69,7 @@ sealed trait Matrix extends Serializable {
def rowIter: Iterator[Vector] = this.transpose.colIter
/** Converts to a breeze matrix. */
- private[ml] def toBreeze: BM[Double]
+ private[ml] def asBreeze: BM[Double]
/** Gets the (i, j)-th element. */
@Since("2.0.0")
@@ -112,11 +112,11 @@ sealed trait Matrix extends Serializable {
}
/** A human readable representation of the matrix */
- override def toString: String = toBreeze.toString()
+ override def toString: String = asBreeze.toString()
/** A human readable representation of the matrix with maximum lines and width */
@Since("2.0.0")
- def toString(maxLines: Int, maxLineWidth: Int): String = toBreeze.toString(maxLines, maxLineWidth)
+ def toString(maxLines: Int, maxLineWidth: Int): String = asBreeze.toString(maxLines, maxLineWidth)
/**
* Map the values of this matrix using a function. Generates a new matrix. Performs the
@@ -202,7 +202,7 @@ class DenseMatrix @Since("2.0.0") (
this(numRows, numCols, values, false)
override def equals(o: Any): Boolean = o match {
- case m: Matrix => toBreeze == m.toBreeze
+ case m: Matrix => asBreeze == m.asBreeze
case _ => false
}
@@ -210,7 +210,7 @@ class DenseMatrix @Since("2.0.0") (
Seq(numRows, numCols, toArray).##
}
- private[ml] def toBreeze: BM[Double] = {
+ private[ml] def asBreeze: BM[Double] = {
if (!isTransposed) {
new BDM[Double](numRows, numCols, values)
} else {
@@ -488,14 +488,14 @@ class SparseMatrix @Since("2.0.0") (
rowIndices: Array[Int],
values: Array[Double]) = this(numRows, numCols, colPtrs, rowIndices, values, false)
- override def hashCode(): Int = toBreeze.hashCode()
+ override def hashCode(): Int = asBreeze.hashCode()
override def equals(o: Any): Boolean = o match {
- case m: Matrix => toBreeze == m.toBreeze
+ case m: Matrix => asBreeze == m.asBreeze
case _ => false
}
- private[ml] def toBreeze: BM[Double] = {
+ private[ml] def asBreeze: BM[Double] = {
if (!isTransposed) {
new BSM[Double](values, numRows, numCols, colPtrs, rowIndices)
} else {