From fa535bdcd1c8b8f0c05edf3e9b84a2b3213d1494 Mon Sep 17 00:00:00 2001 From: v1j4y Date: Fri, 11 Feb 2022 15:17:57 +0100 Subject: [PATCH] Added size to factor_ee. --- org/qmckl_jastrow.org | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/org/qmckl_jastrow.org b/org/qmckl_jastrow.org index 6889098..8b77724 100644 --- a/org/qmckl_jastrow.org +++ b/org/qmckl_jastrow.org @@ -1246,11 +1246,11 @@ assert(qmckl_nucleus_provided(context)); *** Get #+begin_src c :comments org :tangle (eval h_func) :noweb yes -qmckl_exit_code qmckl_get_jastrow_asymp_jasb(qmckl_context context, double* const asymp_jasb); +qmckl_exit_code qmckl_get_jastrow_asymp_jasb(qmckl_context context, double* const asymp_jasb, int64_t* size_max); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none -qmckl_exit_code qmckl_get_jastrow_asymp_jasb(qmckl_context context, double* const asymp_jasb) +qmckl_exit_code qmckl_get_jastrow_asymp_jasb(qmckl_context context, double* const asymp_jasb, int64_t* size_max) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return QMCKL_NULL_CONTEXT; @@ -1266,6 +1266,7 @@ qmckl_exit_code qmckl_get_jastrow_asymp_jasb(qmckl_context context, double* cons size_t sze = 2; memcpy(asymp_jasb, ctx->jastrow.asymp_jasb, sze * sizeof(double)); + (*size_max) = sze; return QMCKL_SUCCESS; } @@ -1456,7 +1457,7 @@ print("asym_one : ", asym_one) print("asymp_jasb[0] : ", asymp_jasb[0]) print("asymp_jasb[1] : ", asymp_jasb[1]) #+end_src - + #+RESULTS: asymp_jasb : asym_one : 0.43340325572525706 : asymp_jasb[0] : 0.5323750557252571 @@ -1499,7 +1500,8 @@ assert(rc == QMCKL_SUCCESS); assert(qmckl_jastrow_provided(context)); double asymp_jasb[2]; -rc = qmckl_get_jastrow_asymp_jasb(context, asymp_jasb); +int64_t size_max=0; +rc = qmckl_get_jastrow_asymp_jasb(context, asymp_jasb,&size_max); // calculate asymp_jasb assert(fabs(asymp_jasb[0]-0.5323750557252571) < 1.e-12); @@ -1519,11 +1521,11 @@ f_{ee} = \sum_{i,jjastrow.factor_ee, ctx->electron.walk_num*sizeof(double)); + int64_t sze=ctx->electron.walk_num; + memcpy(factor_ee, ctx->jastrow.factor_ee, sze*sizeof(double)); + (*size_max) = sze; return QMCKL_SUCCESS; } @@ -1800,7 +1804,8 @@ print("factor_ee :",factor_ee) assert(qmckl_jastrow_provided(context)); double factor_ee[walk_num]; -rc = qmckl_get_jastrow_factor_ee(context, factor_ee); +size_max=0; +rc = qmckl_get_jastrow_factor_ee(context, factor_ee, &size_max); // calculate factor_ee assert(fabs(factor_ee[0]+4.282760865958113) < 1.e-12);