>> seti = runtests()
 
################ -------- tests of IPscatt ------- ################
 
Cleared all variables except of "inseti" in setInput.m
   Parameter inseti = tests.
Make dir: output/20190219T201555_tests.
 
## diary -- start diary log ---------------------------------------
 
 
## tests: all -- run all tests-----------------------------
 
 
## testDerivative -- 2D -----------------------------------
 
# setGeomSim
Compute FF(q) and ADFFq
Elapsed time is 6.918182 seconds.
make Jacobi Matrices
Elapsed time is 6.421248 seconds.
t = 1.000000e-01 | Numerator: 8.801949e-02 | Denominator: 9.989684e-02 | double prec. (default)
t = 1.000000e-01 | Numerator: 8.801949e-02 | Denominator: 9.989684e-02 | single prec.
t = 1.000000e-02 | Numerator: 4.563018e-03 | Denominator: 9.989684e-03 | double prec. (default)
t = 1.000000e-02 | Numerator: 4.563018e-03 | Denominator: 9.989684e-03 | single prec.
t = 1.000000e-03 | Numerator: 5.843800e-05 | Denominator: 9.989684e-04 | double prec. (default)
t = 1.000000e-03 | Numerator: 5.843819e-05 | Denominator: 9.989684e-04 | single prec.
t = 1.000000e-04 | Numerator: 6.008286e-07 | Denominator: 9.989684e-05 | double prec. (default)
t = 1.000000e-04 | Numerator: 6.057494e-07 | Denominator: 9.989684e-05 | single prec.
t = 1.000000e-05 | Numerator: 6.034486e-09 | Denominator: 9.989684e-06 | double prec. (default)
t = 1.000000e-05 | Numerator: 5.593690e-08 | Denominator: 9.989684e-06 | single prec.
t = 1.000000e-06 | Numerator: 6.361387e-11 | Denominator: 9.989684e-07 | double prec. (default)
t = 1.000000e-06 | Numerator: 1.263586e-07 | Denominator: 9.989684e-07 | single prec.

Choose random vector g ...
In test case: y = 0 was choosen.
<FF'(q)^ast[FF(q)-y],g> - <FF(q)-y, FF'(q)[g]> = 2.01659e-12+i-3.51992e-13 
 
-----
 
 
## testDerivative -- 3D -----------------------------------
 
# setGeomSim
Compute FF(q) and ADFFq
Elapsed time is 8.438170 seconds.
make Jacobi Matrices
Elapsed time is 8.086079 seconds.
t = 1.000000e-01 | Numerator: 9.507396e-01 | Denominator: 3.829222e-02 | double prec. (default)
t = 1.000000e-02 | Numerator: 4.692476e-02 | Denominator: 3.829222e-03 | double prec. (default)
t = 1.000000e-03 | Numerator: 5.675439e-04 | Denominator: 3.829222e-04 | double prec. (default)
t = 1.000000e-04 | Numerator: 5.811856e-06 | Denominator: 3.829222e-05 | double prec. (default)
t = 1.000000e-05 | Numerator: 6.533161e-08 | Denominator: 3.829222e-06 | double prec. (default)

Choose random vector g ...
In test case: y = 0 was choosen.
<FF'(q)^ast[FF(q)-y],g> - <FF(q)-y, FF'(q)[g]> = 2.88458e-11+i-1.28648e-11 
 
-----
 
 
## testMimo -- 2D -----------------------------------------
 
# setGeomSim
testing mimo for dim = 2, model = helmholtz2D

        |         | rel. error  | rel. error  | grid. gen.  |        
Points  | Points  | of u_s      | of u_s      | +ref.u gen. | comp.  
in CD(N)| in CD(M)| on ROI      | at RX       | time        | time.  
------- + ------- + ----------- + ----------- + ----------- + --------
   31^2 |     0^2 |    0.056808 |    0.057822 |    0.084674 | 0.009677
   32^2 |     0^2 |    0.104797 |    0.105357 |    0.068624 | 0.002250
   63^2 |     0^2 |    0.087199 |    0.087586 |    0.077305 | 0.002674
   64^2 |     0^2 |    0.160126 |    0.160703 |    0.067678 | 0.002310
  127^2 |     0^2 |    0.066372 |    0.066652 |    0.271959 | 0.006676
  128^2 |     0^2 |    0.046566 |    0.046770 |    0.218649 | 0.003371
  255^2 |     0^2 |    0.011359 |    0.011400 |    1.274448 | 0.017200
  256^2 |     0^2 |    0.011959 |    0.012000 |    0.987870 | 0.013297
  511^2 |     0^2 |    0.005534 |    0.005556 |    3.398831 | 0.069126
  512^2 |     0^2 |    0.004406 |    0.004423 |    3.379234 | 0.044767

 
-----
 
 
## testMimo -- 3D -----------------------------------------
 
# setGeomSim
testing mimo for dim = 3, model = helmholtz3D

        |         | rel. error  | rel. error  | grid. gen.  |        
Points  | Points  | of u_s      | of u_s      | +ref.u gen. | comp.  
in CD(N)| in CD(M)| on ROI      | at RX       | time        | time.  
------- + ------- + ----------- + ----------- + ----------- + --------
   63^3 |     0^3 |    0.014940 |    0.013880 |   14.270191 | 0.029751
   64^3 |     0^3 |    0.016725 |    0.015647 |   14.529688 | 0.028831
  127^3 |     0^3 |    0.044609 |    0.045257 |  119.978977 | 0.402112
  128^3 |     0^3 |    0.004786 |    0.004850 |  119.698221 | 0.228035
  255^3 |     0^3 |    0.003975 |    0.004018 |  1017.860922 | 2.582504
  256^3 |     0^3 |    0.009856 |    0.009993 |  1040.162289 | 2.270652

 
-----
 
 
## testGridscale -- 2D ------------------------------------
 
test gridScale: gridUp and gridDown
 
 1) test up- and downscaling
grid upscaling
Elapsed time is 0.002219 seconds.
grid downscaling
Elapsed time is 0.162051 seconds.
dim (length(size(A)): 2 | dim (length(size(B2))): 2
nInv = 127, D = 0 | 
 
 2) test down- and upscaling (several times...) (2D)
number of down- and upscalings: ndu = 2
gridDown...
Elapsed time is 0.009174 seconds.
gridUp...
Elapsed time is 0.000665 seconds.
gridDown...
Elapsed time is 0.013564 seconds.
gridUp...
Elapsed time is 0.000644 seconds.
nInv = 127, err = 0.0158233 | 
 
-----
 
 
## testGridScale -- 3D ------------------------------------
 
test gridScale: gridUp and gridDown
 
 1) test up- and downscaling
grid upscaling
Elapsed time is 0.000307 seconds.
grid downscaling
Elapsed time is 0.045225 seconds.
dim (length(size(A)): 3 | dim (length(size(B2))): 3
nInv = 15, D = 0 | 
 
-----
 
 
## Test mimo (2D) and compare near and far field results --
 
 
-- testset 1 --
 
Compute reference solution
Elapsed time is 6.678049 seconds.
Compute solution
Elapsed time is 0.087758 seconds.
Compute reference solution
Elapsed time is 6.655855 seconds.
Compute solution
Elapsed time is 0.073057 seconds.
testset = 1: planeWave, incNb = 1
compare scatterd near field with reference solution
compare scatterd far field with reference solution
compare scatterd near and far field (near field with huge radius)
ROI: usNear       against usNearRef:   0.001077
RX : usNear       against usNearRef:   0.001275
ROI: usFar        against usFarRef :   0.001077
RX : usFar        against usFarRef :   0.001275
ROI: usFar        against usNearRef:   0.001077
RX : usFarNear    against usNearRef:   0.001230
ROI: usFarRef     against usNearRef:   0.000000
RX : usFarRefNear against usNearRef:   0.000447
 
-- testset 2 --
 
No reference solution available (so no comparison with ref. sol.).
Compute solution
Elapsed time is 1.282577 seconds.
No reference solution available (so no comparison with ref. sol.).
Compute solution
Elapsed time is 1.307640 seconds.
testset = 2: pointSource; Fresnel, op. 1
compare scatterd near and far field
usNearROI against usFarROI   :   0.000000
usNearRX  against usFarRXNear:   0.087751
 
-----
 
 
## Test adjoint of Kd and Kg ------------------------------
 
 - load preliminary settings with suppressed output
 
- Jacobian
Elapsed time is 7.473443 seconds.
- FF(q)
Elapsed time is 1.795777 seconds.
    diff (rel.) = 7.54022e-16 
    <Kd(xnRVD), yd>_dis,R = -0.00230063+0i | <xnRVD, Kd^*(yd)>_roi,R = -0.00230063+0i 
    diff (rel.) = 2.77385e-15 
    <Kg(xnRVD), yg>_tv,R = -2.09938e-07+0i | <xnRVD, Kg^*(yg)>_roi,R = -2.09938e-07+0i 
 
-- Test: is normTVinv2 induced by innergrad? Yes: 
    diff (rel.) = 0 
    ||yg||_tv,R,2 = 0.164325+0i | sqrt(abs(<yg,yg>_tv,R)) = 0.164325+0i 
 
-----
 
 
## diary -- end diary log -----------------------------------------
 

seti = 

  struct with fields:

          inseti: 'tests'
          closed: 0
      usecbarlim: 0
     plotPublish: 0
        plotFreq: 1
         savepng: 1
        saveepsc: 0
         savefig: 0
        savedata: 0
       dirOutput: 'output'
     dirDatetime: '20190219T201555'
       dirSuffix: ''
    dirSuffixAdd: ''
         dirname: 'output/20190219T201555_tests'
      fileSuffix: '_testGridScale3D'
             dim: 2
             rCD: 0.2000
             nCD: 256
          gscale: 0
          nCDinv: 256
               k: 83.7758
           model: 'helmholtz2D'
        contrast: 'fresnel_op1_twodielTM'
         incType: 'pointSource'
        measType: 'farField'
           incNb: 36
          measNb: 72
          radSrc: 0.7200
         radMeas: 0.7600
             tol: 1.0000e-06
     pubFontSize: 20
     plotVisible: 'off'
    plotFreqiPda: 0
               h: 0.0016
              dV: 2.4414e-06
            grid: [2x65536 double]
        ballMask: [256x256 logical]
            nROI: 91
         gridROI: [2x8281 double]
         ROImask: [256x256 logical]
     ballMaskROI: [91x91 logical]
            GROI: @(x)reshape(x,reshapeVecROI)
             GCD: @(x)reshape(x,reshapeVecCD)
               G: @(q)seti.GROI(q)
              iG: @(x)x(:)
            nInv: 91
            hInv: 0.0016
           dVinv: 2.4414e-06
            GInv: @(x)reshape(x,reshapeVecROI)
              GU: @(qROI)qROI
              GD: @(qROI)qROI
               S: @(hz)[real(hz);imag(hz)]
               R: @(hs)hs(1:size(hs,1)/2,:,:,:)
               I: @(hs)hs(size(hs,1)/2+1:size(hs,1),:,:,:)
               T: @(hs)seti.R(hs)+1i.*seti.I(hs)
            kHat: [256x256 double]
         incPnts: [2x36 double]
           dSInc: 0.1255
        measPnts: [2x72 double]
          dSMeas: 0.0872
        incField: [8281x36 double]
         measKer: [72x8281 double]
       qROIexact: [8281x1 double]
             mCD: 0
           qBall: 0.5000
           rBall: 0.5000
     incPntsType: 'circle'
    measPntsType: 'circle'
           invNo: 6
      useWavelet: 0
               p: 2
             inv: 'pda'
              tF: {'fd'  'fg'}
              tG: {'fs'  'fp'}
           alpha: 500
            beta: 1.0000e-05
             tau: 2.5000
           pNorm: 2
           qNorm: 1
         recname: 'contrast'
      physBounds: [-1 3 0 3]
        tolDelta: 1.0000e-14
          useDis: 1
            nOut: 30
            pdaN: 50
     pdaStepsize: 'fix'
        vartheta: 0.5000
          usefp2: 0
       useTolOut: 0
        useTolIn: 0
    saveqROIcomp: 'output/20190219T201555_tests/save_qROIcomp_iOutStop_testGridScale3D.mat'
    loadqROIcomp: []
          lambda: 0.0750
          shrkRe: @(x,alpha)max(min(max((abs(x)-alpha),0).*sign(x),reMax),reMin)
          shrkIm: @(x,alpha)max(min(max((abs(x)-alpha),0).*sign(x),imMax),imMin)
              Kd: @(xnRVD,JA,JB)seti.S(JA*diagsparse(seti.GU(seti.T(xnRVD)))*JB)
           KdAdj: @(yd,JA,JB)seti.S(seti.GD(ADFFqFast(seti.T(yd),JA,JB,seti)))
              vd: @(FFq)seti.S(FFq-seti.FmeasDelta)
              fd: @(DFFqh,FFq)(1/2)*normws(seti.S(DFFqh)+seti.vd(FFq),seti)^2
              vs: @(qCVU)seti.S(seti.GD(qCVU))
              fs: @(qCVU,xnRVD)seti.alpha*normroi(xnRVD+seti.vs(qCVU),seti)
              Kg: @(xnRVD)seti.beta*gradientNeumann(xnRVD,seti.hInv,seti.nInv,seti.GInv,seti)
           KgAdj: @(yg)seti.beta*gradientNeumannAdj(yg,seti)
              vg: @(qCVU)seti.Kg(seti.S(seti.GD(qCVU)))
              fg: @(qCVU,xnRVD)normTVinv1(seti.Kg(xnRVD)+seti.vg(qCVU),seti)
              fp: @(qCVU,xnRVD)d1(real(seti.GD(qCVU))+seti.R(xnRVD))+d2(imag(seti.GD(qCVU))+seti.I(xnRVD))
             fp2: @(qCVU,xnRVD)d1(real(seti.GD(qCVU))+seti.R(xnRVD))+d2(imag(seti.GD(qCVU))+seti.I(xnRVD))

>>

