cvs: pear /Math_Matrix MatrixOp.php
| From: | Jesus M. Castagnetto | Date: | Tue, 28 May 2002 08:37:52 +0000 |
| Subject: | cvs: pear /Math_Matrix MatrixOp.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-4197@lists.php.net to get a copy of this message | ||
jmcastagnetto Tue May 28 04:37:52 2002 EDT
Modified files:
/pear/Math_Matrix MatrixOp.php
Log:
Minor changes to remove redundant error checking
Index: pear/Math_Matrix/MatrixOp.php
diff -u pear/Math_Matrix/MatrixOp.php:1.3 pear/Math_Matrix/MatrixOp.php:1.4
--- pear/Math_Matrix/MatrixOp.php:1.3 Tue May 28 04:35:30 2002
+++ pear/Math_Matrix/MatrixOp.php Tue May 28 04:37:51 2002
@@ -18,7 +18,7 @@
//
// Matrix manipulation class
//
-// $Id: MatrixOp.php,v 1.3 2002/05/28 08:35:30 jmcastagnetto Exp $
+// $Id: MatrixOp.php,v 1.4 2002/05/28 08:37:51 jmcastagnetto Exp $
//
require_once "Math/Vector/VectorOp.php";
@@ -204,7 +204,7 @@
return new Math_Matrix($data);
}/*}}}*/
- function &invert ($m) {
+ function &invert ($m) {/*{{{*/
if (Math_MatrixOp::isMatrix3x3($m))
return Math_MatrixOp::_invert3x3($m);
else if (Math_MatrixOp::isMatrix($m))
@@ -215,12 +215,9 @@
else
return PEAR::raiseError("Inversion implemented only for ".
"Math_Matrix objects (or a subclass)");
- }
+ }/*}}}*/
function &_invert3x3 (&$m) {/*{{{*/
-
- if (!Math_MatrixOp::isMatrix3x3($m))
- return PEAR::raiseError("Inversion implemented only for Math_Matrix3x3
objects");
$d = $m->determinant();
if ($d == 0)
return PEAR::raiseError("Matrix cannot be inverted, determinant = 0");
@@ -257,10 +254,6 @@
* @return mixed a Math_Matrix object on success, a PEAR_Error object otherwise
*/
function &_invertNxN(&$mat) {/*{{{*/
- if (!Math_MatrixOp::isMatrix($mat))
- return PEAR::raiseError("Inverssion implemented only for Math_Matri
objects");
- if (!$mat->isSquare())
- return PEAR::raiseError("Matrix must be square, i.e. n(rows) = n(columns)");
list($n,) = $mat->getSize();
$data = $mat->getData();
for ($i=0; $i < $n; $i++) {