# OpenMath Content Dictionary: matrix1

Canonical URL:
http://www.win.tue.nl/SCIEnce/cds/matrix1.ocd
CD File:
matrix1.ocd
CD as XML Encoded OpenMath:
matrix1.omcd
Defines:
banded, block, column_dimension, dense, diagonal, entry_domain, lower_band, matrix, matrix_domain, row_dimension, sparse, sparse_entry, upper_band
Date:
2009-06-22
Version:
0 (Revision 4)
Review Date:
Status:
experimental
Uses CD:
alg1, ringname1, linalg2, linalg3

This CD holds a collection of matrix constructors over arbitrary rings.

## entry_domain

Description:
This symbol is a unary function, whose argument should be a ring r. When applied to r, it represents the matrix-algebra ground domain (MAD).
Example:

$\mathrm{entry_domain}\left(Z\right)$
Signatures:
sts

 [Next: matrix_domain] [Last: lower_band] [Top]

## matrix_domain

Description:
This symbol is a ternary function, whose first argument should be a matrix1.entry_domain application. The second and third arguments must be matrix1.row_dimension and matrix1.column_dimension. When applied to these arguments this creates' the domain of linear mappings between modules of specified dimensions over a common ground domain, conveniently represented by matrices.
Example:

$\mathrm{matrix_domain}\left(\mathrm{entry_domain}\left(Z\right),\mathrm{row_dimension}\left(12\right),\mathrm{column_dimension}\left(10\right)\right)$
Signatures:
sts

 [Next: row_dimension] [Previous: entry_domain] [Top]

## row_dimension

Description:
This symbol is a unary function whose first argument must be either a non-negative OpenMath integer or nums1.infinity. When applied this creates an object that denotes the dimension of the codomain of the linear mapping represented by the matrix.
Signatures:
sts

 [Next: column_dimension] [Previous: matrix_domain] [Top]

## column_dimension

Description:
This symbol is a unary function whose first argument must be either a non-negative OpenMath integer or nums1.infinity. When applied this creates an object that denotes the dimension of the domain of the linear mapping represented by the matrix.
Signatures:
sts

 [Next: matrix] [Previous: row_dimension] [Top]

## matrix

Description:
This symbol is a binary function whose first argument must be a matrix algebra constructor and the second argument can be any of the below matrix entry constructors. Additionally it is possible to use the matrix constructors of the linalg2 or linalg3 CDs.
Example:

$Todo$
Signatures:
sts

 [Next: dense] [Previous: column_dimension] [Top]

## dense

Description:
This symbol is an $(m \cdot n)$-ary function whose arguments specify the entries of the matrix, where $m$ is the dimension of the codomain and $n$ is the dimension of the domain. The matrix (or block) must be filled row-wise, that is the first argument denotes the entry in row 1, column 1 of the matrix (or block), the second argument denotes the entry at row 1, column 2, and so forth. The number of arguments MUST match the dimensions of either the matrix algebra or the surrounding block (see below).
Example:

$\mathrm{matrix}\left(\mathrm{matrix_domain}\left(\mathrm{entry_domain}\left(Z\right),\mathrm{row_dimension}\left(3\right),\mathrm{column_dimension}\left(3\right)\right),\mathrm{dense}\left(1,2,3,4,5,6,7,8,9\right)\right)$
Signatures:
sts

 [Next: sparse] [Previous: matrix] [Top]

## sparse

Description:
The constructor for sparse matrices without any indication of dimension or domain for the coefficients. Its arguments are just matrix1.sparse_entrys. Attention: No two matrix1.sparse_entrys must specify the same location.
Signatures:
sts

 [Next: sparse_entry] [Previous: dense] [Top]

## sparse_entry

Description:
This symbol denotes a ternary function whose first two arguments specify the location of an entry inside the matrix, and whose final argument is the entry itself. The entry MUST be either from the specified ground domain directly, or be a diagonal constructor as described below, a block constructor as described below, or a banded constructor as described below. In the block case, the dimensions of the block MUST NOT exceed the total dimensions of the matrix algebra. In the diagonal case, the dimension of the diagonal MUST NOT exceed the total dimensions of the matrix algebra.
Example:

$\mathrm{matrix}\left(\mathrm{matrix_domain}\left(\mathrm{entry_domain}\left(Q\right),\mathrm{row_dimension}\left(3\right),\mathrm{column_dimension}\left(3\right)\right),\mathrm{sparse}\left(\mathrm{sparse_entry}\left(1,2,12\right),\mathrm{sparse_entry}\left(2,1,21\right),\mathrm{sparse_entry}\left(3,3,33\right)\right)\right)$
Signatures:
sts

 [Next: diagonal] [Previous: sparse] [Top]

## diagonal

Description:
This symbol is an $m$-ary function whose arguments specify the entries of a (generalised) matrix diagonal. The diagonal must be filled from top-left to bottom-right. That is: the first argument represents the entry in row 1, column 1 of the matrix, the second argument denotes the entry at row 2, column 2, and so forth. If used inside a sparse_entry object at location $(i, j)$, the first entry is offset accordingly. If not used inside a sparse_entry object, the number of arguments MUST match the dimensions of either the matrix algebra (the smaller of $m$ and $n$). If used inside a sparse_entry object, the number of entries MUST NOT exceed the total matrix dimensions.
Example:

$\mathrm{matrix}\left(\mathrm{matrix_domain}\left(\mathrm{entry_domain}\left(C\right),\mathrm{row_dimension}\left(3\right),\mathrm{column_dimension}\left(3\right)\right),\mathrm{diagonal}\left(1+i,2+2i,3+3i\right)\right)$
Signatures:
sts

 [Next: block] [Previous: sparse_entry] [Top]

## block

Description:
This symbol is like the matrix constructor as described above, but intended for use inside matrix to form `submatrices''. The symbol takes at least two arguments: a column_dimension and a row_dimension object which denote the total extent of the block.
Example:

$\mathrm{matrix}\left(\mathrm{matrix_domain}\left(\mathrm{entry_domain}\left(Q\right),\mathrm{row_dimension}\left(30\right),\mathrm{column_dimension}\left(30\right)\right),\mathrm{sparse}\left(\mathrm{sparse_entry}\left(10,20,\mathrm{block}\left(\mathrm{row_dimension}\left(2\right),\mathrm{column_dimension}\left(2\right),\mathrm{dense}\left(11,12,21,22\right)\right)\right)\right)\right)$
Example:

$\mathrm{matrix}\left(\mathrm{matrix_domain}\left(\mathrm{entry_domain}\left(Z\right),\mathrm{row_dimension}\left(1000000\right),\mathrm{column_dimension}\left(1000000\right)\right),\mathrm{sparse}\left(\mathrm{sparse_entry}\left(24800,26133,\mathrm{block}\left(\mathrm{row_dimension}\left(99999\right),\mathrm{column_dimension}\left(99999\right),\mathrm{sparse}\left(\mathrm{sparse_entry}\left(4,15,0\right)\right)\right)\right)\right)\right)$
Signatures:
sts

 [Next: banded] [Previous: diagonal] [Top]

## banded

Description:
This symbol is a constructor for banded matrices. It takes at least 2 arguments, the first of which being the number of upper bands and the second being the number of lower bands. Amongst the further arguments you can specify AT MOST one matrix1.diagonal object. You MUST exactly as many matrix1.upper_band objects as you specified upper bands, and you MUST specify as many matrix1.lower_band objects as you specified lower bands. This symbol facilitates the use of blas based systems which expect to know the bands structure upfront.
Example:

$\mathrm{matrix}\left(\mathrm{matrix_domain}\left(\mathrm{entry_domain}\left(\mathrm{Zm}\left(7\right)\right),\mathrm{row_dimension}\left(3\right),\mathrm{column_dimension}\left(3\right)\right),\mathrm{banded}\left(1,1,\mathrm{diagonal}\left(111,222,333\right),\mathrm{upper_band}\left(1,\mathrm{diagonal}\left(4,5\right)\right),\mathrm{lower_band}\left(1,\mathrm{diagonal}\left(1,2\right)\right)\right)\right)$
Signatures:
sts

 [Next: upper_band] [Previous: block] [Top]

## upper_band

Description:
This symbol is a binary function whose first argument is a non-negative OpenMath integer which denotes the index of the upper band which is specified in the second argument. Hereby the first upper band is the one immediately above the main (generalised) diagonal, its starting coordinates relative to the top-left of the matrix thus are (1, 2).
Signatures:
sts

 [Next: lower_band] [Previous: banded] [Top]

## lower_band

Description:
This symbol is a binary function whose first argument is a non-negative OpenMath integer which denotes the index of the lower band which is specified in the second argument. Hereby the first lower band is the one immediately below the main (generalised) diagonal, its starting coordinates relative to the top-left of the matrix thus are (2, 1).
Signatures:
sts

 [First: entry_domain] [Previous: upper_band] [Top]