LCOV - code coverage report
Current view: top level - synthesis/TransformMachines2 - accumulateFromGrid.inc (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 31 31 100.0 %
Date: 2024-11-06 17:42:47 Functions: 0 0 -

          Line data    Source code
       1             : // -*- C++ -*-
       2             : //
       3             : // File to include to have the inner loops for de-gridding
       4             : // (prediction) without a function call.
       5             : //
       6             : //--------------------------------------------------------------------------------
       7             : {
       8      988778 :   Vector<Int> iCFPos(4,0);
       9             :   Int iLoc[2];
      10             :   Bool Dummy;
      11      988778 :   Complex wt;
      12             : 
      13      988778 :   const Int * __restrict__ gridInc_p_ptr = gridInc_p.getStorage(Dummy);
      14      988778 :   const Complex * __restrict__ gridStore = grid.getStorage(Dummy);
      15      988778 :   const Int* support_ptr    = support.getStorage(Dummy);
      16      988778 :   const Float *sampling_ptr = sampling.getStorage(Dummy);
      17      988778 :   const Double *off_ptr           = off.getStorage(Dummy);
      18      988778 :   const Int* convOrigin_ptr       = convOrigin.getStorage(Dummy);
      19      988778 :   const Int *loc_ptr = loc.getStorage(Dummy);
      20             : 
      21      988778 :   Int * __restrict__       igrdpos_ptr   = igrdpos.getStorage(Dummy);
      22      988778 :   Int *iCFPos_ptr                 = iCFPos.getStorage(Dummy);
      23      988778 :   Int *cfInc_p_ptr                = cfInc_p.getStorage(Dummy);
      24             :   Int phaseGradOrigin_l[2]; 
      25             :   
      26      988778 :   phaseGradOrigin_l[0] = cached_phaseGrad_p.shape()(0)/2 ;
      27      988778 :   phaseGradOrigin_l[1] = cached_phaseGrad_p.shape()(1)/2;
      28             :    
      29    14201872 :   for(Int iy=-support_ptr[1]; iy <= support_ptr[1]; iy++) 
      30             :     {
      31    13213094 :       iLoc[1]    = SynthesisUtils::nint(sampling_ptr[1]*iy+off_ptr[1]);
      32    13213094 :       igrdpos_ptr[1] = loc_ptr[1]+iy;
      33    13213094 :       iCFPos_ptr[1]  = iLoc[1] + convOrigin_ptr[1];
      34             : 
      35   198447984 :       for(Int ix=-support_ptr[0]; ix <= support_ptr[0]; ix++) 
      36             :         {
      37   185234890 :           iLoc[0]    = SynthesisUtils::nint(sampling_ptr[0]*ix+off_ptr[0]);
      38   185234890 :           igrdpos_ptr[0] = loc_ptr[0]+ix;
      39   185234890 :           iCFPos_ptr[0]  = iLoc[0] + convOrigin_ptr[0];
      40             :           {
      41   185234890 :             wt=getFrom4DArray((const Complex * __restrict__ &)convFuncV,
      42             :                               //igrdpos,cfInc_p);
      43             :                               iCFPos_ptr,cfInc_p_ptr);
      44   185234890 :             if (dataWVal <= 0.0) wt = conj(wt);
      45   185234890 :             norm(ipol)+=(wt);
      46   185234890 :             if (finitePointingOffset) 
      47             :               {
      48   165419180 :                 wt *= conj(cached_phaseGrad_p(iLoc[0]+phaseGradOrigin_l[0],
      49   165419180 :                                               iLoc[1]+phaseGradOrigin_l[1]));
      50             :               }
      51             :             // nvalue+=wt*grid(grdpos);
      52             :             // The following uses raw index on the 4D grid
      53             :             // nvalue+=wt*getFrom4DArray(gridStore,iPosPtr,gridInc);
      54   185234890 :             nvalue+=wt*getFrom4DArray(gridStore,igrdpos_ptr,gridInc_p_ptr);
      55             :             //nvalue+=wt*getFrom4DArray(gridStore,igrdpos,gridInc_p);
      56             :           }
      57             :         }
      58             :     }
      59      988778 :   nvalue = nvalue *conj(phasor);
      60      988778 : }
      61             : //--------------------------------------------------------------------------------

Generated by: LCOV version 1.16