From 5597fb55409ffba0c1a30d5633ec0967c427a858 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Wed, 20 Apr 2016 16:25:50 -0300
Subject: [PATCH] Improved output

---
 tests/testKernel.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/tests/testKernel.c b/tests/testKernel.c
index 2bce7e595c..52b5e8173f 100644
--- a/tests/testKernel.c
+++ b/tests/testKernel.c
@@ -31,34 +31,35 @@ int main() {
   printf("\nSerial Output\n");
   printf("-------------\n");
 
-  for (int i = 0; i <= numPoints; ++i) {
+  for (int i = 0; i < numPoints; ++i) {
 
-    const float x = i * 1.f / numPoints;
+    const float x = i * 2.5f / numPoints;
     float W, dW;
     kernel_deval(x / h, &W, &dW);
 
-    printf("h= %f H= %f x=%f W(x,h)=%f dW(x,h)=%f\n", h, h * kernel_gamma, x, W, dW);
+    printf("%2d: h= %f H= %f x=%f W(x,h)=%f dW(x,h)=%f\n", i, h,
+           h * kernel_gamma, x, W, dW);
   }
 
-  printf("\nVector Output for VEC_SIZE=%d\n",VEC_SIZE);
+  printf("\nVector Output for VEC_SIZE=%d\n", VEC_SIZE);
   printf("-------------\n");
-  for (int i = 0; i < numPoints + 1; i+=VEC_SIZE) {
+  for (int i = 0; i < numPoints; i += VEC_SIZE) {
 
     vector vx, vx_h;
     vector W, dW;
 
-    for (int j = 0; j< VEC_SIZE; j++) {
-      vx.f[j] = (i + j) * 1.f / numPoints;
+    for (int j = 0; j < VEC_SIZE; j++) {
+      vx.f[j] = (i + j) * 2.5f / numPoints;
     }
-    
+
     vx_h.v = vx.v / vec_set1(h);
 
     kernel_deval_vec(&vx_h, &W, &dW);
 
-    for (int j = 0; j< VEC_SIZE; j++) {
-      printf("h= %f H= %f x=%f W(x,h)=%f dW(x,h)=%f\n", h, h * kernel_gamma, vx.f[j], W.f[j], dW.f[j]);
+    for (int j = 0; j < VEC_SIZE; j++) {
+      printf("%2d: h= %f H= %f x=%f W(x,h)=%f dW(x,h)=%f\n", i + j, h,
+             h * kernel_gamma, vx.f[j], W.f[j], dW.f[j]);
     }
-
   }
   return 0;
 }
-- 
GitLab