From ab8cc85adde879fb963c94d15675783f2cf4b183 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 14 Aug 2007 05:14:52 +0000 Subject: Initial population. --- src/hyper/pages/SQMATRIX.ht | 67 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/hyper/pages/SQMATRIX.ht (limited to 'src/hyper/pages/SQMATRIX.ht') diff --git a/src/hyper/pages/SQMATRIX.ht b/src/hyper/pages/SQMATRIX.ht new file mode 100644 index 00000000..b5db8bcf --- /dev/null +++ b/src/hyper/pages/SQMATRIX.ht @@ -0,0 +1,67 @@ +% Copyright The Numerical Algorithms Group Limited 1992-94. All rights reserved. +% !! DO NOT MODIFY THIS FILE BY HAND !! Created by ht.awk. +\newcommand{\SquareMatrixXmpTitle}{SquareMatrix} +\newcommand{\SquareMatrixXmpNumber}{9.74} +% +% ===================================================================== +\begin{page}{SquareMatrixXmpPage}{9.74 SquareMatrix} +% ===================================================================== +\beginscroll + +The top level matrix type in \Language{} is \spadtype{Matrix} +(see \downlink{`Matrix'}{MatrixXmpPage}\ignore{Matrix}), which +provides basic arithmetic and linear algebra functions. +However, since the matrices can be of any size it is not true that any pair +can be added or multiplied. +Thus \spadtype{Matrix} has little algebraic structure. + +Sometimes you want to use matrices as coefficients for polynomials +or in other algebraic contexts. In this case, \spadtype{SquareMatrix} +%-% \HDindex{matrix!square}{SquareMatrixXmpPage}{9.74}{SquareMatrix} +should be used. The domain \spadtype{SquareMatrix(n,R)} gives the ring of +\spad{n} by \spad{n} square matrices over \spad{R}. + +\xtc{ +Since \spadtype{SquareMatrix} is not normally exposed at the top level, +you must expose it before it can be used. +}{ +\spadpaste{)set expose add constructor SquareMatrix \bound{SQ}} +} +\xtc{ +Once \spad{SQMATRIX} has been exposed, +values can be created using the \spadfunFrom{squareMatrix}{SquareMatrix} +function. +}{ +\spadpaste{m := squareMatrix [[1,-\%i],[\%i,4]] \bound{m}\free{SQ}} +} +\xtc{ +The usual arithmetic operations are available. +}{ +\spadpaste{m*m - m \free{m}} +} +\xtc{ +Square matrices can be used where ring elements are required. +For example, here is a matrix with matrix entries. +}{ +\spadpaste{mm := squareMatrix [[m, 1], [1-m, m**2]] \free{m}\bound{mm}} +} +\xtc{ +Or you can construct a polynomial with square matrix coefficients. +}{ +\spadpaste{p := (x + m)**2 \free{m}\bound{p}} +} +\xtc{ +This value can be converted to a square matrix with polynomial coefficients. +}{ +\spadpaste{p::SquareMatrix(2, ?) \free{p}} +} + +For more information on related topics, see +\downlink{``\ugTypesWritingModesTitle''}{ugTypesWritingModesPage} in Section \ugTypesWritingModesNumber\ignore{ugTypesWritingModes}, +\downlink{``\ugTypesExposeTitle''}{ugTypesExposePage} in Section \ugTypesExposeNumber\ignore{ugTypesExpose}, and +\downlink{`Matrix'}{MatrixXmpPage}\ignore{Matrix}. +\showBlurb{SquareMatrix} +\endscroll +\autobuttons +\end{page} +% -- cgit v1.2.3