Math::Symbolic::Custom::Matrix
==============================

Matrix routines for Math::Symbolic.

Provides some routines for manipulating matrices of Math::Symbolic expressions. A matrix here is just a 2D array of 
elements. Passing in matrices with elements which are not already Math::Symbolic objects will cause them to be 
converted to Math::Symbolic objects.

EXAMPLE

    use strict;
    use Math::Symbolic qw/:all/;
    use Math::Symbolic::MiscAlgebra qw/:all/;
    use Math::Symbolic::Custom::Collect 0.21;
    use Math::Symbolic::Custom::Matrix;
    use Math::Symbolic::Custom::Polynomial;

    # Say we want the eigenvalues of some matrix with a parameter.
    # 1. A = | 4, 3-k |
    #        | 2, 3   |
    my @matrix = ([4,'3-k'],[2,3]);
    my $A = make_symbolic_matrix(\@matrix);

    # 2. get an identity matrix
    my $I = identity_matrix(2);

    # 3. multiply it with lambda
    my $lambda_I = scalar_multiply_matrix( "lambda", $I );

    # 4. subtract it from matrix A
    my $B = sub_matrix($A, $lambda_I);

    # 5. form the characteristic polynomial, |A-lambda*I|
    my $c_poly = det(@{$B})->to_collected();
    print "Characteristic polynomial is: $c_poly\n";

    # 6. analyze the polynomial to get roots
    my ($var, $coeffs, $disc, $roots) = $c_poly->test_polynomial('lambda');
    print "Expressions for the roots are:\n\t$roots->[0]\n\t$roots->[1]\n";

    # 7. Check for some values of parameter k
    foreach my $k (0..3) {
        print "For k = $k:- lambda_1 = ", 
            $roots->[0]->value('k' => $k), "; lambda_2 = ", 
            $roots->[1]->value('k' => $k), "\n";
    }


INSTALLATION

To install this module, run the following commands:

	perl Makefile.PL
	make
	make test
	make install

SUPPORT AND DOCUMENTATION

After installing, you can find documentation for this module with the
perldoc command.

    perldoc Math::Symbolic::Custom::Matrix

You can also look for information at:

    RT, CPAN's request tracker (report bugs here)
        https://rt.cpan.org/NoAuth/Bugs.html?Dist=Math-Symbolic-Custom-Matrix

    CPAN Ratings
        https://cpanratings.perl.org/d/Math-Symbolic-Custom-Matrix

    Search CPAN
        https://metacpan.org/release/Math-Symbolic-Custom-Matrix


LICENSE AND COPYRIGHT

This software is copyright (c) 2024 by Matt Johnson.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

