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. Presumably the procedural version may be slightly faster than the infix *-operator
matrix operator*(ConstMatrixView Mleft, ConstMatrixView Mright); void mul(matrix& lhs, ConstMatrixView M1, ConstMatrixView M2);
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 requires that the matrix be of full rank.
RingElem det(const ConstMatrixView& M); std::size_t rank(const ConstMatrixView& M); matrix inverse(ConstMatrixView M); matrix adjoint(ConstMatrixView M); matrix PseudoInverse(ConstMatrixView M);
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);
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).