private static function PHPExcel_Calculation::_resizeMatricesShrink in Loft Data Grids 7.2
Same name and namespace in other branches
- 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation.php \PHPExcel_Calculation::_resizeMatricesShrink()
* Ensure that paired matrix operands are both matrices of the same size * *
Parameters
mixed &$matrix1 First matrix operand: * @param mixed &$matrix2 Second matrix operand * @param integer $matrix1Rows Row size of first matrix operand * @param integer $matrix1Columns Column size of first matrix operand * @param integer $matrix2Rows Row size of second matrix operand * @param integer $matrix2Columns Column size of second matrix operand
1 call to PHPExcel_Calculation::_resizeMatricesShrink()
- PHPExcel_Calculation::_checkMatrixOperands in vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Calculation.php - * Ensure that paired matrix operands are both matrices and of the same size * *
File
- vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Calculation.php, line 2500
Class
- PHPExcel_Calculation
- PHPExcel_Calculation (Multiton)
Code
private static function _resizeMatricesShrink(&$matrix1, &$matrix2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns) {
if ($matrix2Columns < $matrix1Columns || $matrix2Rows < $matrix1Rows) {
if ($matrix2Rows < $matrix1Rows) {
for ($i = $matrix2Rows; $i < $matrix1Rows; ++$i) {
unset($matrix1[$i]);
}
}
if ($matrix2Columns < $matrix1Columns) {
for ($i = 0; $i < $matrix1Rows; ++$i) {
for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) {
unset($matrix1[$i][$j]);
}
}
}
}
if ($matrix1Columns < $matrix2Columns || $matrix1Rows < $matrix2Rows) {
if ($matrix1Rows < $matrix2Rows) {
for ($i = $matrix1Rows; $i < $matrix2Rows; ++$i) {
unset($matrix2[$i]);
}
}
if ($matrix1Columns < $matrix2Columns) {
for ($i = 0; $i < $matrix2Rows; ++$i) {
for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) {
unset($matrix2[$i][$j]);
}
}
}
}
}