public void subtract(FeatureVector other){
  for (int i=0; i < denseFeatures.size(); i++)   denseFeatures.set(i,getDense(i) - other.getDense(i));
  for (  String key : other.keySet()) {
    float oldValue=(sparseFeatures.containsKey(key)) ? sparseFeatures.get(key) : 0.0f;
    sparseFeatures.put(key,oldValue - other.getSparse(key));
  }
}

public void subtract ( FeatureVector other ) { for ( int i = 0 ; i < denseFeatures . size ( ) ; i ++ ) denseFeatures . set ( i , getDense ( i ) - other . getDense ( i ) ) ; for ( String key : other . keySet ( ) ) { float oldValue = ( sparseFeatures . containsKey ( key ) ) ? sparseFeatures . get ( key ) : 0.0f ; sparseFeatures . put ( key , oldValue - other . getSparse ( key ) ) ; } }
subtracts the weights in the other feature vector from this one . note that this is not set subtraction ; keys found in the other featurevector but not in this one will be initialized with a value of 0 . 0f before subtraction .
