NAME

Math::Matrix - multiply and invert matrices

SYNOPSIS

use Math::Matrix;

# Generate a random 3-by-3 matrix.
srand(time);
$A = Math::Matrix -> new([rand, rand, rand],
                         [rand, rand, rand],
                         [rand, rand, rand]);
$A -> print("A\n");

# Append a fourth column to $A.
$x = Math::Matrix -> new([rand, rand, rand]);
$E = $A -> concat($x -> transpose);
$E -> print("Equation system\n");

# Compute the solution.
$s = $E -> solve;
$s -> print("Solutions s\n");

# Verify that the solution equals $x.
$A -> multiply($s) -> print("A*s\n");

DESCRIPTION

This module implements various constructors and methods for creating and manipulating matrices.

All methods return new objects, so, for example, $X->add($Y) does not modify $X.

$X -> add($Y);         # $X not modified; output is lost
$X = $X -> add($Y);    # this works

Some operators are overloaded (see "OVERLOADING") and allow the operand to be modified directly.

$X = $X + $Y;          # this works
$X += $Y;              # so does this

METHODS

Constructors

Other methods

OVERLOADING

The following operators are overloaded.

BUGS

Please report any bugs through the web interface at https://rt.cpan.org/Ticket/Create.html?Queue=Math-Matrix (requires login). We will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Math::Matrix

You can also look for information at:

LICENSE AND COPYRIGHT

Copyright (c) 2020, Peter John Acklam.

Copyright (C) 2013, John M. Gamble jgamble@ripco.com, all rights reserved.

Copyright (C) 2009, oshalla https://rt.cpan.org/Public/Bug/Display.html?id=42919

Copyright (C) 2002, Bill Denney gte273i@prism.gatech.edu, all rights reserved.

Copyright (C) 2001, Brian J. Watson bjbrew@power.net, all rights reserved.

Copyright (C) 2001, Ulrich Pfeifer pfeifer@wait.de, all rights reserved. Copyright (C) 1995, Universität Dortmund, all rights reserved.

Copyright (C) 2001, Matthew Brett matthew.brett@mrc-cbu.cam.ac.uk

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

AUTHORS

Peter John Acklam pjacklam@gmail.com (2020)

Ulrich Pfeifer pfeifer@ls6.informatik.uni-dortmund.de (1995-2013)

Brian J. Watson bjbrew@power.net

Matthew Brett matthew.brett@mrc-cbu.cam.ac.uk