next up previous contents index
Next: Univariate polynomials and series Up: User's Guide Previous: Input/Output   Contents   Index

Linear algebra

The basic types to use for doing linear algebra are Vector and DenseMatrix. The basic linear algebra computations are provided by the type LinearAlgebra. Although $\Sigma{}^{{\rm it}}$ provides many specialized types for performing various sorts of triangulations and solving linear systems, LinearAlgebra knows about all of them and contains procedures that decide which algorithm is best suited for your particular input. So do not call directly the more specialized packages unless you have a particular reason to use a specific algorithm rather than let $\Sigma{}^{{\rm it}}$ decide for you.

The type of the entries of vectors and matrices does not need to be a Ring, it can be an AdditiveType or ArithmeticType respectively. This allows types that do not have a full equality such as SingleFloat or DenseUnivariateTaylorSeries to be entries of vectors and matrices. However, LinearAlgebra requires the entries to be from a CommutativeRing so its functionalities are not available for matrices of series or floating point numbers.

$\Sigma{}^{{\rm it}}$ contains many fraction-free algorithms that allow you to perform over an IntegralDomain computations, such as matrix inverses or solving systems, that are usually done over a Field. Those algorithms are significantly faster over domains than over their fraction fields, so consider using domains such as ${\mathbbm Z}$ or $R[x]$ as matrix entries rather than fractions. See for example the description of the inverse function to see the effect of working over domains rather than fields on the signatures of the functions.

To write generic linear algebra code that does not depend on the implementation of matrices, use a type parameter of category MatrixCategory. For example, a normal form package could look like:

NormalForms(R:IntegralDomain, M:MatrixCategory R): with {
        frobenius: M -> M;     -- Returns the Frobenius form of its argument
        ...
} == add { ... }


next up previous contents index
Next: Univariate polynomials and series Up: User's Guide Previous: Input/Output   Contents   Index
Manuel Bronstein 2000-12-13