Exemplo n.º 1
0
 /**
  * @expectedException OutOfRangeException
  */
 public function testGetElemInvalidOffset()
 {
     $this->A->getElem(1, 3);
 }
Exemplo n.º 2
0
 /**
  * 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;
 }