|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectorg.apache.spark.mllib.linalg.DenseVector
public class DenseVector
A dense vector represented by a value array.
Constructor Summary | |
---|---|
DenseVector(double[] values)
|
Method Summary | |
---|---|
double |
apply(int i)
Gets the value of the ith element. |
DenseVector |
copy()
Makes a deep copy of this vector. |
int |
hashCode()
Returns a hash code value for the vector. |
int |
numActives()
Number of active entries. |
int |
numNonzeros()
Number of nonzero elements. |
int |
size()
Size of the vector. |
double[] |
toArray()
Converts the instance to a double array. |
SparseVector |
toSparse()
Converts this vector to a sparse vector with all explicit zeros removed. |
String |
toString()
|
static scala.Option<double[]> |
unapply(DenseVector dv)
Extracts the value array from a dense vector. |
double[] |
values()
|
Methods inherited from class Object |
---|
equals, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.spark.mllib.linalg.Vector |
---|
compressed, equals, toDense |
Constructor Detail |
---|
public DenseVector(double[] values)
Method Detail |
---|
public static scala.Option<double[]> unapply(DenseVector dv)
public double[] values()
public int size()
Vector
size
in interface Vector
public String toString()
toString
in class Object
public double[] toArray()
Vector
toArray
in interface Vector
public double apply(int i)
Vector
apply
in interface Vector
i
- index
public DenseVector copy()
Vector
copy
in interface Vector
public int hashCode()
Vector
java.util.Arrays.hashCode
.
hashCode
in interface Vector
hashCode
in class Object
public int numActives()
Vector
numActives
in interface Vector
public int numNonzeros()
Vector
numNonzeros
in interface Vector
public SparseVector toSparse()
Vector
toSparse
in interface Vector
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |