From f1ab2f022fdc780aca0944d90e9a0e844a0820d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 27 May 2024 13:12:17 +0200 Subject: =?UTF-8?q?2024-02-19:=20popravljen=20(prej=C5=A1nji=20commit=20je?= =?UTF-8?q?=20napa=C4=8Den)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PHPExcel/Shared/JAMA/examples/benchmark.php | 263 --------------------- 1 file changed, 263 deletions(-) delete mode 100644 admin/survey/excel/PHPExcel/Shared/JAMA/examples/benchmark.php (limited to 'admin/survey/excel/PHPExcel/Shared/JAMA/examples/benchmark.php') diff --git a/admin/survey/excel/PHPExcel/Shared/JAMA/examples/benchmark.php b/admin/survey/excel/PHPExcel/Shared/JAMA/examples/benchmark.php deleted file mode 100644 index 42a4884..0000000 --- a/admin/survey/excel/PHPExcel/Shared/JAMA/examples/benchmark.php +++ /dev/null @@ -1,263 +0,0 @@ -stat->setData($times); - $stats = $this->stat->calcFull(); - - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo '
n:' . $stats['count'] . '
Mean:' . $stats['mean'] . '
Min.:' . $stats['min'] . '
Max.:' . $stats['max'] . '
σ:' . $stats['stdev'] . '
Variance:' . $stats['variance'] . '
Range:' . $stats['range'] . '
'; - - return $stats; - } // function displayStats() - - - function runEig($n = 4, $t = 100) { - $times = array(); - - for ($i = 0; $i < $t; ++$i) { - $M = Matrix::random($n, $n); - $start_time = $this->microtime_float(); - $E = new EigenvalueDecomposition($M); - $stop_time = $this->microtime_float(); - $times[] = $stop_time - $start_time; - } - - return $times; - } // function runEig() - - - function runLU($n = 4, $t = 100) { - $times = array(); - - for ($i = 0; $i < $t; ++$i) { - $M = Matrix::random($n, $n); - $start_time = $this->microtime_float(); - $E = new LUDecomposition($M); - $stop_time = $this->microtime_float(); - $times[] = $stop_time - $start_time; - } - - return $times; - } // function runLU() - - - function runQR($n = 4, $t = 100) { - $times = array(); - - for ($i = 0; $i < $t; ++$i) { - $M = Matrix::random($n, $n); - $start_time = $this->microtime_float(); - $E = new QRDecomposition($M); - $stop_time = $this->microtime_float(); - $times[] = $stop_time - $start_time; - } - - return $times; - } // function runQR() - - - function runCholesky($n = 4, $t = 100) { - $times = array(); - - for ($i = 0; $i < $t; ++$i) { - $M = Matrix::random($n, $n); - $start_time = $this->microtime_float(); - $E = new CholeskyDecomposition($M); - $stop_time = $this->microtime_float(); - $times[] = $stop_time - $start_time; - } - - return $times; - } // function runCholesky() - - - function runSVD($n = 4, $t = 100) { - $times = array(); - - for ($i = 0; $i < $t; ++$i) { - $M = Matrix::random($n, $n); - $start_time = $this->microtime_float(); - $E = new SingularValueDecomposition($M); - $stop_time = $this->microtime_float(); - $times[] = $stop_time - $start_time; - } - - return $times; - } // function runSVD() - - - function run() { - $n = 8; - $t = 16; - $sum = 0; - echo "Cholesky decomposition: $t random {$n}x{$n} matrices
"; - $r = $this->displayStats($this->runCholesky($n, $t)); - $sum += $r['mean'] * $n; - - echo '
'; - - echo "Eigenvalue decomposition: $t random {$n}x{$n} matrices
"; - $r = $this->displayStats($this->runEig($n, $t)); - $sum += $r['mean'] * $n; - - echo '
'; - - echo "LU decomposition: $t random {$n}x{$n} matrices
"; - $r = $this->displayStats($this->runLU($n, $t)); - $sum += $r['mean'] * $n; - - echo '
'; - - echo "QR decomposition: $t random {$n}x{$n} matrices
"; - $r = $this->displayStats($this->runQR($n, $t)); - $sum += $r['mean'] * $n; - - echo '
'; - - echo "Singular Value decomposition: $t random {$n}x{$n} matrices
"; - $r = $this->displayStats($this->runSVD($n, $t)); - $sum += $r['mean'] * $n; - - return $sum; - } // function run() - - - public function __construct() { - $this->stat = new Base(); - } // function Benchmark() - -} // class Benchmark (end MagicSquareExample) - - -$benchmark = new Benchmark(); - -switch($_REQUEST['decomposition']) { - case 'cholesky': - $m = array(); - for ($i = 2; $i <= 8; $i *= 2) { - $t = 32 / $i; - echo "Cholesky decomposition: $t random {$i}x{$i} matrices
"; - $s = $benchmark->displayStats($benchmark->runCholesky($i, $t)); - $m[$i] = $s['mean']; - echo "
"; - } - echo '
';
-		foreach($m as $x => $y) {
-			echo "$x\t" . 1000*$y . "\n";
-		}
-		echo '
'; - break; - case 'eigenvalue': - $m = array(); - for ($i = 2; $i <= 8; $i *= 2) { - $t = 32 / $i; - echo "Eigenvalue decomposition: $t random {$i}x{$i} matrices
"; - $s = $benchmark->displayStats($benchmark->runEig($i, $t)); - $m[$i] = $s['mean']; - echo "
"; - } - echo '
';
-		foreach($m as $x => $y) {
-			echo "$x\t" . 1000*$y . "\n";
-		}
-		echo '
'; - break; - case 'lu': - $m = array(); - for ($i = 2; $i <= 8; $i *= 2) { - $t = 32 / $i; - echo "LU decomposition: $t random {$i}x{$i} matrices
"; - $s = $benchmark->displayStats($benchmark->runLU($i, $t)); - $m[$i] = $s['mean']; - echo "
"; - } - echo '
';
-		foreach($m as $x => $y) {
-			echo "$x\t" . 1000*$y . "\n";
-		}
-		echo '
'; - break; - case 'qr': - $m = array(); - for ($i = 2; $i <= 8; $i *= 2) { - $t = 32 / $i; - echo "QR decomposition: $t random {$i}x{$i} matrices
"; - $s = $benchmark->displayStats($benchmark->runQR($i, $t)); - $m[$i] = $s['mean']; - echo "
"; - } - echo '
';
-		foreach($m as $x => $y) {
-			echo "$x\t" . 1000*$y . "\n";
-		}
-		echo '
'; - break; - case 'svd': - $m = array(); - for($i = 2; $i <= 8; $i *= 2) { - $t = 32 / $i; - echo "Singular value decomposition: $t random {$i}x{$i} matrices
"; - $s = $benchmark->displayStats($benchmark->runSVD($i, $t)); - $m[$i] = $s['mean']; - echo "
"; - } - echo '
';
-		foreach($m as $x => $y) {
-			echo "$x\t" . 1000*$y . "\n";
-		}
-		echo '
'; - break; - case 'all': - $s = $benchmark->run(); - print("
Total: {$s}s
"); - break; - default: - ?> - -