public final class SparseVector extends Object
| Constructor and Description |
|---|
SparseVector(double[] values,
int[] indices) |
SparseVector(double[] values,
int[] indices,
int size) |
| Modifier and Type | Method and Description |
|---|---|
double |
dot(Vector that)
Computes the inner product with another Vector.
|
double |
get(int index)
Access the value of the Vector at dimension i.
|
Tuple<Integer,Double> |
min()
Computes the min of all entries in the Vector.
|
double |
norm2()
Computes the L2 norm of this Vector.
|
double |
norm2Sqr()
Computes the square of the L2 norm of this Vector.
|
int |
size()
The size (dimensionality) of the Vector.
|
double |
sum()
Computes the computeSum of all entries in the Vector.
|
String |
toString() |
public SparseVector(double[] values, int[] indices, int size)
public SparseVector(double[] values, int[] indices)
public double get(int index)
ImmutableVectorget in interface ImmutableVectorindex - indexpublic int size()
ImmutableVectorsize in interface ImmutableVectorpublic double dot(Vector that)
ImmutableVectordot in interface ImmutableVectorpublic double sum()
ImmutableVectorsum in interface ImmutableVectorpublic double norm2()
ImmutableVectornorm2 in interface ImmutableVectorpublic double norm2Sqr()
ImmutableVectornorm2Sqr in interface ImmutableVectorpublic Tuple<Integer,Double> min()
ImmutableVectormin in interface ImmutableVectorCopyright © 2017 The Apache Software Foundation. All rights reserved.