# [LON-CAPA-users] looking for linear algebra library

Guy Albertelli II lon-capa-users@mail.lon-capa.org
Tue, 20 Nov 2007 12:09:22 -0500

```Hi Jay,

> Thanks for the pointer. I think I will like using the maxima
> interface. However, I'm stuck trying to figure out how to pass a
> matrix from maxima into a perl variable.

Of course if you used the perl interface you wouldn't need to parse
the output:

<problem>
<script type="loncapa/perl">
\$B = &mat([[10,0,0],[0,3,0],[0,0,1]])->inv()->coef();
\$tmp = \$B->[0][0];
</script>
\$tmp
</problem>

:-)

>
> Based on the example below, from the output, it looks like maxima
> received the correct matrix input and evaluated the inverse matrix
> correctly. How could I assign the output of the &cas routine to a
> multidimensional perl array? Any tips? Thanks.
>
> code:
> <problem>
> <script type="loncapa/perl">
> \$s= 'maxima';
> @B = ();
> \$str = &cas(\$s,'invert(matrix([10,0,0],[0,3,0],[0,0,1]))');
> \$str=~s/matrix//;
> @B = \$str;
> \$tmp = \$B[0][0];
> </script>
> \$str<br/>
> \$tmp
> </problem>
>
> output:
> ([1/10,0,0],[0,1/3,0],[0,0,1])
> \$tmp
>
> JS
>
> On Nov 18, 2007 4:53 PM, Peter Riegler <p.riegler@fh-wolfenbuettel.de> wrote:
> > Hi,
> >
> > loncapa provides access to maxima, a free computer algebra system.
> > Maxima comes with all the functionalities you need here.
> > You might want to have a look at the ressources at
> > or
> >
> > Most of them are in German, but the source code should be available.
> >
> > Peter
> >
> >
> > Jay Sullivan wrote:
> >
> > > Does anyone have a linear algebra perl library they would mind sharing?
> > >
> > > I'm looking for basic matrix functionality: matrix add, subtract,
> > > multiply, determinant, inverse
> > >
> > > Thanks,
> > > Jay
> > > _______________________________________________
> > > LON-CAPA-users mailing list
> > > LON-CAPA-users@mail.lon-capa.org
> > > http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
> >
> > --
> > Peter Riegler
> > Fachhochschule Braunschweig/Wolfenb?ttel
> > Salzdahlumer Str. 46/48, 38302 Wolfenb?ttel
> > Tel. +49 5331 939 6314, Fax. +49 5331 939 6002
> > email: p.riegler@fh-wolfenbuettel.de
> > http://public.rz.fh-wolfenbuettel.de/~riegler
> > _______________________________________________
> > LON-CAPA-users mailing list
> > LON-CAPA-users@mail.lon-capa.org
> > http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
> >
>
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users

--
guy@albertelli.com   0-7-0-6-27,137

```