next up previous print clean
Next: Operators and combination operators Up: Abstract Classes Previous: Abstract Classes

Vectors and super vectors

Vectors are composed of two parts: an array of numbers and a description of the space the reside in. The space they reside in is arbitrary but all vectors must be able to perform some basic mathematical operations. They must be able to be scaled by a number, able to add, multiply, and take the dot product of themselves and another vector in the same space. In addition, they must be able to perform some operations related to the space they reside in. They need to be able clone themselves and they need to be able to check whether or not another vector resides in the same space.

For coding simplicity I expanded this minimal set. Each derived vector class must define the following functions.

clone
Make a copy of both the space the vector resides in and the vector values.
clone_space
Make a copy of just the space the vector resides in.
zero
Fill the vector values with zeros.
random
Fill the vector values with random numbers.
scale
Scale the vector by a number.
add
Add the vector to another vector.
scale_add
Add the vector to another vector multiplied by a scalar.
scale_addscale
Scale the vector and add it to another vector scaled by some scalar.
dot
Return the dot product of the vector with another vector.
load
Given a vector space, read/or create the vector values.
size
A rudimentary method to check vector space similarity.
clean
Remove all remnants of the vector.

In addition to the SEP.vector.vector described above, an additional arbitrary class is necessary. This class, SEP.vector.super, is collection of vectors. Take for example a regularized inversion problem,
   \begin{eqnarray}
\bf d&\approx&\bf L\bf m
\\ \bf 0&\approx&\epsilon \bf A\bf m\nonumber,\end{eqnarray} (1)
where $\bf L$ relates the data $\bf d$ and the $\bf m$,$\bf A$ is a regularization operator, $\bf 0$ is a vector filled with 0s existing in the range space of $\bf A$,and $\epsilon$ is some twiddle parameter. A super vector would be the combination of $\bf d$ and $\bf 0$.


next up previous print clean
Next: Operators and combination operators Up: Abstract Classes Previous: Abstract Classes
Stanford Exploration Project
10/23/2004