code: @Override
      public double put(int idx, double val) {
  	    double old = 0;
  		int i = Arrays.binarySearch(indices, 0, used, idx);
  		if (i >= 0) {
  			// Just update the value.
  		    old = values[i];
  			values[i] = val;
  			return old;
  		} 
  		int insertionPoint = -(i + 1);
  		indices = insert(indices, insertionPoint, idx);
  		values = insert(values, insertionPoint, val);
  		used++;
  		return old;
  	}
docs: /* (non-Javadoc)
  @see edu.jhu.util.vector.IntDoubleMap#put(int, double)