From fa5b7f4fb46e013d122a5930008f4cd4b903f627 Mon Sep 17 00:00:00 2001
From: Edoardo Pasca <edo.paskino@gmail.com>
Date: Wed, 2 Aug 2017 16:51:37 +0100
Subject: Added utils.c utils.h

a few regularizers defined the same copyIm function. I moved it into
this new common utils.
---
 main_func/regularizers_CPU/utils.c | 29 +++++++++++++++++++++++++++++
 main_func/regularizers_CPU/utils.h | 27 +++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
 create mode 100644 main_func/regularizers_CPU/utils.c
 create mode 100644 main_func/regularizers_CPU/utils.h

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);
-- 
cgit v1.2.3