next up previous contents
Next: Matrices and Matrix Operations Up: Matrices and Vectors Previous: Matrices and Vectors   Contents

Vectors and Vector Operations

We can define a vector as a set of $ n$ elements in the same finite field. In the LinearCodes package this means that all vector data types will hold elements declared as FieldElems. We can add vectors as follows:
$ \vec a +\vec b $ = \begin{displaymath}\left(
\begin{array}{c} a_1 \vdots a_n \end{array} \righ...
...
\vdots a_n+b_n \end{array} \right) \epsilon \mathbb{F}_{2}^n\end{displaymath}


We can scalar multiply by $ \lambda\epsilon\mathbb{F}_{2}$ as:
\begin{displaymath}\lambda \vec a = \lambda \left(
\begin{array}{c}
a_1 \vdo...
...ts \lambda a_n \end{array} \right) \epsilon
\mathbb{F}_{2}^n\end{displaymath}
For further information concerning vector spaces over finite fields, consult my Spring 2004 report of same title. Vector Class Because a vector can be treated as a special kind of matrix, the vector class extends the matrix class. In the next section, the similarities between vectors and matrices will be more apparent. I wrote the vector class with an outline similar to the one I used for FieldElem and FPElem. The Vector class has two constructors. The first more fundamental constructor takes an integer argument, which sets the number of elements that given vector can hold. The second constructor makes it possible to cast a matrix as a vector by assuming that the argument matrix has only one column. The other methods in this class make it possible to change one specific element in the vector, find the number of elements in the vector, return the value of and element at a specific location, fill the vector with elements of zero value, and copy the vector. It is important to fill the vector with zero valued elements so that the vector does not contain $ null$ valued elements, which can cause later complications. Below is a link to the java file for the Vector class. Vector.java VectorOps Class Like with the FieldElem class, it is important to have a static class that provides operations for the vector data type. My VectorOps class provides a few basic methods to add, multiply, and compare vectors. Like with FieldOps, the methods in VectorOps do not change their arguments. Below is a link to the java file for the VectorOps class. VectorOps.java


next up previous contents
Next: Matrices and Matrix Operations Up: Matrices and Vectors Previous: Matrices and Vectors   Contents
Frederick Leitner 2004-09-01