public class DenseVector extends 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.
|
DenseVector |
copy()
Makes a deep copy of this vector.
|
void |
foreachActive(scala.Function2<Object,Object,scala.runtime.BoxedUnit> f)
Applies a function
f to all the active elements of dense and sparse vector. |
int |
size()
Size of the vector.
|
double[] |
toArray()
Converts the instance to a double array.
|
breeze.linalg.Vector<Object> |
toBreeze()
Converts the instance to a breeze vector.
|
String |
toString() |
static scala.Option<double[]> |
unapply(DenseVector dv)
Extracts the value array from a dense vector.
|
double[] |
values() |
public static scala.Option<double[]> unapply(DenseVector dv)
public double[] values()
public int size()
Vector
public String toString()
toString
in class Object
public double[] toArray()
Vector
public breeze.linalg.Vector<Object> toBreeze()
Vector
public double apply(int i)
Vector
public DenseVector copy()
Vector
public void foreachActive(scala.Function2<Object,Object,scala.runtime.BoxedUnit> f)
Vector
f
to all the active elements of dense and sparse vector.
foreachActive
in interface Vector
f
- the function takes two parameters where the first parameter is the index of
the vector with type Int
, and the second parameter is the corresponding value
with type Double
.