The sum of squared weights of contained query clauses.

@return float
495358
public function sumOfSquaredWeights()
    {
        $sum = 0;
        foreach ($this->_weights as $weight) {
            // sum sub weights
            $sum += $weight->sumOfSquaredWeights();
        }

        // boost each sub-weight
        $sum *= $this->_query->getBoost() * $this->_query->getBoost();

        // check for empty query (like '-something -another')
        if ($sum == 0) {
            $sum = 1.0;
        }
        return $sum;
    }
303190
function getTotal() {
		if ($this->total === null) {
			$q = clone $this->query;
			$q->setLimit(null);
			$q->setOffset(null);
			if ($this->className) {
				$total = call_user_func(array($this->className, 'doCount'), $q);
			} else {
				$total = $q->doCount();
			}
			$this->total = $total;
		}
		return $this->total;
	}
1088423
public function getTotal()
    {
        $query = $this->getQuery()->select('COUNT(*) as total');

        $rows = $this->database->query($query, $this->database->getBinds());

        if (!isset($rows[0]['total'])) {
            return 0;
        }

        return $rows[0]['total'];
    }
650971
public function frobeniusNorm(): float
    {
        $squareSum = 0;
        for ($i = 0; $i < $this->rows; ++$i) {
            for ($j = 0; $j < $this->columns; ++$j) {
                $squareSum += $this->matrix[$i][$j] ** 2;
            }
        }

        return $squareSum ** .5;
    }
58229
protected double[] weightedSum(Instance inst) {
		boolean fired = false;
		int countFired = 0;
		double[] votes = new double[this.numClass];
		ArrayList<Double> weightSum = new ArrayList<Double>();
		ArrayList<ArrayList<Double>> majorityProb = new ArrayList<ArrayList<Double>>();
		for (int j = 0; j < this.ruleSet.size(); j++) {
			ArrayList<Double> ruleProb = new ArrayList<Double>();
			if (this.ruleSet.get(j).ruleEvaluate(inst) == true) {
				countFired = countFired + 1;
				for (int z = 0; z < this.numClass; z++) {
					ruleProb.add(this.ruleSet.get(j).obserClassDistrib.getValue(z) / this.ruleSet.get(j).obserClassDistrib.sumOfValues());
					}
				majorityProb.add(ruleProb);
				}
			}
		if (countFired > 0) {
			fired = true;
			for (int m = 0; m < majorityProb.get(0).size(); m++) {
				double sum = 0.0;
				for (int t = 0; t < majorityProb.size(); t++){
					sum = sum + majorityProb.get(t).get(m);
					}
				weightSum.add(sum);
				}
			for (int h = 0; h < weightSum.size(); h++) {
				votes[h] = weightSum.get(h) / majorityProb.size();
				}
			} else {
				fired = false;
				}
		if (fired == false) {
			votes = oberversDistribProb(inst, this.observedClassDistribution);
			}
		return votes;
		}
1350082
public function getLineItemTotal()
    {
        $amount = 0;

        foreach ($this->getLineItems() as $lineItem)
        {
            $amount += ($lineItem->getPrice()*$lineItem->getQuantity());
        }

        return $amount;
    }
1003398
public function getTotal()
    {
        return (float)($this->valorDocumento + $this->taxa + $this->outrosAcrescimos) - ($this->desconto + $this->outrasDeducoes);
    }
592889
public function getAmount(): float
    {
        $amounts = $this->map(
            function (CalculatedTax $calculatedTax) {
                return $calculatedTax->getTax();
            }
        );

        return array_sum($amounts);
    }
1179608
public function stdDev(){
		
		Number::setScale(static::NUMERIC_FUNCTIONS_SCALE);
		
		$mean = $this->average();
		$squares = new static();
		
		foreach($this->_Arr as $num){
			$squares->add(Number::pow(Number::sub(\strval($num), $mean), '2'));
		}
		
		return Number::sqrt($squares->average());
		
	}
328772
private function sumSquared(array $vector) {
        return array_reduce(
            $vector, 
            function($v, $w) { return $v += $this->square($w); }
        );
    }
436003
public function getWeight() : ?float 
    {
        if ( ! $this->hasWeight()) {
            $this->setWeight($this->getDefaultWeight());
        }
        return $this->weight;
    }
1241097
public function GetQueryRestrictionForActiveFilter()
    {
        $sQuery = '';
        $sValue = $this->GetActiveValue();
        if ('1' == $sValue) {
            $sQuery = '`shop_article`.`price_reference` > 0 AND `shop_article`.`price_reference` != `shop_article`.`price` ';
        } elseif ('0' == $sValue) {
            $sQuery = '`shop_article`.`price_reference` = 0 OR `shop_article`.`price_reference` = `shop_article`.`price` ';
        }

        return $sQuery;
    }
586358
protected function getTotal()
	{
		if (null == $this->_total) {
			$this->_total = 0;
			foreach ($this->types as $type) {
				if (isset($type['value'])) {
					$this->_total += $type['value'];
				}
			}
		}
		return $this->_total;
	}
1101153
public function lengthSquared() : float
    {
        static $result;

        // Return the cached result if it's available.
        if ($result !== null) {
            return $result;
        }

        // Compute the square sum.
        $sum = 0;

        foreach ($this->components as $component) {
            $sum += $component * $component;
        }

        return $result = $sum;
    }
1234860
public function getNbResults()
    {
        if (isset($this->nbResults)) {
            return $this->nbResults;
        }

        return $this->nbResults = $this->getSearchResultWithLimitZero()->totalCount;
    }
499093
public function runCount($query)
	{
		if (isset($this->stored_query_totals[md5(serialize($query))])) {
			return $this->stored_query_totals[md5(serialize($query))];
		}
		
		$query['terms'] = trim($query['terms']);
		if (isset($query['numericFilters'])) {
			$query['numericFilters'] = implode(',', $query['numericFilters']);
		}
		if (isset($query['facets'])) {
			$query['facets'] = implode(',', $query['facets']);
		}
		
		try {
			return array_get($this->getIndex()->search(array_get($query, 'terms'), array_get($query, 'query')), 'nbHits');
		} catch (\Exception $e) {
			return 0;
		}
	}
594989
public function prices() : Float
    {
        $total = 0;

        if( ! empty(Properties::$items) ) foreach( Properties::$items as $values )
        {
            $quantity = (int)   ($values['quantity'] ?? 1);
            $price    = (float) ($values['price']    ?? 0);

            $total += $price * $quantity;
        }

        return $total;
    }