Package org.apache.wayang.ml4all.utils
Class SparseVector
java.lang.Object
org.apache.wayang.ml4all.utils.SparseVector
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSparseVector
(double label, int[] indices, double[] values) SparseVector
(int[] indices, double[] values) -
Method Summary
Modifier and TypeMethodDescriptionadd
(SparseVector vector) add2
(SparseVector vector) double[]
concat
(double[] a, double[] b) int[]
concat
(int[] a, int[] b) double
getDenseValue
(int index) int[]
double
getLabel()
double[]
boolean
isEmpty()
void
setIndices
(int[] indices) void
setLabel
(double label) void
setValues
(double[] values) int
size()
toString()
-
Constructor Details
-
SparseVector
public SparseVector() -
SparseVector
public SparseVector(int[] indices, double[] values) -
SparseVector
public SparseVector(double label, int[] indices, double[] values)
-
-
Method Details
-
getIndices
public int[] getIndices() -
getValues
public double[] getValues() -
getLabel
public double getLabel() -
getDenseValue
public double getDenseValue(int index) -
setLabel
public void setLabel(double label) -
setIndices
public void setIndices(int[] indices) -
setValues
public void setValues(double[] values) -
size
public int size() -
add
-
add2
-
isEmpty
public boolean isEmpty() -
concat
public double[] concat(double[] a, double[] b) -
concat
public int[] concat(int[] a, int[] b) -
toString
-