MatrixArith

© 2009 John Abbott
GNU Free Documentation License, Version 1.2



CoCoALib Documentation Index

User documentation for MatrixArith

MatrixArith gathers together a number of operations on matrices; in most cases these operations are happy to accept a MatrixView (see MatrixViews) as argument.

There are two ways of multiplying two matrices together. The infix operators return a DenseMatrix; the procedural version may be slightly faster than the infix operator.

    void mul(matrix& lhs, ConstMatrixView M1, ConstMatrixView M2);
    matrix operator*(ConstMatrixView Mleft, ConstMatrixView Mright);
    matrix operator+(ConstMatrixView Mleft, ConstMatrixView Mright);
    matrix operator-(ConstMatrixView Mleft, ConstMatrixView Mright);

Here are some matrix norms. These require that the matrix be over an ordered ring. Note that FrobeniusNorm2 gives the square of the Frobenius norm (so that the value surely lies in the same ring).

    RingElem FrobeniusNorm2(ConstMatrixView A);
    RingElem OperatorNormInfinity(ConstMatrixView M);
    RingElem OperatorNorm1(ConstMatrixView M);

Here are some fairly standard functions on matrices. I suspect that the pseudo inverse

Here are some standard operations where the method used is specified explicitly. It would usually be better to use the generic operations above, as these should automatically select the most appropriate method for the given matrix.

    void DetByGauss(RefRingElem d, ConstMatrixView M);
    std::size_t RankByGauss(std::vector<std::size_t>& IndepRows, ConstMatrixView M);
    matrix InverseByGauss(ConstMatrixView M);
    matrix AdjointByDetOfMinors(ConstMatrixView M);
    matrix AdjointByInverse(ConstMatrixView M); // base ring must be integral domain

    void GrammSchmidtRows(MatrixView& M);
    void GrammSchmidtRows(MatrixView& M, std::size_t row);

Maintainer documentation for MatrixViews

Bugs, Shortcomings and other ideas

I just cobbled together these few lines of documentation hastily, since I noticed that the file was completely missing. Clearly further work is needed (but it's late, and I have other things to do).