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 SparseVectoradd(SparseVector vector)SparseVectoradd2(SparseVector vector)double[]concat(double[] a, double[] b)int[]concat(int[] a, int[] b)doublegetDenseValue(int index)int[]getIndices()doublegetLabel()double[]getValues()booleanisEmpty()voidsetIndices(int[] indices)voidsetLabel(double label)voidsetValues(double[] values)intsize()java.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
-