public class DenseVector extends Object implements Vector, scala.Serializable, scala.Product
Vector
. The data is represented in a continuous array of
doubles.
Constructor and Description |
---|
DenseVector(double[] data) |
Modifier and Type | Method and Description |
---|---|
double |
apply(int index)
Element wise access function
|
DenseVector |
copy()
Copies the vector instance
|
double[] |
data() |
static Object |
denseVectorConverter()
BreezeVectorConverter implementation for
DenseVector |
double |
dot(Vector other)
Returns the dot product of the recipient and the argument
|
boolean |
equals(Object obj) |
static DenseVector |
eye(int size) |
int |
hashCode() |
static DenseVector |
init(int size,
double value) |
double |
magnitude()
Magnitude of a vector
|
Matrix |
outer(Vector other)
Returns the outer product (a.k.a.
|
int |
size()
Number of elements in a vector
|
SparseVector |
toSparseVector() |
String |
toString() |
void |
update(int index,
double value)
Updates the element at the given index with the provided value
|
static DenseVector |
zeros(int size) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
equalsVector
public static DenseVector zeros(int size)
public static DenseVector eye(int size)
public static DenseVector init(int size, double value)
public static Object denseVectorConverter()
DenseVector
This allows to convert Breeze vectors into DenseVector
.
public double[] data()
public int size()
public double apply(int index)
public boolean equals(Object obj)
public DenseVector copy()
public void update(int index, double value)
public double dot(Vector other)
public Matrix outer(Vector other)
this
with other
. The result will given in SparseMatrix
representation if other
is sparse and as DenseMatrix
otherwise.
public double magnitude()
public SparseVector toSparseVector()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.