Ejemplo n.º 1
0
 function testInvert()
 {
     $unit = Math_Matrix::makeUnit(4);
     $q = new Math_Matrix($this->data);
     $p = $q->clone();
     $q->invert();
     $p->multiply($q);
     $this->assertEquals($unit->getData(), $p->getData());
 }
Ejemplo n.º 2
0
 /**
  * Returns the identity matrix of the given size. An alias of Math_Matrix::makeUnit()
  *
  * @static
  * @access public
  * @param integer $size number of rows and columns in the generated matrix
  * @return object a Math_Matrix instance
  * @see Math_Matrix::makeUnit()
  */
 function &makeIdentity($size)
 {
     /*{{{*/
     return Math_Matrix::makeUnit($size);
 }
Ejemplo n.º 3
0
 function testMakeUnit()
 {
     $data = array(array(1.0, 0.0, 0.0), array(0.0, 1.0, 0.0), array(0.0, 0.0, 1.0));
     $q = Math_Matrix::makeUnit(3);
     $this->assertEquals($data, $q->getData());
 }