public class DenseVector extends Vector
Vector.Entry| Modifier | Constructor and Description |
|---|---|
protected |
DenseVector(double[] values) |
protected |
DenseVector(int size) |
| Modifier and Type | Method and Description |
|---|---|
double |
cosine(DenseVector other)
Cosine of angle between this and another vector
|
boolean |
equals(Vector v,
double epsilon)
Test for equality
|
double |
get(int index)
Get the value at the given index
|
double |
norm()
Compute the L2 norm
|
double |
put(int index,
double value)
Set the value at an index
|
int |
size() |
Vector |
times(double scalar)
Multiply by a constant, creating a new vector
|
Vector |
timesEquals(double scalar)
Multiply by a constant in-place
|
double[] |
unwrap() |
protected DenseVector(double[] values)
protected DenseVector(int size)
public double cosine(DenseVector other)
other - public double get(int index)
Vectorpublic double put(int index, double value)
Vectorpublic Vector times(double scalar)
Vectorpublic Vector timesEquals(double scalar)
VectortimesEquals in class Vectorpublic boolean equals(Vector v, double epsilon)
Vector