From 4c7b2213f49759c2b6f8fb8c0b0cd4bdf2c4c02e Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 26 Oct 2020 18:24:23 +0100 Subject: [PATCH] Distance test in Fortran --- src/qmckl_distance.org | 96 +++++++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 44 deletions(-) diff --git a/src/qmckl_distance.org b/src/qmckl_distance.org index 40ee574..d69b133 100644 --- a/src/qmckl_distance.org +++ b/src/qmckl_distance.org @@ -34,34 +34,8 @@ Function for the computation of distances between particles. #include "munit.h" MunitResult test_qmckl_distance() { qmckl_context context; - int64_t m, n, LDA, LDB, LDC; - double *A, *B, *C ; - int i, j; - context = qmckl_context_create(); - m = 5; - n = 6; - LDA = 6; - LDB = 10; - LDC = 5; - - A = (double*) qmckl_malloc (context, LDA*4*sizeof(double)); - B = (double*) qmckl_malloc (context, LDB*3*sizeof(double)); - C = (double*) qmckl_malloc (context, LDC*n*sizeof(double)); - - for (j=0 ; j<3 ; j++) { - for (i=0 ; i 1.d-12 ) return + end do + end do + test_qmckl_distance_sq = 0 + + deallocate(A,B,C) + end function test_qmckl_distance_sq + #+END_SRC + #+BEGIN_SRC C :comments link :tangle test_qmckl_distance.c - - munit_assert_int64(QMCKL_SUCCESS, ==, - qmckl_distance_sq(context, m, n, A, LDA, B, LDB, C, LDC) ); - - for (j=0 ; j