summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2019-08-08 22:59:32 +0100
committerEdoardo Pasca <edo.paskino@gmail.com>2019-08-08 22:59:32 +0100
commit98e14b257b2e9f8d89e34a5ed01c17a1ab0d8652 (patch)
tree1e469305a5ae28684432ca30c4873d4781ff3e1f
parent1e16641b20e7d2a6ccdadfde6bf700e42ba03f29 (diff)
downloadregularization-98e14b257b2e9f8d89e34a5ed01c17a1ab0d8652.tar.gz
regularization-98e14b257b2e9f8d89e34a5ed01c17a1ab0d8652.tar.bz2
regularization-98e14b257b2e9f8d89e34a5ed01c17a1ab0d8652.tar.xz
regularization-98e14b257b2e9f8d89e34a5ed01c17a1ab0d8652.zip
reverted commit
-rw-r--r--src/Core/regularisers_CPU/FGP_TV_core.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/src/Core/regularisers_CPU/FGP_TV_core.c b/src/Core/regularisers_CPU/FGP_TV_core.c
index eddefd6..69c92bc 100644
--- a/src/Core/regularisers_CPU/FGP_TV_core.c
+++ b/src/Core/regularisers_CPU/FGP_TV_core.c
@@ -191,30 +191,15 @@ float Grad_func2D(float *P1, float *P2, float *D, float *R1, float *R2, float la
long i,j,index;
multip = (1.0f/(8.0f*lambda));
#pragma omp parallel for shared(P1,P2,D,R1,R2,multip) private(index,i,j,val1,val2)
- for(j=0; j<dimY-1; j++) {
- for(i=0; i<dimX-1; i++) {
- index = j*dimX+i;
+ for(j=0; j<dimY; j++) {
+ for(i=0; i<dimX; i++) {
+ index = j*dimX+i;
/* boundary conditions */
- if (i == dimX-1) val1 = 0.0f; else val1 = D[index] - D[index+1];
- if (j == dimY-1) val2 = 0.0f; else val2 = D[index] - D[index + dimX];
+ if (i == dimX-1) val1 = 0.0f; else val1 = D[index] - D[j*dimX + (i+1)];
+ if (j == dimY-1) val2 = 0.0f; else val2 = D[index] - D[(j+1)*dimX + i];
P1[index] = R1[index] + multip*val1;
P2[index] = R2[index] + multip*val2;
- }
- }
-
- /* boundary conditions */
- i = dimX - 1 ;
- for(j=0; j<dimY; j++) {
- index = j*dimX+i;
- P1[index] = R1[index];
- }
- j = dimY - 1;
- for (i=0;i<dimX; i++)
- {
- index = j*dimX+i;
- P2[index] = R2[index];
-
- }
+ }}
return 1;
}
float Proj_func2D(float *P1, float *P2, int methTV, long DimTotal)