Calculates integrational sum of Formula within the Interval by using Sampling Nodes.
@access		public
@return		mixed
325136
public function integrate()
	{
		$sum	= 0;
		$nodes	= $this->getNodes()-1;
		$distance	= $this->getNodeDistance();
		$start	= $this->interval->getStart();
		for( $i=0; $i<$nodes; $i++ )
		{
			$x		= $start + $distance * ( $i + $distance / 2 );
			$y		= $this->formula->getValue( $x );
			$sum	+= $y;
		}
		return $distance * $sum;
	}
1114078
public function total()
    {
        $total = array_reduce($this->examples, function($x, $e) {
            $x += $e instanceof Example ? 1 : $e->total();
            return $x;
        }, 0);

        return $total;
    }
1321898
public function calculateTotal()
    {
        $this->total = $this->getItemsTotal() + $this->getAdjustmentTotal();

        if ($this->total < 0) {
            $this->total = 0;
        }

        return $this;
    }
1038803
public function getPercentagePartial()
    {
        $total = $this->getTotal();

        return round((($this->score->getValid() + $this->score->getPartial())/$total) * 100);
    }
696215
public static function MULTINOMIAL()
    {
        $summer = 0;
        $divisor = 1;
        // Loop through arguments
        foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) {
            // Is it a numeric value?
            if (is_numeric($arg)) {
                if ($arg < 1) {
                    return PHPExcel_Calculation_Functions::NaN();
                }
                $summer += floor($arg);
                $divisor *= self::FACT($arg);
            } else {
                return PHPExcel_Calculation_Functions::VALUE();
            }
        }

        // Return
        if ($summer > 0) {
            $summer = self::FACT($summer);
            return $summer / $divisor;
        }
        return 0;
    }
592889
public function getAmount(): float
    {
        $amounts = $this->map(
            function (CalculatedTax $calculatedTax) {
                return $calculatedTax->getTax();
            }
        );

        return array_sum($amounts);
    }
448979
protected function calculateTotal()
    {
        $otherConfig = $this->getOtherConfig();
        $total       = $this
            ->getEnvironment()
            ->getDataProvider()
            ->fetchAll($otherConfig->setIdOnly(true));

        if (\is_array($total)) {
            $this->intTotal = $total ? \count($total) : 0;

            return;
        }

        if (\is_object($total)) {
            $this->intTotal = $total->length();

            return;
        }

        $this->intTotal = 0;
    }
898282
public function GetTotalDiscountValue()
    {
        $iCurrentPosition = $this->getItemPointer();
        $this->GoToStart();

        $dTotalDiscountValue = 0;

        while ($oItem = &$this->Next()) {
            $dTotalDiscountValue += ($oItem->dPriceTotal - $oItem->dPriceTotalAfterDiscount);
        }
        $this->setItemPointer($iCurrentPosition);

        return $dTotalDiscountValue;
    }
131319
protected function getObjective()
    {
        $sum = 0.0;
        $distance = new Euclidean();
        for ($i = 0; $i < $this->clustersNumber; ++$i) {
            $clust = $this->clusters[$i]->getCoordinates();
            for ($k = 0; $k < $this->sampleCount; ++$k) {
                $point = $this->samples[$k];
                $sum += $distance->distance($clust, $point);
            }
        }

        return $sum;
    }
205450
public function sum($cb = null)
    {
        $sum = 0;

        $this->recursive(
            $this->storage,
            function ($value) use (& $sum) {
                if (is_numeric($value)) {
                    $sum += $value;
                }
            }
        );

        if ($cb !== null) {
            call_user_func_array($cb, [$sum]);
        }

        return $sum;
    }
972240
protected function getMinValue()
    {
        $minValue = $this->getFilter()->getMinValue();

        if ($this->isManualCalculation() && ($this->getStepValue() > 0)) {
            $stepValue = $this->getStepValue();
            $minValue  = floor($minValue / $stepValue) * $stepValue;
        }

        return $minValue;
    }
1343563
private function calculate()
    {
        if (count($this->points) < 2) {
            throw new \RuntimeException('There must be two or more points (co-ordinates) before a calculation can be performed.');
        }
        $total = 0;
        foreach ($this->points as $point) {
            if (isset($previous)) {
                $total += $this->distanceBetweenPoints($previous, $point);
            }
            $previous = $point;
        }
        return $total;
    }
335711
public function calculateDiscount()
    {
        $dPrice = $this->getPrice();
        $aDiscounts = $this->getDiscounts();

        if ($aDiscounts) {
            foreach ($aDiscounts as $aDiscount) {
                if ($aDiscount['type'] == 'abs') {
                    $dPrice = $dPrice - $aDiscount['value'];
                } else {
                    $dPrice = $dPrice * (100 - $aDiscount['value']) / 100;
                }
            }
            if ($dPrice < 0) {
                $this->setPrice(0);
            } else {
                $this->setPrice($dPrice);
            }

            $this->_flushDiscounts();
        }
    }
704201
public function GetTotalVatValue()
    {
        $dVal = 0;
        $iPointer = $this->getItemPointer();
        $this->GoToStart();
        while ($oItem = &$this->Next()) {
            $dVal += $oItem->GetVatValue();
        }
        $this->setItemPointer($iPointer);

        return $dVal;
    }
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;
	}
474025
public function getRowsCountRecursive()
    {
        $totalCount = 0;
        foreach ($this->rows as $row) {
            $subTable = $row->getSubtable();
            if ($subTable) {
                $count = $subTable->getRowsCountRecursive();
                $totalCount += $count;
            }
        }

        $totalCount += $this->getRowsCount();
        return $totalCount;
    }
1101614
public function getTotal()
    {
        if ($this->updateRequested) {
            $this->total = $this->getTotalWithExclusions([]);
            $this->updateRequested = false;
            $this->saveState();
        }

        return $this->total;
    }