net.sourceforge.combean.mathprog.linalg.statics
Class SparseVectorUtil

Package class diagram package SparseVectorUtil
java.lang.Object
  extended by net.sourceforge.combean.mathprog.linalg.statics.SparseVectorUtil

public class SparseVectorUtil
extends Object

A collection of utility function to calculate with sparse vectors


Constructor Summary
SparseVectorUtil()
           
 
Method Summary
static
<Label> Set<Label>
collectLabels(SparseVec<Label> vec)
           
static
<Label> double
sum(SparseVec<Label> vec)
          Calculate the sum of the components of the vector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SparseVectorUtil

public SparseVectorUtil()
Method Detail

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)