/** * Clears the receiver, then adds all (key,value) pairs of <tt>other</tt>values to it. * * @param other the other map to be copied into the receiver. */ public void assign(AbstractIntDoubleMap other) { if (!(other instanceof OpenIntDoubleHashMap)) { super.assign(other); return; } OpenIntDoubleHashMap source = (OpenIntDoubleHashMap) other; OpenIntDoubleHashMap copy = (OpenIntDoubleHashMap) source.copy(); this.values = copy.values; this.table = copy.table; this.state = copy.state; this.freeEntries = copy.freeEntries; this.distinct = copy.distinct; this.lowWaterMark = copy.lowWaterMark; this.highWaterMark = copy.highWaterMark; this.minLoadFactor = copy.minLoadFactor; this.maxLoadFactor = copy.maxLoadFactor; } /**
/** * Clears the receiver, then adds all (key,value) pairs of <tt>other</tt>values to it. * * @param other the other map to be copied into the receiver. */ public void assign(AbstractIntDoubleMap other) { if (!(other instanceof OpenIntDoubleHashMap)) { super.assign(other); return; } OpenIntDoubleHashMap source = (OpenIntDoubleHashMap) other; OpenIntDoubleHashMap copy = (OpenIntDoubleHashMap) source.copy(); this.values = copy.values; this.table = copy.table; this.state = copy.state; this.freeEntries = copy.freeEntries; this.distinct = copy.distinct; this.lowWaterMark = copy.lowWaterMark; this.highWaterMark = copy.highWaterMark; this.minLoadFactor = copy.minLoadFactor; this.maxLoadFactor = copy.maxLoadFactor; } /**
/** * Clears the receiver, then adds all (key,value) pairs of <tt>other</tt> * values to it. * * @param other * the other map to be copied into the receiver. */ public void assign(AbstractIntDoubleMap other) { if (!(other instanceof OpenIntDoubleHashMap)) { super.assign(other); return; } OpenIntDoubleHashMap source = (OpenIntDoubleHashMap) other; OpenIntDoubleHashMap copy = (OpenIntDoubleHashMap) source.copy(); this.values = copy.values; this.table = copy.table; this.state = copy.state; this.freeEntries = copy.freeEntries; this.distinct = copy.distinct; this.lowWaterMark = copy.lowWaterMark; this.highWaterMark = copy.highWaterMark; this.minLoadFactor = copy.minLoadFactor; this.maxLoadFactor = copy.maxLoadFactor; }
@Override public void paste(Vector v) { // this et v on la meme taille if (v instanceof DoubleSparseHashVector) { DoubleSparseHashVector vHash = (DoubleSparseHashVector)v; defaultValue = vHash.defaultValue; data = (OpenIntDoubleHashMap)vHash.data.copy(); } else { defaultValue = 0; for (VectorIterator i=v.iteratorNotZero(); i.hasNext();) { double val = i.next(); int pos = i.getPosition(); setValue(pos, val); } } }