net.sourceforge.combean.mathprog.linalg.statics
Class SparseVectorUtil
java.lang.Object
net.sourceforge.combean.mathprog.linalg.statics.SparseVectorUtil
public class SparseVectorUtil
- extends Object
A collection of utility function to calculate with sparse vectors
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SparseVectorUtil
public SparseVectorUtil()
sum
public static final <Label> double sum(SparseVec<Label> vec)
- Calculate the sum of the components of the vector
- Parameters:
vec
- a sparse vector
- Returns:
- the sum of the components of vec
collectLabels
public static final <Label> Set<Label> collectLabels(SparseVec<Label> vec)