next up previous contents
Next: Linear Codes Up: Matrices and Vectors Previous: Vectors and Vector Operations   Contents

Matrices and Matrix Operations

Matrices can be defined as two-dimensional vectors. Visually, a matrix is a block of data with a given number of rows and columns. Each spot in the matrix can hold a data element. As such, addition and multiplication of matrices is similar to that of vectors. We can add matrices as follows:
$ A + B $ = \begin{displaymath}\left(
\begin{array}{ccc} a_{11}&a_{21}&a_{31} \vdots&\vdo...
...2n}&a_{3n}+b_{3n} \end{array} \right) \epsilon \mathbb{F}_{2}^n\end{displaymath}


We can multiply matrices as follows, make a note that the columns of the first matrix must match the rows of the second:
$ A*B$ = $ \left( \begin{array}{cc} a_{11}&a_{21} a_{12}&a_{22}
\end{array} \right) * ...
...11}*b_{11}+a_{12}*b_{21}\}&\{a_{21}*b_{11}+a_{22}*b_{21}\}
\end{array} \right)$

Scalar multiplication of matrices is the same as with vectors, where each element of the matrix is multiplied by a given scalar,$ \lambda$. Matrix Class The Matrix Class is a super class of Vector. This means that all of the methods in Matrix are also in Vector. The only large difference in these classes is that Matrix only has one constructor, which sets the number of rows and columns in the matrix. Below is a link to the java file for the Matrix class. Matrix.java MatrixOps Class The MatrixOps class is much more complicated than the VectorOps class. MatrixOps contains most of the regular operations that can be preformed on matrices in linear algebra. Of particular importance are the methods that put a given matrix in row echelon or reduced row echelon form. These methods are necessary for implementing the linear codes discussed later. Also the MatrixOps class is a little different then the other operations classes because several of its methods alter the matrix argument that is passed to the method instead of returning a new matrix. Below is a link to the java file for the MatrixOps class. MatrixOps.java
next up previous contents
Next: Linear Codes Up: Matrices and Vectors Previous: Vectors and Vector Operations   Contents
Frederick Leitner 2004-09-01