eprecond.c 624 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
/* This function is copied from DENISE Black Edition from D. Koehn  */

#include "fd.h"
void eprecond(float ** W, float ** vx, float ** vy){
    
    extern int NX, NY, IDX, IDY;
    int i, j;
    
    for (i=1;i<=NX;i=i+IDX){
        for (j=1;j<=NY;j=j+IDY){
            
            W[j][i]+=((vx[j][i]*vx[j][i])+(vy[j][i]*vy[j][i]));
            
        }
    }

}

void eprecond_SH(float ** W, float ** vz){
    
    extern int NX, NY, IDX, IDY;
    int i, j;
    
    for (i=1;i<=NX;i=i+IDX){
        for (j=1;j<=NY;j=j+IDY){
            
            W[j][i]+=((vz[j][i]*vz[j][i]));
            
        }
    }
    
}