Updates this vector to be the entrywise product (i.e. Hadamard product) of this vector with the other.
15772
public void product(IntFloatVector other) {
        // TODO: Add special case for IntFloatDenseVector.
        for (int i=0; i<size; i++) {
            elements[i + start] *= other.get(i);
        }
    }
1306149
def update(self):
        

        subtotal = float(0)
        total = float(0)
        for product in self.items:
            subtotal += float(product["price"])
        if subtotal > 0:
            total = subtotal + self.extra_amount
        self.subtotal = subtotal
        self.total = total
1017870
public IntLongSortedVector getSum(IntLongVector other) {
        IntLongSortedVector sum = new IntLongSortedVector(this);
        sum.add(other);
        return sum;
    }
357953
public void set(LongDoubleSortedVector other) {
        this.used = other.used;
        this.indices = LongArrays.copyOf(other.indices);
        this.values = DoubleArrays.copyOf(other.values);
    }
1280635
def _update(self, other):
        
        for key, value in other.items():
            self[key] = value
759591
public void product(IntFloatVector other) {
        // TODO: Add special case for IntFloatDenseVector.
        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;
    }
469919
def update(self, other=None, **kwargs):
        ''''''
        copydict = ImmutableDict()
        if other:
            vallist = [(hash(key), (key, other[key])) for key in other]
        else: vallist = []
        if kwargs:
            vallist += [(hash(key), (key, kwargs[key])) for key in kwargs]
        copydict.tree = self.tree.multi_assoc(vallist)
        copydict._length = iter_length(copydict.tree)
        return copydict
398009
@Override
  public void incrementWithMultiplier(TensorBase other, double multiplier) {
    if (Arrays.equals(other.getDimensionNumbers(), getDimensionNumbers())) {
      simpleIncrement(other, multiplier);
    } else {
      repmatIncrement(other, multiplier);
    }
  }
653691
public void add(MultidimensionalReward other) {
        for (Map.Entry<Integer, Float> entry : other.map.entrySet()) {
            Integer dimension = entry.getKey();
            Float reward_value = entry.getValue();
            this.add(dimension.intValue(), reward_value.floatValue());
        }
    }
1069892
public void product(IntDoubleVector other) {
        // TODO: Add special case for IntDoubleDenseVector.
        for (int i=0; i<idxAfterLast; i++) {
            elements[i] *= other.get(i);
        }
    }
21410
public void product(LongIntVector other) {
        // TODO: Add special case for LongIntDenseVector.
        for (int i=0; i<size; i++) {
            elements[i + start] *= other.get(i);
        }
    }
1116054
def update(self, other):
        

        acceptable_models = [ m for m in other._models if set(m.model.keys()) == self.variables ]
        self._models.update(acceptable_models)
        self._eval_exhausted.update(other._eval_exhausted)
        self._max_exhausted.update(other._max_exhausted)
        self._min_exhausted.update(other._min_exhausted)
828986
def transform(self, vector):
        
        if isinstance(vector, RDD):
            vector = vector.map(_convert_to_vector)

        else:
            vector = _convert_to_vector(vector)
        return callMLlibFunc("elementwiseProductVector", self.scalingVector, vector)
1009144
static double inner_product(SparseVector vec1, SparseVector vec2)
    {
        Iterator<Map.Entry<Integer, Double>> it;
        SparseVector other;
        if (vec1.size() < vec2.size())
        {
            it = vec1.entrySet().iterator();
            other = vec2;
        }
        else
        {
            it = vec2.entrySet().iterator();
            other = vec1;
        }
        double prod = 0;
        while (it.hasNext())
        {
            Map.Entry<Integer, Double> entry = it.next();
            prod += entry.getValue() * other.get(entry.getKey());
        }
        return prod;
    }
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);
}
796867
public LongDoubleSortedVector getProd(LongDoubleVector other) {
        LongDoubleSortedVector prod = new LongDoubleSortedVector(this);
        prod.product(other);
        return prod;
    }