public float innerProduct(FeatureVector other){
  float cost=0.0f;
  for (int i=0; i < DENSE_FEATURE_NAMES.size(); i++)   cost+=getDense(i) * other.getDense(i);
  for (  String key : sparseFeatures.keySet())   cost+=sparseFeatures.get(key) * other.getSparse(key);
  return cost;
}

public float innerProduct ( FeatureVector other ) { float cost = 0.0f ; for ( int i = 0 ; i < DENSE_FEATURE_NAMES . size ( ) ; i ++ ) cost += getDense ( i ) * other . getDense ( i ) ; for ( String key : sparseFeatures . keySet ( ) ) cost += sparseFeatures . get ( key ) * other . getSparse ( key ) ; return cost ; }
computes the inner product between this feature vector and another one .
