Updates this vector to be the entrywise product (i.e. Hadamard product) of this vector with the other.
15200
public void product(IntIntVector other) {
        // TODO: Add special case for IntIntDenseVector.
        for (int i=0; i<idxAfterLast; i++) {
            elements[i] *= other.get(i);
        }
    }
183701
public Vector multiply(Vector vec) {
        x *= vec.x;
        y *= vec.y;
        z *= vec.z;
        return this;
    }
1186795
public void product(LongDoubleVector other) {
        // TODO: Add special case for LongDoubleDenseVector.
        for (int i=0; i<size; i++) {
            elements[i + start] *= other.get(i);
        }
    }
598013
function(vec2, returnNew) {
      if (!returnNew) {
        this.x += vec2.x; this.y += vec2.y;
        return this.change();
      } else {
        // Return a new vector if `returnNew` is truthy
        return new Vec2(
          this.x + vec2.x,
          this.y + vec2.y
        );
      }
    }
1069892
public void product(IntDoubleVector other) {
        // TODO: Add special case for IntDoubleDenseVector.
        for (int i=0; i<idxAfterLast; i++) {
            elements[i] *= other.get(i);
        }
    }
1012828
public IntLongSortedVector getProd(IntLongVector other) {
        IntLongSortedVector prod = new IntLongSortedVector(this);
        prod.product(other);
        return prod;
    }
1311609
private void repmatIncrement(TensorBase other, double multiplier) {
    // Maps a key of other into a partial key of this.
    int[] dimensionMapping = getDimensionMapping(other.getDimensionNumbers());
    int[] partialKey = ArrayUtils.copyOf(getDimensionSizes(), getDimensionSizes().length);
    for (int i = 0; i < dimensionMapping.length; i++) {
      partialKey[dimensionMapping[i]] = 1;
    }

    int numValues = 1;
    for (int i = 0; i < partialKey.length; i++) {
      numValues *= partialKey[i];
    }
    int[] keyOffsets = new int[numValues];
    Iterator<int[]> myKeyIterator = new IntegerArrayIterator(partialKey, new int[0]);
    int ind = 0;
    while (myKeyIterator.hasNext()) {
      keyOffsets[ind] = dimKeyToIndex(myKeyIterator.next());
      ind++;
    }
    Preconditions.checkState(ind == keyOffsets.length);

    Iterator<KeyValue> otherKeyValues = other.keyValueIterator();
    while (otherKeyValues.hasNext()) {
      KeyValue otherKeyValue = otherKeyValues.next();
      int baseOffset = 0;
      for (int i = 0; i < otherKeyValue.getKey().length; i++) {
        baseOffset += otherKeyValue.getKey()[i] * indexOffsets[dimensionMapping[i]];
      }

      for (int i = 0; i < keyOffsets.length; i++) {
        values[baseOffset + keyOffsets[i]] += otherKeyValue.getValue() * multiplier;
      }
    }
  }
528388
def update(self, other, inplace=True):
        
        return self.append(other, inplace=inplace, resize=False)
1349321
def update(self, sequence=None, **mapping):
        """"""
        if sequence is not None:
            if isinstance(sequence, dict):
                for slot in sequence:
                    self[slot] = sequence[slot]
            else:
                for slot, value in sequence:
                    self[slot] = value
        if mapping:
            for slot in sequence:
                self[slot] = sequence[slot]
528426
public LongIntSortedVector getSum(LongIntVector other) {
        LongIntSortedVector sum = new LongIntSortedVector(this);
        sum.add(other);
        return sum;
    }
629062
protected void updateBox ()
    {
        int hmin = _horz.getMinimum();
        int vmin = _vert.getMinimum();
        _hFactor = (_active.width) / (float) (_horz.getMaximum() - hmin);
        _vFactor = (_active.height) / (float) (_vert.getMaximum() - vmin);

        _box.x = _active.x + Math.round((_horz.getValue() - hmin) * _hFactor);
        _box.width = Math.round(_horz.getExtent() * _hFactor);
        _box.y = _active.y + Math.round((_vert.getValue() - vmin) * _vFactor);
        _box.height = Math.round(_vert.getExtent() * _vFactor);
    }
895611
def update(self, other, **kwargs):
        
        if other is None: return

        if not isinstance(other, dict):
            other = other.to_dict()
        self.__dict__.update(other, **kwargs)
759591
public void product(IntFloatVector other) {
        // TODO: Add special case for IntFloatDenseVector.
        for (int i=0; i<idxAfterLast; i++) {
            elements[i] *= other.get(i);
        }
    }
86493
function add(v1, v2) {
    if (!isAVector(v1)) throw new Error("v1 must be a vector.");
    if (!isAVector(v2)) throw new Error("v2 must be a vector.");
    return Vector.zip(v1,v2,(e1, e2) => e1 + e2);
}
1129602
public IntDoubleSortedVector getSum(IntDoubleVector other) {
        IntDoubleSortedVector sum = new IntDoubleSortedVector(this);
        sum.add(other);
        return sum;
    }
1185639
def update(self, other):
        '''
        
        '''
        assert self.locus == other.locus
        self.elements.update(other.elements)
683095
public void set(IntDoubleSortedVector other) {
        this.used = other.used;
        this.indices = IntArrays.copyOf(other.indices);
        this.values = DoubleArrays.copyOf(other.values);
    }