*/
public double dotProduct(OpenMapRealVector v) throws IllegalArgumentException {
checkVectorDimensions(v.getDimension());
boolean thisIsSmaller = entries.size() < v.entries.size();
Iterator iter = thisIsSmaller ? entries.iterator() : v.entries.iterator();
OpenIntToDoubleHashMap larger = thisIsSmaller ? v.entries : entries;
double d = 0;
while(iter.hasNext()) {
iter.advance();
d += iter.value() * larger.get(iter.key());
}
return d;
}