public class DenseVector extends java.lang.Object implements Vector
Constructor and Description |
---|
DenseVector(double[] values) |
Modifier and Type | Method and Description |
---|---|
double |
apply(int i)
Gets the value of the ith element.
|
int |
argmax()
Find the index of a maximal 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.
|
java.lang.String |
toString() |
static scala.Option<double[]> |
unapply(DenseVector dv)
Extracts the value array from a dense vector.
|
double[] |
values() |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
compressed, equals, toDense
public static scala.Option<double[]> unapply(DenseVector dv)
public double[] values()
public int size()
Vector
public java.lang.String toString()
toString
in class java.lang.Object
public double[] toArray()
Vector
public double apply(int i)
Vector
public DenseVector copy()
Vector
public int hashCode()
Vector
java.util.Arrays.hashCode
.public int numActives()
Vector
numActives
in interface Vector
public int numNonzeros()
Vector
numNonzeros
in interface Vector
public SparseVector toSparse()
Vector