Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php if (!defined("\120\110\x50\x45\x58\103\x45\x4c\137\x52\117\x4f\x54")) { define("\12..

Decoded Output download

<?php
 if (!defined("PHPEXCEL_ROOT")) { define("PHPEXCEL_ROOT", dirname(__FILE__) . "/../../../"); require PHPEXCEL_ROOT . "PHPExcel/Autoloader.php"; } class PHPExcel_Shared_JAMA_Matrix { const POLYMORPHIC_ARGUMENT_EXCEPTION = "Invalid argument pattern for polymorphic function."; const ARGUMENT_TYPE_EXCEPTION = "Invalid argument type."; const ARGUMENT_BOUNDS_EXCEPTION = "Invalid argument range."; const MATRIX_DIMENSION_EXCEPTION = "Matrix dimensions are not equal."; const ARRAY_LENGTH_EXCEPTION = "Array length must be a multiple of m."; public $A = array(); private $m; private $n; public function __construct() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode(",", array_map("gettype", $args)); switch ($match) { case "array": $this->m = count($args[0]); $this->n = count($args[0][0]); $this->A = $args[0]; break; case "integer": $this->m = $args[0]; $this->n = $args[0]; $this->A = array_fill(0, $this->m, array_fill(0, $this->n, 0)); break; case "integer,integer": $this->m = $args[0]; $this->n = $args[1]; $this->A = array_fill(0, $this->m, array_fill(0, $this->n, 0)); break; case "array,integer": $this->m = $args[1]; if ($this->m != 0) { $this->n = count($args[0]) / $this->m; } else { $this->n = 0; } if ($this->m * $this->n == count($args[0])) { for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $this->A[$i][$j] = $args[0][$i + $j * $this->m]; } } } else { throw new PHPExcel_Calculation_Exception(self::ARRAY_LENGTH_EXCEPTION); } break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function getArray() { return $this->A; } public function getRowDimension() { return $this->m; } public function getColumnDimension() { return $this->n; } public function get($i = null, $j = null) { return $this->A[$i][$j]; } public function getMatrix() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode(",", array_map("gettype", $args)); switch ($match) { case "integer,integer": list($i0, $j0) = $args; if ($i0 >= 0) { $m = $this->m - $i0; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if ($j0 >= 0) { $n = $this->n - $j0; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); for ($i = $i0; $i < $this->m; ++$i) { for ($j = $j0; $j < $this->n; ++$j) { $R->set($i, $j, $this->A[$i][$j]); } } return $R; break; case "integer,integer,integer,integer": list($i0, $iF, $j0, $jF) = $args; if ($iF > $i0 && $this->m >= $iF && $i0 >= 0) { $m = $iF - $i0; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if ($jF > $j0 && $this->n >= $jF && $j0 >= 0) { $n = $jF - $j0; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new PHPExcel_Shared_JAMA_Matrix($m + 1, $n + 1); for ($i = $i0; $i <= $iF; ++$i) { for ($j = $j0; $j <= $jF; ++$j) { $R->set($i - $i0, $j - $j0, $this->A[$i][$j]); } } return $R; break; case "array,array": list($RL, $CL) = $args; if (count($RL) > 0) { $m = count($RL); } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (count($CL) > 0) { $n = count($CL); } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); for ($i = 0; $i < $m; ++$i) { for ($j = 0; $j < $n; ++$j) { $R->set($i - $i0, $j - $j0, $this->A[$RL[$i]][$CL[$j]]); } } return $R; break; case "array,array": list($RL, $CL) = $args; if (count($RL) > 0) { $m = count($RL); } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (count($CL) > 0) { $n = count($CL); } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); for ($i = 0; $i < $m; ++$i) { for ($j = 0; $j < $n; ++$j) { $R->set($i, $j, $this->A[$RL[$i]][$CL[$j]]); } } return $R; break; case "integer,integer,array": list($i0, $iF, $CL) = $args; if ($iF > $i0 && $this->m >= $iF && $i0 >= 0) { $m = $iF - $i0; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (count($CL) > 0) { $n = count($CL); } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); for ($i = $i0; $i < $iF; ++$i) { for ($j = 0; $j < $n; ++$j) { $R->set($i - $i0, $j, $this->A[$RL[$i]][$j]); } } return $R; break; case "array,integer,integer": list($RL, $j0, $jF) = $args; if (count($RL) > 0) { $m = count($RL); } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if ($jF >= $j0 && $this->n >= $jF && $j0 >= 0) { $n = $jF - $j0; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new PHPExcel_Shared_JAMA_Matrix($m, $n + 1); for ($i = 0; $i < $m; ++$i) { for ($j = $j0; $j <= $jF; ++$j) { $R->set($i, $j - $j0, $this->A[$RL[$i]][$j]); } } return $R; break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function checkMatrixDimensions($B = null) { if ($B instanceof PHPExcel_Shared_JAMA_Matrix) { if ($this->m == $B->getRowDimension() && $this->n == $B->getColumnDimension()) { return true; } else { throw new PHPExcel_Calculation_Exception(self::MATRIX_DIMENSION_EXCEPTION); } } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } } public function set($i = null, $j = null, $c = null) { $this->A[$i][$j] = $c; } public function identity($m = null, $n = null) { return $this->diagonal($m, $n, 1); } public function diagonal($m = null, $n = null, $c = 1) { $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); for ($i = 0; $i < $m; ++$i) { $R->set($i, $i, $c); } return $R; } public function getMatrixByRow($i0 = null, $iF = null) { if (is_int($i0)) { if (is_int($iF)) { return $this->getMatrix($i0, 0, $iF + 1, $this->n); } else { return $this->getMatrix($i0, 0, $i0 + 1, $this->n); } } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } } public function getMatrixByCol($j0 = null, $jF = null) { if (is_int($j0)) { if (is_int($jF)) { return $this->getMatrix(0, $j0, $this->m, $jF + 1); } else { return $this->getMatrix(0, $j0, $this->m, $j0 + 1); } } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } } public function transpose() { $R = new PHPExcel_Shared_JAMA_Matrix($this->n, $this->m); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $R->set($j, $i, $this->A[$i][$j]); } } return $R; } public function trace() { $s = 0; $n = min($this->m, $this->n); for ($i = 0; $i < $n; ++$i) { $s += $this->A[$i][$i]; } return $s; } public function uminus() { } public function plus() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode(",", array_map("gettype", $args)); switch ($match) { case "object": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "array": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $M->set($i, $j, $M->get($i, $j) + $this->A[$i][$j]); } } return $M; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function plusEquals() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode(",", array_map("gettype", $args)); switch ($match) { case "object": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "array": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $validValues = true; $value = $M->get($i, $j); if (is_string($this->A[$i][$j]) && strlen($this->A[$i][$j]) > 0 && !is_numeric($this->A[$i][$j])) { $this->A[$i][$j] = trim($this->A[$i][$j], """); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); } if (is_string($value) && strlen($value) > 0 && !is_numeric($value)) { $value = trim($value, """); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] += $value; } else { $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN(); } } } return $this; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function minus() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode(",", array_map("gettype", $args)); switch ($match) { case "object": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "array": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $M->set($i, $j, $M->get($i, $j) - $this->A[$i][$j]); } } return $M; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function minusEquals() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode(",", array_map("gettype", $args)); switch ($match) { case "object": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "array": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $validValues = true; $value = $M->get($i, $j); if (is_string($this->A[$i][$j]) && strlen($this->A[$i][$j]) > 0 && !is_numeric($this->A[$i][$j])) { $this->A[$i][$j] = trim($this->A[$i][$j], """); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); } if (is_string($value) && strlen($value) > 0 && !is_numeric($value)) { $value = trim($value, """); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] -= $value; } else { $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN(); } } } return $this; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function arrayTimes() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode(",", array_map("gettype", $args)); switch ($match) { case "object": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "array": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $M->set($i, $j, $M->get($i, $j) * $this->A[$i][$j]); } } return $M; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function arrayTimesEquals() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode(",", array_map("gettype", $args)); switch ($match) { case "object": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "array": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $validValues = true; $value = $M->get($i, $j); if (is_string($this->A[$i][$j]) && strlen($this->A[$i][$j]) > 0 && !is_numeric($this->A[$i][$j])) { $this->A[$i][$j] = trim($this->A[$i][$j], """); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); } if (is_string($value) && strlen($value) > 0 && !is_numeric($value)) { $value = trim($value, """); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] *= $value; } else { $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN(); } } } return $this; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function arrayRightDivide() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode(",", array_map("gettype", $args)); switch ($match) { case "object": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "array": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $validValues = true; $value = $M->get($i, $j); if (is_string($this->A[$i][$j]) && strlen($this->A[$i][$j]) > 0 && !is_numeric($this->A[$i][$j])) { $this->A[$i][$j] = trim($this->A[$i][$j], """); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); } if (is_string($value) && strlen($value) > 0 && !is_numeric($value)) { $value = trim($value, """); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); } if ($validValues) { if ($value == 0) { $M->set($i, $j, "#DIV/0!"); } else { $M->set($i, $j, $this->A[$i][$j] / $value); } } else { $M->set($i, $j, PHPExcel_Calculation_Functions::NaN()); } } } return $M; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function arrayRightDivideEquals() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode(",", array_map("gettype", $args)); switch ($match) { case "object": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "array": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $this->A[$i][$j] = $this->A[$i][$j] / $M->get($i, $j); } } return $M; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function arrayLeftDivide() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode(",", array_map("gettype", $args)); switch ($match) { case "object": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "array": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $M->set($i, $j, $M->get($i, $j) / $this->A[$i][$j]); } } return $M; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function arrayLeftDivideEquals() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode(",", array_map("gettype", $args)); switch ($match) { case "object": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "array": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $this->A[$i][$j] = $M->get($i, $j) / $this->A[$i][$j]; } } return $M; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function times() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode(",", array_map("gettype", $args)); switch ($match) { case "object": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $B = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } if ($this->n == $B->m) { $C = new PHPExcel_Shared_JAMA_Matrix($this->m, $B->n); for ($j = 0; $j < $B->n; ++$j) { for ($k = 0; $k < $this->n; ++$k) { $Bcolj[$k] = $B->A[$k][$j]; } for ($i = 0; $i < $this->m; ++$i) { $Arowi = $this->A[$i]; $s = 0; for ($k = 0; $k < $this->n; ++$k) { $s += $Arowi[$k] * $Bcolj[$k]; } $C->A[$i][$j] = $s; } } return $C; } else { throw new PHPExcel_Calculation_Exception(JAMAError(MatrixDimensionMismatch)); } break; case "array": $B = new PHPExcel_Shared_JAMA_Matrix($args[0]); if ($this->n == $B->m) { $C = new PHPExcel_Shared_JAMA_Matrix($this->m, $B->n); for ($i = 0; $i < $C->m; ++$i) { for ($j = 0; $j < $C->n; ++$j) { $s = "0"; for ($k = 0; $k < $C->n; ++$k) { $s += $this->A[$i][$k] * $B->A[$k][$j]; } $C->A[$i][$j] = $s; } } return $C; } else { throw new PHPExcel_Calculation_Exception(JAMAError(MatrixDimensionMismatch)); } return $M; break; case "integer": $C = new PHPExcel_Shared_JAMA_Matrix($this->A); for ($i = 0; $i < $C->m; ++$i) { for ($j = 0; $j < $C->n; ++$j) { $C->A[$i][$j] *= $args[0]; } } return $C; break; case "double": $C = new PHPExcel_Shared_JAMA_Matrix($this->m, $this->n); for ($i = 0; $i < $C->m; ++$i) { for ($j = 0; $j < $C->n; ++$j) { $C->A[$i][$j] = $args[0] * $this->A[$i][$j]; } } return $C; break; case "float": $C = new PHPExcel_Shared_JAMA_Matrix($this->A); for ($i = 0; $i < $C->m; ++$i) { for ($j = 0; $j < $C->n; ++$j) { $C->A[$i][$j] *= $args[0]; } } return $C; break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function power() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode(",", array_map("gettype", $args)); switch ($match) { case "object": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "array": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $validValues = true; $value = $M->get($i, $j); if (is_string($this->A[$i][$j]) && strlen($this->A[$i][$j]) > 0 && !is_numeric($this->A[$i][$j])) { $this->A[$i][$j] = trim($this->A[$i][$j], """); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); } if (is_string($value) && strlen($value) > 0 && !is_numeric($value)) { $value = trim($value, """); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] = pow($this->A[$i][$j], $value); } else { $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN(); } } } return $this; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function concat() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode(",", array_map("gettype", $args)); switch ($match) { case "object": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } case "array": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $this->A[$i][$j] = trim($this->A[$i][$j], """) . trim($M->get($i, $j), """); } } return $this; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function solve($B) { if ($this->m == $this->n) { $LU = new PHPExcel_Shared_JAMA_LUDecomposition($this); return $LU->solve($B); } else { $QR = new PHPExcel_Shared_JAMA_QRDecomposition($this); return $QR->solve($B); } } public function inverse() { return $this->solve($this->identity($this->m, $this->m)); } public function det() { $L = new PHPExcel_Shared_JAMA_LUDecomposition($this); return $L->det(); } } ?>

Did this file decode correctly?

Original Code

<?php
 if (!defined("\120\110\x50\x45\x58\103\x45\x4c\137\x52\117\x4f\x54")) { define("\120\x48\120\x45\x58\103\105\x4c\x5f\x52\117\117\x54", dirname(__FILE__) . "\57\x2e\56\57\56\x2e\57\56\x2e\57"); require PHPEXCEL_ROOT . "\x50\x48\120\105\x78\143\145\154\x2f\x41\165\x74\157\154\x6f\141\x64\x65\x72\x2e\x70\150\x70"; } class PHPExcel_Shared_JAMA_Matrix { const POLYMORPHIC_ARGUMENT_EXCEPTION = "\111\x6e\166\x61\x6c\151\x64\40\141\162\147\165\155\145\x6e\164\x20\160\141\164\x74\x65\162\156\x20\x66\x6f\x72\40\x70\x6f\154\x79\155\157\162\160\x68\151\x63\x20\146\x75\156\x63\164\151\157\156\x2e"; const ARGUMENT_TYPE_EXCEPTION = "\111\x6e\166\141\154\x69\144\x20\x61\162\x67\165\155\x65\x6e\164\x20\x74\171\x70\145\56"; const ARGUMENT_BOUNDS_EXCEPTION = "\x49\x6e\x76\141\154\151\144\40\141\x72\147\165\x6d\145\156\164\40\x72\141\x6e\x67\145\56"; const MATRIX_DIMENSION_EXCEPTION = "\x4d\x61\164\x72\x69\170\x20\144\x69\155\x65\x6e\x73\x69\x6f\x6e\x73\x20\141\162\x65\40\156\157\164\x20\x65\x71\165\141\x6c\x2e"; const ARRAY_LENGTH_EXCEPTION = "\101\162\x72\141\x79\x20\x6c\x65\156\x67\164\x68\x20\155\165\163\164\x20\x62\145\40\141\x20\x6d\165\154\x74\151\160\x6c\145\40\x6f\x66\x20\155\x2e"; public $A = array(); private $m; private $n; public function __construct() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode("\54", array_map("\147\145\x74\x74\x79\x70\x65", $args)); switch ($match) { case "\x61\162\162\x61\x79": $this->m = count($args[0]); $this->n = count($args[0][0]); $this->A = $args[0]; break; case "\x69\156\x74\145\147\145\x72": $this->m = $args[0]; $this->n = $args[0]; $this->A = array_fill(0, $this->m, array_fill(0, $this->n, 0)); break; case "\x69\156\x74\x65\x67\x65\162\x2c\x69\x6e\164\145\147\x65\162": $this->m = $args[0]; $this->n = $args[1]; $this->A = array_fill(0, $this->m, array_fill(0, $this->n, 0)); break; case "\141\x72\162\141\171\x2c\x69\x6e\164\145\147\145\162": $this->m = $args[1]; if ($this->m != 0) { $this->n = count($args[0]) / $this->m; } else { $this->n = 0; } if ($this->m * $this->n == count($args[0])) { for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $this->A[$i][$j] = $args[0][$i + $j * $this->m]; } } } else { throw new PHPExcel_Calculation_Exception(self::ARRAY_LENGTH_EXCEPTION); } break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function getArray() { return $this->A; } public function getRowDimension() { return $this->m; } public function getColumnDimension() { return $this->n; } public function get($i = null, $j = null) { return $this->A[$i][$j]; } public function getMatrix() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode("\x2c", array_map("\147\145\164\x74\x79\160\145", $args)); switch ($match) { case "\x69\156\164\x65\x67\145\162\54\151\156\164\x65\147\x65\162": list($i0, $j0) = $args; if ($i0 >= 0) { $m = $this->m - $i0; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if ($j0 >= 0) { $n = $this->n - $j0; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); for ($i = $i0; $i < $this->m; ++$i) { for ($j = $j0; $j < $this->n; ++$j) { $R->set($i, $j, $this->A[$i][$j]); } } return $R; break; case "\151\156\164\x65\x67\145\x72\x2c\151\x6e\164\x65\147\145\x72\54\x69\156\164\145\147\x65\x72\x2c\x69\x6e\164\x65\147\x65\162": list($i0, $iF, $j0, $jF) = $args; if ($iF > $i0 && $this->m >= $iF && $i0 >= 0) { $m = $iF - $i0; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if ($jF > $j0 && $this->n >= $jF && $j0 >= 0) { $n = $jF - $j0; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new PHPExcel_Shared_JAMA_Matrix($m + 1, $n + 1); for ($i = $i0; $i <= $iF; ++$i) { for ($j = $j0; $j <= $jF; ++$j) { $R->set($i - $i0, $j - $j0, $this->A[$i][$j]); } } return $R; break; case "\x61\x72\162\x61\x79\x2c\x61\162\162\141\x79": list($RL, $CL) = $args; if (count($RL) > 0) { $m = count($RL); } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (count($CL) > 0) { $n = count($CL); } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); for ($i = 0; $i < $m; ++$i) { for ($j = 0; $j < $n; ++$j) { $R->set($i - $i0, $j - $j0, $this->A[$RL[$i]][$CL[$j]]); } } return $R; break; case "\141\x72\162\141\x79\x2c\x61\162\162\141\x79": list($RL, $CL) = $args; if (count($RL) > 0) { $m = count($RL); } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (count($CL) > 0) { $n = count($CL); } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); for ($i = 0; $i < $m; ++$i) { for ($j = 0; $j < $n; ++$j) { $R->set($i, $j, $this->A[$RL[$i]][$CL[$j]]); } } return $R; break; case "\151\156\164\x65\147\x65\x72\x2c\151\x6e\x74\x65\147\145\x72\54\141\x72\162\x61\x79": list($i0, $iF, $CL) = $args; if ($iF > $i0 && $this->m >= $iF && $i0 >= 0) { $m = $iF - $i0; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (count($CL) > 0) { $n = count($CL); } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); for ($i = $i0; $i < $iF; ++$i) { for ($j = 0; $j < $n; ++$j) { $R->set($i - $i0, $j, $this->A[$RL[$i]][$j]); } } return $R; break; case "\x61\x72\x72\141\x79\x2c\151\156\164\x65\x67\145\x72\54\151\x6e\x74\x65\147\145\x72": list($RL, $j0, $jF) = $args; if (count($RL) > 0) { $m = count($RL); } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if ($jF >= $j0 && $this->n >= $jF && $j0 >= 0) { $n = $jF - $j0; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new PHPExcel_Shared_JAMA_Matrix($m, $n + 1); for ($i = 0; $i < $m; ++$i) { for ($j = $j0; $j <= $jF; ++$j) { $R->set($i, $j - $j0, $this->A[$RL[$i]][$j]); } } return $R; break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function checkMatrixDimensions($B = null) { if ($B instanceof PHPExcel_Shared_JAMA_Matrix) { if ($this->m == $B->getRowDimension() && $this->n == $B->getColumnDimension()) { return true; } else { throw new PHPExcel_Calculation_Exception(self::MATRIX_DIMENSION_EXCEPTION); } } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } } public function set($i = null, $j = null, $c = null) { $this->A[$i][$j] = $c; } public function identity($m = null, $n = null) { return $this->diagonal($m, $n, 1); } public function diagonal($m = null, $n = null, $c = 1) { $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); for ($i = 0; $i < $m; ++$i) { $R->set($i, $i, $c); } return $R; } public function getMatrixByRow($i0 = null, $iF = null) { if (is_int($i0)) { if (is_int($iF)) { return $this->getMatrix($i0, 0, $iF + 1, $this->n); } else { return $this->getMatrix($i0, 0, $i0 + 1, $this->n); } } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } } public function getMatrixByCol($j0 = null, $jF = null) { if (is_int($j0)) { if (is_int($jF)) { return $this->getMatrix(0, $j0, $this->m, $jF + 1); } else { return $this->getMatrix(0, $j0, $this->m, $j0 + 1); } } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } } public function transpose() { $R = new PHPExcel_Shared_JAMA_Matrix($this->n, $this->m); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $R->set($j, $i, $this->A[$i][$j]); } } return $R; } public function trace() { $s = 0; $n = min($this->m, $this->n); for ($i = 0; $i < $n; ++$i) { $s += $this->A[$i][$i]; } return $s; } public function uminus() { } public function plus() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode("\x2c", array_map("\147\145\x74\x74\171\160\x65", $args)); switch ($match) { case "\x6f\142\152\145\143\164": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "\141\162\162\141\x79": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $M->set($i, $j, $M->get($i, $j) + $this->A[$i][$j]); } } return $M; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function plusEquals() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode("\x2c", array_map("\x67\x65\x74\x74\171\160\x65", $args)); switch ($match) { case "\157\x62\152\x65\x63\x74": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "\x61\162\x72\141\171": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $validValues = true; $value = $M->get($i, $j); if (is_string($this->A[$i][$j]) && strlen($this->A[$i][$j]) > 0 && !is_numeric($this->A[$i][$j])) { $this->A[$i][$j] = trim($this->A[$i][$j], "\x22"); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); } if (is_string($value) && strlen($value) > 0 && !is_numeric($value)) { $value = trim($value, "\x22"); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] += $value; } else { $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN(); } } } return $this; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function minus() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode("\x2c", array_map("\147\x65\x74\x74\171\160\x65", $args)); switch ($match) { case "\157\x62\152\x65\143\164": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "\x61\x72\162\141\x79": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $M->set($i, $j, $M->get($i, $j) - $this->A[$i][$j]); } } return $M; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function minusEquals() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode("\x2c", array_map("\x67\145\164\x74\x79\x70\145", $args)); switch ($match) { case "\x6f\142\x6a\145\143\x74": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "\141\x72\162\141\171": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $validValues = true; $value = $M->get($i, $j); if (is_string($this->A[$i][$j]) && strlen($this->A[$i][$j]) > 0 && !is_numeric($this->A[$i][$j])) { $this->A[$i][$j] = trim($this->A[$i][$j], "\x22"); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); } if (is_string($value) && strlen($value) > 0 && !is_numeric($value)) { $value = trim($value, "\x22"); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] -= $value; } else { $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN(); } } } return $this; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function arrayTimes() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode("\x2c", array_map("\x67\x65\164\x74\x79\160\x65", $args)); switch ($match) { case "\x6f\x62\x6a\x65\x63\164": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "\141\x72\162\x61\171": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $M->set($i, $j, $M->get($i, $j) * $this->A[$i][$j]); } } return $M; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function arrayTimesEquals() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode("\54", array_map("\147\145\x74\x74\x79\160\145", $args)); switch ($match) { case "\x6f\x62\x6a\145\143\x74": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "\x61\162\x72\141\171": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $validValues = true; $value = $M->get($i, $j); if (is_string($this->A[$i][$j]) && strlen($this->A[$i][$j]) > 0 && !is_numeric($this->A[$i][$j])) { $this->A[$i][$j] = trim($this->A[$i][$j], "\42"); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); } if (is_string($value) && strlen($value) > 0 && !is_numeric($value)) { $value = trim($value, "\x22"); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] *= $value; } else { $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN(); } } } return $this; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function arrayRightDivide() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode("\x2c", array_map("\147\x65\x74\164\171\x70\145", $args)); switch ($match) { case "\157\142\152\145\143\164": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "\141\x72\x72\x61\171": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $validValues = true; $value = $M->get($i, $j); if (is_string($this->A[$i][$j]) && strlen($this->A[$i][$j]) > 0 && !is_numeric($this->A[$i][$j])) { $this->A[$i][$j] = trim($this->A[$i][$j], "\x22"); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); } if (is_string($value) && strlen($value) > 0 && !is_numeric($value)) { $value = trim($value, "\42"); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); } if ($validValues) { if ($value == 0) { $M->set($i, $j, "\43\x44\111\x56\57\60\x21"); } else { $M->set($i, $j, $this->A[$i][$j] / $value); } } else { $M->set($i, $j, PHPExcel_Calculation_Functions::NaN()); } } } return $M; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function arrayRightDivideEquals() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode("\54", array_map("\147\x65\164\x74\171\160\x65", $args)); switch ($match) { case "\157\142\x6a\x65\143\x74": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "\x61\162\x72\x61\171": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $this->A[$i][$j] = $this->A[$i][$j] / $M->get($i, $j); } } return $M; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function arrayLeftDivide() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode("\54", array_map("\x67\145\164\164\171\x70\x65", $args)); switch ($match) { case "\157\142\152\145\143\x74": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "\141\162\162\x61\171": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $M->set($i, $j, $M->get($i, $j) / $this->A[$i][$j]); } } return $M; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function arrayLeftDivideEquals() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode("\54", array_map("\147\145\164\164\x79\x70\145", $args)); switch ($match) { case "\157\x62\152\x65\x63\x74": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "\141\x72\162\141\171": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $this->A[$i][$j] = $M->get($i, $j) / $this->A[$i][$j]; } } return $M; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function times() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode("\x2c", array_map("\x67\x65\164\x74\x79\x70\145", $args)); switch ($match) { case "\x6f\142\x6a\145\143\x74": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $B = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } if ($this->n == $B->m) { $C = new PHPExcel_Shared_JAMA_Matrix($this->m, $B->n); for ($j = 0; $j < $B->n; ++$j) { for ($k = 0; $k < $this->n; ++$k) { $Bcolj[$k] = $B->A[$k][$j]; } for ($i = 0; $i < $this->m; ++$i) { $Arowi = $this->A[$i]; $s = 0; for ($k = 0; $k < $this->n; ++$k) { $s += $Arowi[$k] * $Bcolj[$k]; } $C->A[$i][$j] = $s; } } return $C; } else { throw new PHPExcel_Calculation_Exception(JAMAError(MatrixDimensionMismatch)); } break; case "\x61\162\162\x61\x79": $B = new PHPExcel_Shared_JAMA_Matrix($args[0]); if ($this->n == $B->m) { $C = new PHPExcel_Shared_JAMA_Matrix($this->m, $B->n); for ($i = 0; $i < $C->m; ++$i) { for ($j = 0; $j < $C->n; ++$j) { $s = "\x30"; for ($k = 0; $k < $C->n; ++$k) { $s += $this->A[$i][$k] * $B->A[$k][$j]; } $C->A[$i][$j] = $s; } } return $C; } else { throw new PHPExcel_Calculation_Exception(JAMAError(MatrixDimensionMismatch)); } return $M; break; case "\151\156\x74\145\147\145\162": $C = new PHPExcel_Shared_JAMA_Matrix($this->A); for ($i = 0; $i < $C->m; ++$i) { for ($j = 0; $j < $C->n; ++$j) { $C->A[$i][$j] *= $args[0]; } } return $C; break; case "\x64\157\x75\142\154\x65": $C = new PHPExcel_Shared_JAMA_Matrix($this->m, $this->n); for ($i = 0; $i < $C->m; ++$i) { for ($j = 0; $j < $C->n; ++$j) { $C->A[$i][$j] = $args[0] * $this->A[$i][$j]; } } return $C; break; case "\146\x6c\x6f\141\164": $C = new PHPExcel_Shared_JAMA_Matrix($this->A); for ($i = 0; $i < $C->m; ++$i) { for ($j = 0; $j < $C->n; ++$j) { $C->A[$i][$j] *= $args[0]; } } return $C; break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function power() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode("\x2c", array_map("\x67\145\x74\x74\x79\160\145", $args)); switch ($match) { case "\x6f\x62\152\145\143\164": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case "\141\162\x72\x61\x79": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $validValues = true; $value = $M->get($i, $j); if (is_string($this->A[$i][$j]) && strlen($this->A[$i][$j]) > 0 && !is_numeric($this->A[$i][$j])) { $this->A[$i][$j] = trim($this->A[$i][$j], "\42"); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); } if (is_string($value) && strlen($value) > 0 && !is_numeric($value)) { $value = trim($value, "\x22"); $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] = pow($this->A[$i][$j], $value); } else { $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN(); } } } return $this; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function concat() { if (func_num_args() > 0) { $args = func_get_args(); $match = implode("\x2c", array_map("\x67\x65\164\x74\x79\x70\x65", $args)); switch ($match) { case "\x6f\142\152\x65\x63\x74": if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); } case "\141\x72\162\x61\x79": $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); break; default: throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); for ($i = 0; $i < $this->m; ++$i) { for ($j = 0; $j < $this->n; ++$j) { $this->A[$i][$j] = trim($this->A[$i][$j], "\42") . trim($M->get($i, $j), "\x22"); } } return $this; } else { throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } public function solve($B) { if ($this->m == $this->n) { $LU = new PHPExcel_Shared_JAMA_LUDecomposition($this); return $LU->solve($B); } else { $QR = new PHPExcel_Shared_JAMA_QRDecomposition($this); return $QR->solve($B); } } public function inverse() { return $this->solve($this->identity($this->m, $this->m)); } public function det() { $L = new PHPExcel_Shared_JAMA_LUDecomposition($this); return $L->det(); } }

Function Calls

defined 1

Variables

None

Stats

MD5 7dddd2d9ba1b16665322247ea1715634
Eval Count 0
Decode Time 256 ms