Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a good PHP library for vectors and matrices? [closed]

Tags:

php

vector

matrix

I 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.

like image 911
snakile Avatar asked Jan 28 '11 12:01

snakile


2 Answers

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.

like image 136
Gordon Avatar answered Oct 19 '22 04:10

Gordon


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)

like image 2
Mark Baker Avatar answered Oct 19 '22 04:10

Mark Baker