1Math::Symbolic::MiscAlgUesberra(C3o)ntributed Perl DocumMeanttha:t:iSoynmbolic::MiscAlgebra(3)
2
3
4

NAME

6       Math::Symbolic::MiscAlgebra - Miscellaneous algebra routines like det()
7

SYNOPSIS

9         use Math::Symbolic qw/:all/;
10         use Math::Symbolic::MiscAlgebra qw/:all/; # not loaded by Math::Symbolic
11
12         @matrix = (['x*y', 'z*x', 'y*z'],['x', 'z', 'z'],['x', 'x', 'y']);
13         $det = det @matrix;
14
15         @vector = ('x', 'y', 'z');
16         $solution = solve_linear(\@matrix, \@vector);
17

DESCRIPTION

19       This module provides several subroutines related to algebra such as
20       computing the determinant of quadratic matrices, solving linear equa‐
21       tion systems and computation of Bell Polynomials.
22
23       Please note that the code herein may or may not be refactored into the
24       OO-interface of the Math::Symbolic module in the future.
25
26       EXPORT
27
28       None by default.
29
30       You may choose to have any of the following routines exported to the
31       calling namespace. ':all' tag exports all of the following:
32
33         det
34         linear_solve
35         bell_polynomial
36

SUBROUTINES

38       det
39
40       det() computes the determinant of a matrix of Math::Symbolic trees (or
41       strings that can be parsed as such). First argument must be a literal
42       array: "det @matrix", where @matrix is an n x n matrix.
43
44       Please note that calculating determinants of matrices using the
45       straightforward Laplace algorithm is a slow (O(n!))  operation. This
46       implementation cannot make use of the various optimizations resulting
47       from the determinant properties since we are dealing with symbolic
48       matrix elements. If you have a matrix of reals, it is strongly sug‐
49       gested that you use Math::MatrixReal or Math::Pari to get the determi‐
50       nant which can be calculated using LR decomposition much faster.
51
52       On a related note: Calculating the determinant of a 20x20 matrix would
53       take over 77146 years if your Perl could do 1 million calculations per
54       second.  Given that we're talking about several method calls per calcu‐
55       lation, that's much more than todays computers could do. On the other
56       hand, if you'd be using this straightforward algorithm with numbers
57       only and in C, you might be done in 26 years alright, so please go for
58       the smarter route (better algorithm) instead if you have numbers only.
59
60       linear_solve
61
62       Calculates the solutions x (vector) of a linear equation system of the
63       form "Ax = b" with "A" being a matrix, "b" a vector and the solution
64       "x" a vector. Due to implementation limitations, "A" must be a quadrat‐
65       ic matrix and "b" must have a dimension that is equivalent to that of
66       "A". Furthermore, the determinant of "A" must be non-zero. The algo‐
67       rithm used is devised from Cramer's Rule and thus inefficient. The pre‐
68       ferred algorithm for this task is Gaussian Elimination. If you have a
69       matrix and a vector of real numbers, please consider using either
70       Math::MatrixReal or Math::Pari instead.
71
72       First argument must be a reference to a matrix (array of arrays) of
73       symbolic terms, second argument must be a reference to a vector (array)
74       of symbolic terms. Strings will be automatically converted to
75       Math::Symbolic trees.  Returns a reference to the solution vector.
76
77       bell_polynomial
78
79       This functions returns the nth Bell Polynomial. It uses memoization for
80       speed increase.
81
82       First argument is the n. Second (optional) argument is the variable or
83       variable name to use in the polynomial. Defaults to 'x'.
84
85       The Bell Polynomial is defined as follows:
86
87         phi_0  (x) = 1
88         phi_n+1(x) = x * ( phi_n(x) + partial_derivative( phi_n(x), x ) )
89
90       Bell Polynomials are Exponential Polynimals with phi_n(1) = the nth
91       bell number. Please refer to the bell_number() function in the
92       Math::Symbolic::AuxFunctions module for a method of generating these
93       numbers.
94

AUTHOR

96       Please send feedback, bug reports, and support requests to the
97       Math::Symbolic support mailing list: math-symbolic-support at lists dot
98       sourceforge dot net. Please consider letting us know how you use
99       Math::Symbolic. Thank you.
100
101       If you're interested in helping with the development or extending the
102       module's functionality, please contact the developers' mailing list:
103       math-symbolic-develop at lists dot sourceforge dot net.
104
105       List of contributors:
106
107         Steffen Müller, symbolic-module at steffen-mueller dot net
108         Stray Toaster, mwk at users dot sourceforge dot net
109         Oliver Ebenhöh
110

SEE ALSO

112       New versions of this module can be found on http://steffen-mueller.net
113       or CPAN. The module development takes place on Sourceforge at
114       http://sourceforge.net/projects/math-symbolic/
115
116       Math::Symbolic
117
118
119
120perl v5.8.8                       2008-02-22    Math::Symbolic::MiscAlgebra(3)
Impressum