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)
Vector
public double put(int index, double value)
Vector
public Vector times(double scalar)
Vector
public Vector timesEquals(double scalar)
Vector
timesEquals
in class Vector
public boolean equals(Vector v, double epsilon)
Vector