next up previous contents
Next: Matrix class functions Up: usermanual Previous: Format of the products   Contents


Matrix class

The template matrix class (called matrixbk) that is provided with the Doris software can be used for other applications as well. Please refer to the file matrixbk_test.c for an example how to use this class in your own programs. (I do not claim it is the best/fastest implementation ever, i just find it very useful, and the routines are checked and working fine.) The Makefile shows how to compile it. Also see Annex B.

The data has to be linear in memory for the VECLIB library, thus this has been done and it used in some other functions to speed them up (see the constructor how this is done).

If the VECLIB library is not used, (slower) internal functions for FFT and matrix multiplication are used. If you like to use your own FFT, only the function four1d has to be changed since the 2d function call this one sequentially.

If the LAPACK library is not used, (slower) internal functions for cholesky are used.

The matrix class is used as a container class for (part of) the images. It has not been defined as a class 'radarimage' because in that case it would have been difficult to perform operations on the images if they didn't fit in the memory as a whole. However, it might be a good idea to define functions such as phasefilter for the matrix class. This would result in calls like:

matrix < complex<real4> > BUFFERMASTER;   // Container
for (i=0; i<NUMBUFFERS; ++i)
  {
    // Read in phase image
    BUFFERMASTER.readfromfile(filename,windowsize,formatflag);    
    // filter this buffer
    BUFFERMASTER.phasefilter(parameters);
    // Write to \outputfile
    BUFFERMASTER.writetofile(filename2,formatflag);               
  }

which seems very readable and maintainable (only the member function "phasefilter" of the matrix class has to be changed if something has to be added).

If you do not have access to LAPACK, but you have a different library, we advice you to use that one. The Cholesky factorization as implemented internally has not been optimized in any way. The same holds for the VECLIB library, particularly the FFT routines. We have included the code for a Cooley-Turkey algorithm, but it handles the data quite slowly, compared to an optimized library.



Subsections
next up previous contents
Next: Matrix class functions Up: usermanual Previous: Format of the products   Contents
Leijen 2009-04-14