next up previous contents [pdf] index

Next: Adjoint zeroing (adjnull.c) Up: Introduction Previous: The dot-product test

Implementation of operators

It should be evident by now that the implementation of an operator $ L$ should have at least four arguments: a variable x from which the operand (entity on which $ L$ is applied) $ x$ is read along with its length nx, and the variable y in which the result $ y=Lx$ is stored and its length $ n_y$ .

Also, since every operator comes along with its adjoint, the implementation of the linear operators described later in this chapter, gives also the possibility to compute the adjoint operator. This is done through the boolean adj input argument. When adj is true, the adjoint operator $ L^*$ computed. As discussed before, the domains of $ x$ and $ Lx$ are in general different, therefore $ L^*$ cannot be applied on $ x$ . However it can always be applied on $ Lx$ or some $ y$ , which has the same domain as $ Lx$ . For this reason, when adj is true, the operand is $ y$ and the result is $ x$ and thus, y is used as input and the result is stored in x. As an example if [sec:sf_copy_lop]sf_copy_lop (the identity operator) is called, then the result is that $ y\leftarrow x$ . However if additionally adj is true, then the result will be $ x\leftarrow y$ . If [sec:adjnull]adjnull (the null operator) is called, then the result is that $ y\leftarrow 0$ . However if additionally adj is true, then the result will be $ x\leftarrow 0$ .

Finally, it is often the case that we need to compute $ y\leftarrow Lx$ but $ y\leftarrow y+Lx$ . For this reason another boolean argument, namely add is defined. If add is true, then $ y\leftarrow y+Lx$ . Considering the same example with the identity operator, if sf_copy_lop is called with add being true, then $ y\leftarrow y+x$ . If additionally adj is true, then $ x\leftarrow y+x$ . Or if adjnull is called with add being true, if adj is false, $ y\leftarrow y$ and if adj is true, then $ x\leftarrow x$ (so in essence, if add is true, no matter what the value of adj, nothing happens).

As a conclusion, the linear operators described in this chapter have all the following form:

oper(adj, add, nx, ny, x, y),
where adj and add are boolean, nx and ny are integers and x and y are pointers of various but the same data type. Table 1 summarizes the effect of the adj and add variables.


Table 1: Returned values for linear operations.
adj add description returns
0 0 normal operation $ y\leftarrow Lx$
0 1 normal operation with addition $ y\leftarrow y+Lx$
1 0 adjoint operation $ x\leftarrow L^*y$
1 1 adjoint operation with addition $ x\leftarrow x +L^*y$


next up previous contents [pdf] index

Next: Adjoint zeroing (adjnull.c) Up: Introduction Previous: The dot-product test

2011-07-02