Value::Matrix class

References:

MathObject Matrix methods: http://webwork.maa.org/wiki/Matrix_(MathObject_Class) MathObject Contexts: http://webwork.maa.org/wiki/Common_Contexts CPAN RealMatrix docs: http://search.cpan.org/~leto/Math-MatrixReal-2.09/lib/Math/MatrixReal.pm

Allowing Matrices in Fractions: http://webwork.maa.org/moodle/mod/forum/discuss.php?d=2978

Context()->parens->set("[" => {formMatrix => 1});

Files interacting with Matrices:

MatrixReal1

MatrixReduce.pl

Matrix

MatrixCheckers.pl -- checking whether vectors form a basis

MatrixReduce.pl -- tools for row reduction via elementary matrices

MatrixUnits.pl -- Generates unimodular matrices with real entries

PGmatrixmacros.pl

PGmorematrixmacros.pl

PGnumericalmacros.pl

tableau.pl

quickMatrixEntry.pl

LinearProgramming.pl

Contexts

Matrix -- allows students to enter [[3,4],[3,6]]
       -- formMatrix =>1 also allows this?
Complex-Matrix -- allows complex entries

Creation methods

$M1 = Matrix([1,2],[3,4]);
$M2 = Matrix([5,6],[7,8]);
$v = Vector(9,10);
$w = ColumnVector(9,10); # differs in how it is printed

Commands added in Value::matrix

Conversion
        $matrix->values produces [[3,4,5],[1,3,4]] recursive array references of numbers (not MathObjects)
        $matrix->wwMatrix   produces CPAN MatrixReal1 matrix, used for computation subroutines

Information
        $matrix->dimension:  ARRAY

Access values

        row : MathObjectMatrix
        column : MathObjectMatrix
        element : Real or Complex value

Assign values

        these need to be added:

see change_matrix_entry() in MatrixReduce and http://webwork.maa.org/moodle/mod/forum/discuss.php?d=2970

Advanced
        $matrix->data:  ARRAY reference (internal data) of MathObjects (Real,Complex, Fractions)
                        stored at each location.

Passthrough methods covering subroutines in Matrix.pm which overrides or augment CPAN's MatrixReal1.pm. Matrix is a specialized subclass of MatrixReal1.pm

The actual calculations for these methods are done in pg/lib/Matrix.pm

trace
proj
proj_coeff
L
R
PL
PR

Passthrough methods covering subroutines in pg/lib/MatrixReal1.pm (this has been modified to handle complex numbers) The actual calculations are done in MatrixReal1.pm subroutines The commands below are Value::Matrix methods unless otherwise noted.

condition
det
inverse
is_symmetric
decompose_LR
dim
norm_one
norm_max
kleene
normalize
solve_LR($v)    - LR decomposition
solve($M,$v)    - function version of solve_LR
order_LR        - order of LR decomposition matrix (number of non-zero equations)(also order() )
order($M)       - function version of order_LR
solve_GSM
solve_SSM
solve_RM