|
|||||||||
| 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 Vectorpublic String toString()
toString in class Objectpublic double[] toArray()
Vector
toArray in interface Vectorpublic double apply(int i)
Vector
apply in interface Vectori - index
public DenseVector copy()
Vector
copy in interface Vectorpublic int hashCode()
Vectorjava.util.Arrays.hashCode.
hashCode in interface VectorhashCode in class Objectpublic int numActives()
Vector
numActives in interface Vectorpublic int numNonzeros()
Vector
numNonzeros in interface Vectorpublic SparseVector toSparse()
Vector
toSparse in interface Vector
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||