/** Returns the dot product of the weights and features. */
public double score(FeatureVector fv) {
double retval = 0.0;
for (FeatureVector.Iterator it = fv.iterator(); it.hasNext(); ) {
Feature feat = it.nextFeature();
Float value = it.nextValue();
Integer index = feat.getIndex();
if (index == null) continue;
retval += weights[index] * value;
}
if (debug) System.err.println("score: " + retval + " " + fv);
return retval;