Is there a good PHP library for vectors and matrices? [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this questionI need a PHP library for vectors and matrices. The library I'm looking for should include functions like matrix multiplication, vector cosine similarity, convolution etc.
I also expect such a library to have a proper compact internal representation of sparse vectors and matrices.
I'm using PHP 5.2.
There is
- http://pear.php.net/package/Math_Matrix and
- http://pear.php.net/package/Math_Vector/
and a number of other related PEAR packages about Math
- http://pear.php.net/search.php?q=math&in=packages&x=0&y=0&p=1
I do not know if they suit your needs though. See for yourself.
There used to be a PHP4 port of the JAMA matrix library at http://www.phpmath.com but it seems to have disappeared from the site. We use it in PHPExcel (though I've updated it a bit to PHP5)
There is this library:
https://sourceforge.net/projects/phpmatrixlib/
it contains matrix multiply, inverse, transpose and determinant
精彩评论