Math_Integer, Math_Complex, Math_Vector, Math_Matrix

From: Date: Mon, 14 Mar 2011 19:46:34 +0000
Subject: Math_Integer, Math_Complex, Math_Vector, Math_Matrix
Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-5824@lists.php.net to get a copy of this message
Hi, I would be interested in taking over the packages Math_Complex, Math_Integer, Math_Vector and Math_Matrix. I have been working with these classes for a while, and I would like first and foremost to update all of these packages to PHP5 (which I have already almost completed for personal uses...). I would also like to unify the implementation of operations in these packages; currently, Math_Integer, Math_Complex and Math_Vector use an "operations" class with static functions, while Math_Matrix supports direct operations on Math_Matrix objects. For example, adding a matrix to a matrix in Math_Matrix is done by $matrix->add($matrix2), while adding a vector to a vector in Math_Vector would be done by calling Math_VectorOp::add($vector1, $vector2). I would transfer matrix operations to a static Math_MatrixOp class, to make things consistent with the three other packages. Finally, I would unify the operations interface (e.g. Math_Matrix::substract() vs. Math_VectorOp::sub(), etc.). After this is done, I would like to achieve better integration between these different packages. i.e. add support for complex numbers in Math_Vector and Math_Matrix. I am open to ideas about how to do this; my basic idea would be to provide a common "Math_Number" class providing a common interface for Math_Complex and Math_Integer (and maybe eventually Math_Fraction?), and a "Math_NumberOp" class interfacing Math_ComplexOp and Math_IntegerOp (and Math_FractionOp?). The updated versions of Math_Vector and Math_Matrix would support matrixes and vectors of Math_* objects as well as native PHP numbers. Any thoughts on this? Does it seem like a worthwhile project to pursue? What about backward-compatibility issues? Best regards, Louis Mullie

« previous php.pear.qa (#5824) next »