public class DenseVector extends Object implements Vector, scala.Serializable, scala.Product
Vector
. The data is represented in a continuous array of
doubles.
param: data Array of doubles to store the vector elements
Constructor and Description |
---|
DenseVector(double[] data) |
Modifier and Type | Method and Description |
---|---|
double |
apply(int index)
Element wise access function
|
abstract static boolean |
canEqual(Object that) |
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 boolean |
equalsVector(Vector vector) |
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.
|
abstract static int |
productArity() |
abstract static Object |
productElement(int n) |
static scala.collection.Iterator<Object> |
productIterator() |
static String |
productPrefix() |
int |
size()
Number of elements in a vector
|
SparseVector |
toSparseVector()
Convert to a
SparseVector |
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 static boolean equalsVector(Vector vector)
public abstract static boolean canEqual(Object that)
public abstract static Object productElement(int n)
public abstract static int productArity()
public static scala.collection.Iterator<Object> productIterator()
public static String productPrefix()
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()
SparseVector
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.