Re: New extension proposal: PHP LAPACK (linear algebra)

From: Date: Tue, 07 Feb 2012 11:01:06 +0000
Subject: Re: New extension proposal: PHP LAPACK (linear algebra)
References: 1  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-9106@lists.php.net to get a copy of this message
hi! Huge +1 here, this library (along with mathomatic library) has been on my list of binding to write for a long time! The license looks good as well. I would say if nobody has objection, go ahead and request an account (if you don't have one already on pecl.php.net or svn). Cheers, On Mon, Feb 6, 2012 at 9:05 PM, Ian Barber <ian.barber@gmail.com> wrote: > Hi all, > > I've wrapped a few functions from the LAPACK* linear algebra library (new > BSD licensed) in a simple PHP extension. Code is on github - > https://github.com/ianbarber/php-lapack > > Would love to hear any feedback/suggestions on the code (and also the API > if anyone has experience with the library). Currently is designed as a > series of static functions, as the underlying library is a series of > optimised routines, so it looks like: > > <?php > > $a = array( >    array( 7.52,  -1.10,  -7.95,  1.08  ), >    array(-0.76,   0.62,   9.34, -7.10  ), >    array( 5.13,   6.62,  -5.66,  0.87  ), >    array(-4.75,   8.52,   5.75,  5.30  ), >    array( 1.33,   4.91,  -5.49, -3.52  ), >    array(-2.40,  -6.77,   2.34,  3.95  ), > ); > > > $result = Lapack::singularValues($a); > > foreach($result as $k => $r) { >    foreach($r as $ik => $ir) { >        $result[$k][$ik] = round($ir, 2); >    } > } > var_dump($result); > > ?> > > --EXPECT-- > array(1) { >  [0]=> >  array(4) { >    [0]=> >    float(18.37) >    [1]=> >    float(13.63) >    [2]=> >    float(10.85) >    [3]=> >    float(4.49) >  } > } > > The aim is to work through the most useful functions (generally ones which > solve complete classes of problems), and potentially expose some of the > lower level functions if there is demand. I'm not shooting for a super > optimised version for large data sets, just something workable for day to > day LA requirements. > > Thanks! > > Ian > > *http://www.netlib.org/lapack/ -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org

« previous php.pecl.dev (#9106) next »