summaryrefslogtreecommitdiffstats
path: root/main_func
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2017-08-02 16:51:37 +0100
committerEdoardo Pasca <edo.paskino@gmail.com>2017-08-02 16:51:37 +0100
commitfa5b7f4fb46e013d122a5930008f4cd4b903f627 (patch)
tree710e55a9f246401275f986d2143f06ab9cdde4fb /main_func
parent455efc2f736d3e566f4dd9c13fee9258ee366e5b (diff)
downloadregularization-fa5b7f4fb46e013d122a5930008f4cd4b903f627.tar.gz
regularization-fa5b7f4fb46e013d122a5930008f4cd4b903f627.tar.bz2
regularization-fa5b7f4fb46e013d122a5930008f4cd4b903f627.tar.xz
regularization-fa5b7f4fb46e013d122a5930008f4cd4b903f627.zip
Added utils.c utils.h
a few regularizers defined the same copyIm function. I moved it into this new common utils.
Diffstat (limited to 'main_func')
-rw-r--r--main_func/regularizers_CPU/utils.c29
-rw-r--r--main_func/regularizers_CPU/utils.h27
2 files changed, 56 insertions, 0 deletions
diff --git a/main_func/regularizers_CPU/utils.c b/main_func/regularizers_CPU/utils.c
new file mode 100644
index 0000000..0e83d2c
--- /dev/null
+++ b/main_func/regularizers_CPU/utils.c
@@ -0,0 +1,29 @@
+/*
+This work is part of the Core Imaging Library developed by
+Visual Analytics and Imaging System Group of the Science Technology
+Facilities Council, STFC
+
+Copyright 2017 Daniil Kazanteev
+Copyright 2017 Srikanth Nagella, Edoardo Pasca
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+#include "utils.h"
+
+/* Copy Image */
+float copyIm(float *A, float *U, int dimX, int dimY, int dimZ)
+{
+ int j;
+#pragma omp parallel for shared(A, U) private(j)
+ for (j = 0; j<dimX*dimY*dimZ; j++) U[j] = A[j];
+ return *U;
+} \ No newline at end of file
diff --git a/main_func/regularizers_CPU/utils.h b/main_func/regularizers_CPU/utils.h
new file mode 100644
index 0000000..c720006
--- /dev/null
+++ b/main_func/regularizers_CPU/utils.h
@@ -0,0 +1,27 @@
+/*
+This work is part of the Core Imaging Library developed by
+Visual Analytics and Imaging System Group of the Science Technology
+Facilities Council, STFC
+
+Copyright 2017 Daniil Kazanteev
+Copyright 2017 Srikanth Nagella, Edoardo Pasca
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+#include <matrix.h>
+#include <math.h>
+#include <stdlib.h>
+#include <memory.h>
+#include <stdio.h>
+#include "omp.h"
+
+float copyIm(float *A, float *U, int dimX, int dimY, int dimZ);