Add data with a given weight.

@param val data
@param weight weight
320985
@Override
  public void put(double[] val, double weight) {
    assert (val.length == elements.length);
    if(weight == 0) {
      return; // Skip zero weights.
    }
    final double nwsum = weight + wsum;
    for(int i = BitsUtil.nextSetBit(dims, 0); i >= 0; i = BitsUtil.nextSetBit(dims, i + 1)) {
      final double delta = val[i] - elements[i];
      final double rval = delta * weight / nwsum;
      elements[i] += rval;
    }
    wsum = nwsum;
  }
596236
public Weight add(Weight w) {
        if (w == null) {
            return new Weight(this);
        } else {
            boolean wIsInfinity = w.isInfinity;
            boolean wPosOrNeg = w.posOrNeg;
            if ((isInfinity && posOrNeg && wIsInfinity && !wPosOrNeg)
                    || (isInfinity && !posOrNeg && wIsInfinity && wPosOrNeg)) {
                throw new IllegalArgumentException("+inf - inf!");
            } else if ((isInfinity && posOrNeg) || (w.isInfinity && wPosOrNeg)) {
                return WeightFactory.POS_INFINITY;
            } else if ((isInfinity && !posOrNeg) || (wIsInfinity && !wPosOrNeg)) {
                return WeightFactory.NEG_INFINITY;
            } else {
                return new Weight(val + w.val);
            }
        }
    }
1008876
public void add(double rad, double weight)
    {
        sin += Math.sin(rad)*weight;
        cos += Math.cos(rad)*weight;
    }
124286
public void add(double[] vals) {
        ensureCapacity(size + vals.length);
        System.arraycopy(vals, 0, data, size, vals.length);
        size += vals.length;
    }
288545
@Override
    public void setWeights(Map<String, INDArray> weights) throws InvalidKerasConfigurationException {
        this.weights = new HashMap<>();
        if (weights.containsKey(ALPHA))
            this.weights.put(PReLUParamInitializer.WEIGHT_KEY, weights.get(ALPHA));
        else
            throw new InvalidKerasConfigurationException("Parameter " + ALPHA + " does not exist in weights");
        if (weights.size() > 1) {
            Set<String> paramNames = weights.keySet();
            paramNames.remove(ALPHA);
            String unknownParamNames = paramNames.toString();
            log.warn("Attemping to set weights for unknown parameters: "
                    + unknownParamNames.substring(1, unknownParamNames.length() - 1));
        }
    }
433179
public function addWeight($weight)
    {
        $this->weight += $weight;
        if ($this->parentMatcher !== null) {
            $this->parentMatcher->addWeight($weight);
        }
    }
970373
public function addWeightFunction(float $weight, AbstractQuery $filter = null): self
    {
        return $this->addFunction('weight', $weight, $filter);
    }
1275007
public void add( int val ) 
    {
        if ( size == items.length ) 
            resize( items.length * 2 + 1 );
        items[size++] = val;
    }
996222
public void addNextValue(Object val) {
    String newVal = val.toString();
    if (this.minVal == null || this.minVal.compareTo(newVal) > 0) {
      this.minVal = newVal;
    }
  }
55836
public void add(double x, double weight)
   {
       //See http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
       
       if(weight < 0)
           throw new ArithmeticException("Can not add a negative weight");
       else if(weight == 0)
           return;
       
       double n1 = n;
       n+=weight;
       double delta = x - mean;
       double delta_n = delta*weight/n;
       double delta_n2 = delta_n*delta_n;
       double term1 = delta*delta_n*n1;
       
       
       mean += delta_n;
       m4 += term1 * delta_n2 * (n*n - 3*n + 3) + 6 * delta_n2 * m2 - 4 * delta_n * m3;
       m3 += term1 * delta_n * (n - 2) - 3 * delta_n * m2;
       m2 += weight*delta*(x-mean);
       
       if(min == null)
           min = max = x;
       else
       {
           min = Math.min(min, x);
           max = Math.max(max, x);
       }
   }
1305492
public void assign(double val) {
	for (int i = 0; i < rows; i++) {
	    for (int j = 0; j < cols; j++) {
		mtrx[i][j] = val;
	    }
	}
    }
692318
public void accumulate(AverageData data,
                           Object value) {
        if (value != null) {
            data.count++;
            data.total = data.total.add( (BigDecimal) value );
        }
    }
204589
public void put(double[] val) {
    assert (val.length == elements.length);
    wsum += 1.0;
    for(int i = 0; i < elements.length; i++) {
      final double delta = val[i] - elements[i];
      elements[i] += delta / wsum;
    }
  }
636080
def add_val(self, val):
        """"""
        if not isinstance(val, type({})):
            raise ValueError(type({}))
        self.read()
        self.config.update(val)
        self.save()
529926
void setWeight(Token tok, double d) {
		Double oldWeight = (Double)weightMap.get(tok);
		totalWeight += oldWeight==null ? d : (d - oldWeight.doubleValue());
		weightMap.put(tok,new Double(d));
	}
705976
public void addNextValue(Object val) {
    if (this.numItems <= this.maxNumItems) {
      uniqItems.put(val.toString(), "1");
      this.numItems = this.uniqItems.size();
    }
  }
637535
@Override
    public void add(double value, double weight)
    {
        writeLock.lock();
        try
        {
            average.add(value, weight);
            double fast = average.fast();
            min.accept(fast);
            max.accept(fast);
            check();
        }
        finally
        {
            writeLock.unlock();
        }
    }