* @throws IllegalArgumentException If the dimensions don't match
*/
public OpenMapRealVector subtract(OpenMapRealVector v) throws IllegalArgumentException{
checkVectorDimensions(v.getDimension());
OpenMapRealVector res = copy();
Iterator iter = v.getEntries().iterator();
while (iter.hasNext()) {
iter.advance();
int key = iter.key();
if (entries.containsKey(key)) {
res.setEntry(key, entries.get(key) - iter.value());
} else {
res.setEntry(key, -iter.value());
}
}
return res;
}