public class DenseVector
extends java.lang.Object
Constructor and Description |
---|
DenseVector() |
Modifier and Type | Method and Description |
---|---|
static float[] |
add(float[] v1,
float[] v2)
Adds the two argument vectors.
|
static float[] |
average(java.util.List<float[]> vectorList)
Compute the average vector of all vectors in the list.
|
static float |
dotProduct(float[] v1,
float[] v2)
Compute the dot product between the argument vectors.
|
static float[] |
mul(float[] v1,
float scalarValue)
Multiply vector with scalar.
|
static float[] |
mul(float[] v1,
float[] v2)
Element-wise vector multiplication.
|
static float[] |
sub(float[] v1,
float[] v2)
Subtracts the second vector from the first.
|
static float[] |
vectorExtrema(float[] v1,
float[] v2)
Choose for each dimension the highest absolute value.
|
public static float[] add(float[] v1, float[] v2)
v1
- must have same length as v2
v2
- v1 + v2
or null
if argument vectors have
different lengths.public static float[] sub(float[] v1, float[] v2)
v1
- must have same length as v2
v2
- v1 - v2
or null
if argument vectors have
different lengths.public static float[] mul(float[] v1, float[] v2)
v1
- must have same length as v2
v2
- null
if argument vectors have
different lengths.public static float[] mul(float[] v1, float scalarValue)
v1
- scalarValue
- public static float dotProduct(float[] v1, float[] v2)
v1
- must have same length as v2
v2
- RuntimeException
if the argument vectors have different lengths!public static float[] vectorExtrema(float[] v1, float[] v2)
v1
- must have same length as v2
v2
- RuntimeException
if the argument vectors have different lengths!public static float[] average(java.util.List<float[]> vectorList)
vectorList
-