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()); }
/** * 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); }
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()); }