home *** CD-ROM | disk | FTP | other *** search
-
- <HTML>
- <HEAD>
- <TITLE>Math::Matrix - Multiply and invert Matrices</TITLE>
- <LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
- <LINK REV="made" HREF="mailto:">
- </HEAD>
-
- <BODY>
- <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
- <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
- <STRONG><P CLASS=block> Math::Matrix - Multiply and invert Matrices</P></STRONG>
- </TD></TR>
- </TABLE>
-
- <A NAME="__index__"></A>
- <!-- INDEX BEGIN -->
-
- <UL>
-
- <LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
-
- <LI><A HREF="#description">DESCRIPTION</A></LI>
- <UL>
-
- <LI><A HREF="#new">new</A></LI>
- <LI><A HREF="#concat">concat</A></LI>
- <LI><A HREF="#transpose">transpose</A></LI>
- <LI><A HREF="#multiply">multiply</A></LI>
- <LI><A HREF="#solve">solve</A></LI>
- <LI><A HREF="#print">print</A></LI>
- </UL>
-
- <LI><A HREF="#example">EXAMPLE</A></LI>
- <LI><A HREF="#author">AUTHOR</A></LI>
- </UL>
- <!-- INDEX END -->
-
- <HR>
- <P>
- <H1><A NAME="name">NAME</A></H1>
- <P>Math::Matrix - Multiply and invert Matrices</P>
- <P>
- <HR>
- <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
- <UL>
- <LI>Linux</LI>
- <LI>Solaris</LI>
- <LI>Windows</LI>
- </UL>
- <HR>
- <H1><A NAME="description">DESCRIPTION</A></H1>
- <P>The following methods are available:</P>
- <P>
- <H2><A NAME="new">new</A></H2>
- <P>Constructor arguments are a list of references to arrays of the same
- length. The arrays are copied. The method returns <STRONG>undef</STRONG> in case of
- error.</P>
- <PRE>
- $a = new Math::Matrix ([rand,rand,rand],
- [rand,rand,rand],
- [rand,rand,rand]);</PRE>
- <P>
- <H2><A NAME="concat">concat</A></H2>
- <P>Concatenates two matrices of same row count. The result is a new
- matrix or <STRONG>undef</STRONG> in case of error.</P>
- <PRE>
- $b = new Math::Matrix ([rand],[rand],[rand]);
- $c = $a->concat($b);</PRE>
- <P>
- <H2><A NAME="transpose">transpose</A></H2>
- <P>Returns the transposed matrix. This is the matrix where colums and
- rows of the argument matrix are swaped.</P>
- <P>
- <H2><A NAME="multiply">multiply</A></H2>
- <P>Multiplies two matrices where the length of the rows in the first
- matrix is the same as the length of the columns in the second
- matrix. Returns the product or <STRONG>undef</STRONG> in case of error.</P>
- <P>
- <H2><A NAME="solve">solve</A></H2>
- <P>Solves a equation system given by the matrix. The number of colums
- must be greater than the number of rows. If variables are dependent
- from each other, the second and all further of the dependent
- coefficients are 0. This means the method can handle such systems. The
- method returns a matrix containing the solutions in its columns or
- <STRONG>undef</STRONG> in case of error.</P>
- <P>
- <H2><A NAME="print">print</A></H2>
- <P>Prints the matrix on STDOUT. If the method has additional parameters,
- these are printed before the matrix is printed.</P>
- <P>
- <HR>
- <H1><A NAME="example">EXAMPLE</A></H1>
- <PRE>
- use Math::Matrix;</PRE>
- <PRE>
- srand(time);
- $a = new Math::Matrix ([rand,rand,rand],
- [rand,rand,rand],
- [rand,rand,rand]);
- $x = new Math::Matrix ([rand,rand,rand]);
- $a->print("A\n");
- $E = $a->concat($x->transpose);
- $E->print("Equation system\n");
- $s = $E->solve;
- $s->print("Solutions s\n");
- $a->multiply($s)->print("A*s\n");</PRE>
- <P>
- <HR>
- <H1><A NAME="author">AUTHOR</A></H1>
- <P>Ulrich Pfeifer <<A HREF="mailto:pfeifer@ls6.informatik.uni-dortmund.de">pfeifer@ls6.informatik.uni-dortmund.de</A>></P>
- <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
- <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
- <STRONG><P CLASS=block> Math::Matrix - Multiply and invert Matrices</P></STRONG>
- </TD></TR>
- </TABLE>
-
- </BODY>
-
- </HTML>
-