Package org.apache.wayang.ml4all.utils
Class SparseVector
- java.lang.Object
-
- org.apache.wayang.ml4all.utils.SparseVector
-
- All Implemented Interfaces:
java.io.Serializable
public class SparseVector extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SparseVector()
SparseVector(double label, int[] indices, double[] values)
SparseVector(int[] indices, double[] values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SparseVector
add(SparseVector vector)
SparseVector
add2(SparseVector vector)
double[]
concat(double[] a, double[] b)
int[]
concat(int[] a, int[] b)
double
getDenseValue(int index)
int[]
getIndices()
double
getLabel()
double[]
getValues()
boolean
isEmpty()
void
setIndices(int[] indices)
void
setLabel(double label)
void
setValues(double[] values)
int
size()
java.lang.String
toString()
-
-
-
Method Detail
-
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
public SparseVector add(SparseVector vector)
-
add2
public SparseVector add2(SparseVector vector)
-
isEmpty
public boolean isEmpty()
-
concat
public double[] concat(double[] a, double[] b)
-
concat
public int[] concat(int[] a, int[] b)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-