/** * @expectedException OutOfRangeException */ public function testGetElemInvalidOffset() { $this->A->getElem(1, 3); }
/** * Return transposed matrix * * @static * @param Matrix $matrix * @return Matrix */ public static function transpose($matrix) { list($rows, $cols) = $matrix->getSize(); $T = MatrixFactory::zeroMatrix($cols, $rows); for ($i = 0; $i < $rows; $i++) { for ($j = 0; $j < $cols; $j++) { $T->setElem($j, $i, $matrix->getElem($i, $j)); } } return $T; }